Don't silently ignore errors from the activation script
This commit is contained in:
parent
883fa4f920
commit
785ed2b528
@ -225,7 +225,10 @@ fi
|
|||||||
# If we're not just building, then make the new configuration the boot
|
# If we're not just building, then make the new configuration the boot
|
||||||
# default and/or activate it now.
|
# default and/or activate it now.
|
||||||
if [ "$action" = switch -o "$action" = boot -o "$action" = test ]; then
|
if [ "$action" = switch -o "$action" = boot -o "$action" = test ]; then
|
||||||
$pathToConfig/bin/switch-to-configuration "$action"
|
if ! $pathToConfig/bin/switch-to-configuration "$action"; then
|
||||||
|
echo "warning: there were error switching to the new configuration" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
@ -97,8 +97,7 @@ in
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
''
|
''
|
||||||
source=${if source != "" then source else "$(PATH=$SETUID_PATH type -tP ${program})"}
|
if ! source=${if source != "" then source else "$(PATH=$SETUID_PATH type -tP ${program})"}; then
|
||||||
if test -z "$source"; then
|
|
||||||
# If we can't find the program, fall back to the
|
# If we can't find the program, fall back to the
|
||||||
# system profile.
|
# system profile.
|
||||||
source=/nix/var/nix/profiles/default/bin/${program}
|
source=/nix/var/nix/profiles/default/bin/${program}
|
||||||
|
@ -66,6 +66,9 @@ in
|
|||||||
PATH=$PATH:$i/bin:$i/sbin
|
PATH=$PATH:$i/bin:$i/sbin
|
||||||
done
|
done
|
||||||
|
|
||||||
|
_status=0
|
||||||
|
trap "_status=1" ERR
|
||||||
|
|
||||||
# Ensure a consistent umask.
|
# Ensure a consistent umask.
|
||||||
umask 0022
|
umask 0022
|
||||||
|
|
||||||
@ -84,6 +87,8 @@ in
|
|||||||
|
|
||||||
# Prevent the current configuration from being garbage-collected.
|
# Prevent the current configuration from being garbage-collected.
|
||||||
ln -sfn /run/current-system /nix/var/nix/gcroots/current-system
|
ln -sfn /run/current-system /nix/var/nix/gcroots/current-system
|
||||||
|
|
||||||
|
exit $_status
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user