fawltydeps: add update script

This commit is contained in:
Dmitriy Pleshevskiy 2023-03-16 01:12:20 +03:00
parent 19b0deadea
commit 360d84d045
Signed by: pleshevskiy
GPG key ID: 79C4487B44403985
2 changed files with 35 additions and 3 deletions

View file

@ -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
View 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