about summary refs log tree commit diff
path: root/scripts/nix-reduce-build.in
diff options
context:
space:
mode:
authorMichael Raskin <7c6f434c@mail.ru>2008-05-11T15·54+0000
committerMichael Raskin <7c6f434c@mail.ru>2008-05-11T15·54+0000
commit9819bb20da130509ab62f303267331c2403b043c (patch)
tree1b413b83e6b6d6748525c92a98434d0b8e54381f /scripts/nix-reduce-build.in
parentb4bc8b76160ff81e0e5489b88ff3ca8cbd587131 (diff)
Added support for file:// archive (.nar.gz) repositories to nix-reduce-build. /tmp/nix-export created by nix-http-export.cgi is OK.
Diffstat (limited to 'scripts/nix-reduce-build.in')
-rw-r--r--scripts/nix-reduce-build.in5
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/nix-reduce-build.in b/scripts/nix-reduce-build.in
index f9cb5012b4..2fd946c654 100644
--- a/scripts/nix-reduce-build.in
+++ b/scripts/nix-reduce-build.in
@@ -59,6 +59,7 @@ for i in "$@"; do
 	sshHost="${i#ssh://}";
 	httpHost="${i#http://}";
 	httpsHost="${i#https://}";
+	filePath="${i#file:/}";
 	if [ "$i" != "$sshHost" ]; then
 		cat needed-paths | while read; do 
 			nix-copy-closure --from "$sshHost" --gzip "$REPLY" </dev/null || true; 
@@ -67,6 +68,10 @@ for i in "$@"; do
 		cat needed-paths | while read; do
 			curl ${BAD_CERTIFICATE:+-k} -L "$i${REPLY##*/}" | gunzip | nix-store --import;
 		done;
+	elif [ "$i" != "filePath" ] ; then
+		cat needed-paths | while read; do 
+			gunzip < "$filePath/${REPLY##*/}".nar.gz | nix-store --import;
+		done;
 	fi;
 	mv needed-paths wanted-paths;
 	cat wanted-paths | xargs nix-store --check-validity --print-invalid > needed-paths;