summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2017-05-30 16:01:03 +0200
committerMatthias Beyer <mail@beyermatthias.de>2017-05-30 16:01:03 +0200
commite457a083df052035d53b33b24aab5fad849ca982 (patch)
treede8f71e40a6107af59032ac6dd8f56fca1d49074
parent7f3642a828726e1570b1a9975979e058753c6969 (diff)
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).
-rwxr-xr-xnix-script-switch.sh6
1 files changed, 6 insertions, 0 deletions
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'"