diff options
author | Michael Raskin <7c6f434c@mail.ru> | 2008-04-29T04·03+0000 |
---|---|---|
committer | Michael Raskin <7c6f434c@mail.ru> | 2008-04-29T04·03+0000 |
commit | b1e321d6ce0b4ef2e042021939a3d6be160841f8 (patch) | |
tree | 7748fd1c8d13a28b801495abf0dadafe0aecad37 /scripts/nix-reduce-build.in | |
parent | 658816ddc9b6c22ddb9de27b82fc15af2a473723 (diff) |
Added http alternative transport for nix-reduce-build
Diffstat (limited to '')
-rw-r--r-- | scripts/nix-reduce-build.in | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/scripts/nix-reduce-build.in b/scripts/nix-reduce-build.in index 6d7f8bdd7f63..7e546aa60fbb 100644 --- a/scripts/nix-reduce-build.in +++ b/scripts/nix-reduce-build.in @@ -56,9 +56,18 @@ if test -z "$1" ; then fi; for i in "$@"; do - cat needed-paths | while read; do - nix-copy-closure --from "$i" --gzip "$REPLY" </dev/null || true; - done; + sshHost="${i#ssh://}"; + httpHost="${i#http://}"; + httpsHost="${i#https://}"; + if [ "$i" != "$sshHost" ]; then + cat needed-paths | while read; do + nix-copy-closure --from "$sshHost" --gzip "$REPLY" </dev/null || true; + done; + elif [ "$i" != "$httpHost" ] || [ "$i" != "$httpsHost" ]; then + cat needed-paths | while read; do + curl -L "$i${REPLY##*/}" | gunzip | nix-store --import; + done; + fi; mv needed-paths wanted-paths; cat wanted-paths | xargs nix-store --check-validity --print-invalid > needed-paths; echo We still need $(cat needed-paths | wc -l) paths. >&2 |