fawltydeps: add update script
This commit is contained in:
parent
19b0deadea
commit
360d84d045
2 changed files with 35 additions and 3 deletions
|
@ -36,12 +36,12 @@ let
|
|||
src = fetchFromGitHub {
|
||||
owner = "tweag";
|
||||
repo = "FawltyDeps";
|
||||
rev = "0201e74a158c5774db9150e1e70f01e76bad34e7";
|
||||
sha256 = "sha256-kSAy6IOS+G+e7hG4ZseglhOsnJ7Tg87MaMRCWUoSJdA=";
|
||||
rev = "f8b156756b1de47c578935c4d6f6a7a8f2975c63";
|
||||
sha256 = "sha256-3oQX0oX1+jZAC+vTRd7dUGNfioc6ADFmF+GSbvVyYsQ=";
|
||||
};
|
||||
in
|
||||
poetry2nix.mkPoetryApplication {
|
||||
version = "2023-03-14";
|
||||
version = "2023-03-16";
|
||||
python = python39;
|
||||
projectDir = "${src}";
|
||||
overrides = poetryOverrides;
|
||||
|
|
32
pkgs/fawltydeps/update.sh
Executable file
32
pkgs/fawltydeps/update.sh
Executable file
|
@ -0,0 +1,32 @@
|
|||
#! /usr/bin/env nix-shell
|
||||
#! nix-shell -i bash -p nix-prefetch-github gnused jq
|
||||
|
||||
function help() {
|
||||
echo "Regenerates packaging data for the fawltydeps package."
|
||||
echo "Usage: $0 <rev>"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [[ $# -gt 1 || $1 == -* ]]; then
|
||||
help
|
||||
fi
|
||||
|
||||
set -x
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
version="$1"
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
if [ -z "$version" ]; then
|
||||
help
|
||||
fi
|
||||
|
||||
src_hash=$(nix-prefetch-github tweag FawltyDeps --rev "${version}" | jq -r .sha256)
|
||||
src_hash=$(nix hash to-sri --type sha256 "$src_hash")
|
||||
|
||||
sed -i -E -e "s#rev = \".*\"#rev = \"$version\"#" default.nix
|
||||
sed -i -E -e "s#sha256 = \".*\"#sha256 = \"$src_hash\"#" default.nix
|
||||
sed -i -E -e "s#version = \".*\"#version = \"$(date +%Y-%m-%d)\"#" default.nix
|
||||
|
||||
|
Loading…
Reference in a new issue