From 4ce68819b673eb4ec40fbd49d6e5e0aae1205e37 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Wed, 15 Jun 2016 10:33:52 +0200 Subject: Add flag (-C) to append channel generation to tag name --- nix-script-switch.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'nix-script-switch.sh') diff --git a/nix-script-switch.sh b/nix-script-switch.sh index e91fe8c..7fc3b9c 100755 --- a/nix-script-switch.sh +++ b/nix-script-switch.sh @@ -22,6 +22,8 @@ usage() { -t Custom tag name + -C Append channel generation in tag (-channel-) + -p [] Generate the switch tag in the nixpkgs at as well. (default: '$RC_NIXPKGS') @@ -78,6 +80,7 @@ COMMAND=switch ARGS= WD=$RC_CONFIG TAG_NAME= +APPEND_CHANNEL_GEN= HOSTNAME="$(hostname)" TAG_NIXPKGS=0 NIXPKGS=$RC_NIXPKGS @@ -89,7 +92,7 @@ DONT_BUILD= QUIET=1 USE_ALTERNATIVE_SOURCE_NIXPKGS=0 -while getopts "c:w:t:nbp:f:qs:r:h" OPTION +while getopts "c:w:t:Cnbp:f:qs:r:h" OPTION do case $OPTION in c) @@ -107,6 +110,11 @@ do dbg "TAG_NAME = $TAG_NAME" ;; + C) + APPEND_CHANNEL_GEN=1 + dbg "APPEND_CHANNEL_GEN = $APPEND_CHANNEL_GEN" + ;; + n) HOSTNAME="" dbg "HOSTNAME = $HOSTNAME" @@ -207,6 +215,14 @@ then fi fi +if [[ $APPEND_CHANNEL_GEN -eq 1 ]]; then + dbg "Appending channel generation to tag name" + TAG_NAME="${TAG_NAME}-channel-$(current_channel_generation)" + dbg "TAG_NAME = $TAG_NAME" +else + dbg "Not appending channel generation to tag name" +fi + if [[ "$COMMAND" =~ "build" ]] then stdout "Command is 'build'. Not generating config tag" -- cgit v1.2.3