From e457a083df052035d53b33b24aab5fad849ca982 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Tue, 30 May 2017 16:01:03 +0200 Subject: Fix bug when building non-switch and appending channel hash When we build a non-switch (e.g. "boot") and append the channel hash in the config tag, we append the wrong hash (not the hash of the channel of the build generation but the hash of the current channel). This is a severe bug which is fixed with this commit (by simply failing to allow the combination of these two flags). --- nix-script-switch.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nix-script-switch.sh b/nix-script-switch.sh index 69a04fb..547a2c9 100755 --- a/nix-script-switch.sh +++ b/nix-script-switch.sh @@ -186,6 +186,12 @@ dbg "ARGS = $ARGS" [[ ! -d "$WD" ]] && stderr "No directory: $WD" && exit 1 +[[ "$COMMAND" != "switch" ]] && [[ $APPEND_CHANNEL_GEN == 1 ]] && { + stderr "Cannot append channel generation if non-switch build," + stderr "as this is currently not supported." + exit 1 +} + TAG_TARGET=$(__quiet__ __git "$WD" rev-parse HEAD) stdout "Tag in config will be generated at '$TAG_TARGET'" -- cgit v1.2.3