aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Raskin <7c6f434c@mail.ru>2008-04-29 04:03:54 +0000
committerMichael Raskin <7c6f434c@mail.ru>2008-04-29 04:03:54 +0000
commitb1e321d6ce0b4ef2e042021939a3d6be160841f8 (patch)
tree7748fd1c8d13a28b801495abf0dadafe0aecad37
parent658816ddc9b6c22ddb9de27b82fc15af2a473723 (diff)
Added http alternative transport for nix-reduce-build
-rw-r--r--scripts/nix-reduce-build.in15
1 files changed, 12 insertions, 3 deletions
diff --git a/scripts/nix-reduce-build.in b/scripts/nix-reduce-build.in
index 6d7f8bdd7..7e546aa60 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