mirror of
https://github.com/ryantm/nixpkgs-update.git
synced 2024-12-17 08:21:44 +03:00
check to make sure staging hasn't been updated already
This commit is contained in:
parent
0954b0b859
commit
3a19c72caa
15
up.sh
15
up.sh
@ -14,17 +14,24 @@ DERIVATION_FILE=$(find . | grep "/$1/default.nix" | head -n1)
|
||||
function error_cleanup() {
|
||||
git checkout master
|
||||
git reset --hard
|
||||
git branch -D "$BRANCH_NAME"
|
||||
git branch -D "$BRANCH_NAME" || true
|
||||
exit 1
|
||||
}
|
||||
trap error_cleanup ERR
|
||||
|
||||
git checkout -B "$BRANCH_NAME"
|
||||
git reset --hard
|
||||
|
||||
OLD_HASH=$(nix eval -f . --raw "pkgs.${PACKAGE_NAME}.src.drvAttrs.outputHash")
|
||||
|
||||
# Make sure it hasn't been updated on master
|
||||
grep "$2" "$DERIVATION_FILE"
|
||||
|
||||
# Make sure it hasn't been updated on staging
|
||||
git checkout staging
|
||||
grep "$2" "$DERIVATION_FILE"
|
||||
|
||||
git checkout master
|
||||
|
||||
git checkout -B "$BRANCH_NAME"
|
||||
OLD_HASH=$(nix eval -f . --raw "pkgs.${PACKAGE_NAME}.src.drvAttrs.outputHash")
|
||||
sed -i "s/$2/$3/g" "$DERIVATION_FILE"
|
||||
|
||||
NEW_HASH=$(nix-prefetch-url -A "$1.src")
|
||||
|
Loading…
Reference in New Issue
Block a user