Merge pull request #44526 from samueldr/feature/actiavation-failure-identification

nixos/activation: Identifies the snippet that failed
This commit is contained in:
Graham Christensen 2018-09-02 14:28:10 -04:00 committed by GitHub
commit f14b6cb6ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,7 +8,12 @@ let
addAttributeName = mapAttrs (a: v: v // {
text = ''
#### Activation script snippet ${a}:
_localstatus=0
${v.text}
if (( _localstatus > 0 )); then
printf "Activation script snippet '%s' failed (%s)\n" "${a}" "$_localstatus"
fi
'';
});
@ -71,7 +76,7 @@ in
done
_status=0
trap "_status=1" ERR
trap "_status=1 _localstatus=\$?" ERR
# Ensure a consistent umask.
umask 0022