mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-03 03:23:17 +00:00
Merge pull request #9 from viric/pull-pipefail
nixos-rebuild: make 'pull' fail in case it did not pull anything.
This commit is contained in:
commit
7acfd8ec20
@ -125,9 +125,13 @@ fi
|
|||||||
# Pull the manifests defined in the configuration (the "manifests"
|
# Pull the manifests defined in the configuration (the "manifests"
|
||||||
# attribute). Wonderfully hacky.
|
# attribute). Wonderfully hacky.
|
||||||
if [ -n "$pullManifest" -o "$action" = pull ]; then
|
if [ -n "$pullManifest" -o "$action" = pull ]; then
|
||||||
|
set -o pipefail
|
||||||
manifests=$(nix-instantiate --eval-only --xml --strict '<nixos>' -A manifests \
|
manifests=$(nix-instantiate --eval-only --xml --strict '<nixos>' -A manifests \
|
||||||
| grep '<string' | sed 's^.*"\(.*\)".*^\1^g')
|
| grep '<string' | sed 's^.*"\(.*\)".*^\1^g')
|
||||||
|
|
||||||
|
set -o nopipefail
|
||||||
|
if [ $? -ne 0 ]; then exit 1; fi
|
||||||
|
|
||||||
mkdir -p /nix/var/nix/channel-cache
|
mkdir -p /nix/var/nix/channel-cache
|
||||||
for i in $manifests; do
|
for i in $manifests; do
|
||||||
NIX_DOWNLOAD_CACHE=/nix/var/nix/channel-cache nix-pull $i || true
|
NIX_DOWNLOAD_CACHE=/nix/var/nix/channel-cache nix-pull $i || true
|
||||||
|
Loading…
Reference in New Issue
Block a user