nixos/activation: Identifies the snippet that failed
This allows a developer to better identify in which snippet the failure happened. Furthermore, users seeking help will have more information available about the failure.
This commit is contained in:
parent
2428f5dda1
commit
6a25a35e70
|
@ -8,7 +8,12 @@ let
|
||||||
addAttributeName = mapAttrs (a: v: v // {
|
addAttributeName = mapAttrs (a: v: v // {
|
||||||
text = ''
|
text = ''
|
||||||
#### Activation script snippet ${a}:
|
#### Activation script snippet ${a}:
|
||||||
|
_localstatus=0
|
||||||
${v.text}
|
${v.text}
|
||||||
|
|
||||||
|
if (( _localstatus > 0 )); then
|
||||||
|
printf "Activation script snippet '%s' failed (%s)\n" "${a}" "$_localstatus"
|
||||||
|
fi
|
||||||
'';
|
'';
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -71,7 +76,7 @@ in
|
||||||
done
|
done
|
||||||
|
|
||||||
_status=0
|
_status=0
|
||||||
trap "_status=1" ERR
|
trap "_status=1 _localstatus=\$?" ERR
|
||||||
|
|
||||||
# Ensure a consistent umask.
|
# Ensure a consistent umask.
|
||||||
umask 0022
|
umask 0022
|
||||||
|
|
Loading…
Reference in New Issue