Skip to content

Commit

Permalink
Merge pull request NixOS#9 from viric/pull-pipefail
Browse files Browse the repository at this point in the history
nixos-rebuild: make 'pull' fail in case it did not pull anything.
  • Loading branch information
viric committed Jun 28, 2012
2 parents 34e8f68 + de87b07 commit 7acfd8e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/installer/tools/nixos-rebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,13 @@ fi
# Pull the manifests defined in the configuration (the "manifests"
# attribute). Wonderfully hacky.
if [ -n "$pullManifest" -o "$action" = pull ]; then
set -o pipefail
manifests=$(nix-instantiate --eval-only --xml --strict '<nixos>' -A manifests \
| grep '<string' | sed 's^.*"\(.*\)".*^\1^g')

set -o nopipefail
if [ $? -ne 0 ]; then exit 1; fi

mkdir -p /nix/var/nix/channel-cache
for i in $manifests; do
NIX_DOWNLOAD_CACHE=/nix/var/nix/channel-cache nix-pull $i || true
Expand Down

0 comments on commit 7acfd8e

Please sign in to comment.