summaryrefslogtreecommitdiffstats
path: root/nix-script-update-package-def.sh
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2015-07-12 19:32:39 +0200
committerMatthias Beyer <mail@beyermatthias.de>2015-07-15 21:56:06 +0200
commit30c13ba757ace9b1c9096f9bb6a56e4685148ea2 (patch)
tree22f1e267b7439bd0dc6b925c62fa265f63f77eec /nix-script-update-package-def.sh
parent1cd8d5c7f9ed7c99252ff4e7df78cdb67e9fac73 (diff)
Add flag to disable base-branch checkout after successfull run
Diffstat (limited to 'nix-script-update-package-def.sh')
-rwxr-xr-xnix-script-update-package-def.sh11
1 files changed, 9 insertions, 2 deletions
diff --git a/nix-script-update-package-def.sh b/nix-script-update-package-def.sh
index bb9dd0f..a9d54a4 100755
--- a/nix-script-update-package-def.sh
+++ b/nix-script-update-package-def.sh
@@ -19,6 +19,7 @@ usage() {
-u <url> Download and apply this url
-g <path> Path of nixpkgs clone (defaults to ./)
-c Don't check out another branch for update
+ -d Don't checkout base branch after successfull run.
-h Show this help and exit
Helper for developers of Nix packages.
@@ -55,8 +56,9 @@ TESTBUILD=0
NIXPKGS=
URL=
CHECKOUT=1
+DONT_CHECKOUT_BASE=
-while getopts "ybu:g:ch" OPTION
+while getopts "ybu:g:cdh" OPTION
do
case $OPTION in
y)
@@ -84,6 +86,11 @@ do
stdout "CHECKOUT = $CHECKOUT"
;;
+ d)
+ DONT_CHECKOUT_BASE=1
+ stdout "DONT_CHECKOUT_BASE = $DONT_CHECKOUT_BASE"
+ ;;
+
h)
usage
exit 0
@@ -159,7 +166,7 @@ fi
#
# If we checked out a new branch, we go back, too.
#
-if [[ $CHECKOUT == 1 ]]
+if [[ $CHECKOUT == 1 && -z "$DONT_CHECKOUT_BASE" ]]
then
stdout "Switching back to old commit which was current before we started."
stdout "Switching to '$CURRENT_BRANCH'"