From 822c072cfa0f1e4ac304343d78e024ba19da34a8 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 10 Jul 2003 20:34:29 +0000 Subject: [PATCH] * Compress Nix archives when pushing them. --- corepkgs/nar/nar.sh | 2 +- corepkgs/nar/unnar.sh | 2 +- scripts/nix-pull | 2 +- scripts/nix-push | 6 ++++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/corepkgs/nar/nar.sh b/corepkgs/nar/nar.sh index 6ffcf6322..3dbeed029 100644 --- a/corepkgs/nar/nar.sh +++ b/corepkgs/nar/nar.sh @@ -1,3 +1,3 @@ #! /bin/sh -/tmp/nix/bin/nix --dump --file "$path" > $out || exit 1 +/tmp/nix/bin/nix --dump --file "$path" | bzip2 > $out || exit 1 diff --git a/corepkgs/nar/unnar.sh b/corepkgs/nar/unnar.sh index e6a3f3c1f..01b6a3ebe 100644 --- a/corepkgs/nar/unnar.sh +++ b/corepkgs/nar/unnar.sh @@ -1,3 +1,3 @@ #! /bin/sh -/tmp/nix/bin/nix --restore "$out" < $nar || exit 1 +bunzip2 < $nar | /tmp/nix/bin/nix --restore "$out" || exit 1 diff --git a/scripts/nix-pull b/scripts/nix-pull index 6404cb79a..320322585 100644 --- a/scripts/nix-pull +++ b/scripts/nix-pull @@ -31,7 +31,7 @@ while () { my $fn = $1; next if $fn =~ /\.\./; next if $fn =~ /\//; - next unless $fn =~ /-([0-9a-z]{32})(-s-([0-9a-z]{32}))?\.nar/; + next unless $fn =~ /-([0-9a-z]{32})(-s-([0-9a-z]{32}))?\.nar.bz2$/; my $hash = $1; my $fshash = $3; diff --git a/scripts/nix-push b/scripts/nix-push index 248a3b917..bf30f3a49 100644 --- a/scripts/nix-push +++ b/scripts/nix-push @@ -33,7 +33,7 @@ foreach my $hash (@ARGV) { if ($path =~ /-s-([0-9a-z]{32}).nix$/) { $name = "$name-s-$1"; } - $name = $name . ".nar"; + $name = $name . ".nar.bz2"; # Construct a Fix expression that creates a Nix archive. my $fixexpr = @@ -65,4 +65,6 @@ foreach my $hash (@ARGV) { } # Push the prebuilts to the server. !!! FIXME -system "rsync -av -e ssh @pushlist eelco\@losser.st-lab.cs.uu.nl:/home/eelco/public_html/nix-dist/"; +if (scalar @pushlist > 0) { + system "rsync -av -e ssh @pushlist eelco\@losser.st-lab.cs.uu.nl:/home/eelco/public_html/nix-dist/"; +}