From 7db39f9f1282d038bdaab259d3fa62d3a3ece00f Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sun, 8 Jan 2017 07:51:19 +0100 Subject: switch: Tag current channel commit hash in channel tag --- nix-script-switch.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/nix-script-switch.sh b/nix-script-switch.sh index 7fc3b9c..3c97d76 100755 --- a/nix-script-switch.sh +++ b/nix-script-switch.sh @@ -22,7 +22,11 @@ usage() { -t Custom tag name - -C Append channel generation in tag (-channel-) + -C Append channel generation in tag (-channel--) + Expl: + : nixos- + : Number of the generation + : SHA1 (abbrev) of the commit of the channel in nixpkgs -p [] Generate the switch tag in the nixpkgs at as well. (default: '$RC_NIXPKGS') @@ -217,7 +221,8 @@ fi if [[ $APPEND_CHANNEL_GEN -eq 1 ]]; then dbg "Appending channel generation to tag name" - TAG_NAME="${TAG_NAME}-channel-$(current_channel_generation)" + commit=$(nixos-version | sed -r 's,(.*)\.(.*)\ (.*),\2,') + TAG_NAME="${TAG_NAME}-channel-$(current_channel_generation)-${commit}" dbg "TAG_NAME = $TAG_NAME" else dbg "Not appending channel generation to tag name" -- cgit v1.2.3 From 62fdb04f4155a073c251676faf87a12112d98e20 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sun, 8 Jan 2017 07:53:42 +0100 Subject: Add note that the arg -p is deprecated --- nix-script-switch.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nix-script-switch.sh b/nix-script-switch.sh index 3c97d76..69a04fb 100755 --- a/nix-script-switch.sh +++ b/nix-script-switch.sh @@ -30,6 +30,10 @@ usage() { -p [] Generate the switch tag in the nixpkgs at as well. (default: '$RC_NIXPKGS') + (Warning: deprecated + This flag is deprecated as tagging with the channel + commit hash is now default + ) -r [] Update the in the before tagging. Multiple possible, seperate with spaces. @@ -239,6 +243,10 @@ if [[ $TAG_NIXPKGS -eq 1 ]] then if [[ ! -z "$NIXPKGS" ]] then + stderr "This option is deprecated." + stderr "Therefor it might be removed in the next version." + stderr "Please complain in the official nixos-scripts repository." + stdout "Trying to generate tag in $NIXPKGS" [[ ! -d "$NIXPKGS" ]] && \ stderr "'$NIXPKGS' is not a directory, so can't be a nixpkgs clone" && \ -- cgit v1.2.3