git.iko.soy/typeable/nixpkgs
on master help sign in
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.

commit6a25a35e704689d2bfa6c39032844674e6fdb3fd authorSamuel Dionne-Riel <samuel@dionne-riel.com> dateSun 5 Aug 2018, 19:15 (8 years ago) parent2428f5d
1 file changed+6−1
nixos/modules/system/activation/activation-script.nix+6−1
nixos/modules/system/activation/activation-script.nix+6−1
@@ -8,7 +8,12 @@ let
88 addAttributeName = mapAttrs (a: v: v // {
99 text = ''
1010 #### Activation script snippet ${a}:
11+ _localstatus=0
1112 ${v.text}
13+
14+ if (( _localstatus > 0 )); then
15+ printf "Activation script snippet '%s' failed (%s)\n" "${a}" "$_localstatus"
16+ fi
1217 '';
1318 });
1419
@@ -71,7 +76,7 @@ in
7176 done
7277
7378 _status=0
74− trap "_status=1" ERR
79+ trap "_status=1 _localstatus=\$?" ERR
7580
7681 # Ensure a consistent umask.
7782 umask 0022