From b1c5f3c10dbcbbb9469ba7147bb26acf6a9aa733 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 16 Jan 2004 14:54:39 +0000 Subject: [PATCH] * Doh! Edited `readmanifest.pm' instead of `readmanifest.pm.in'. --- scripts/prebuilts.conf | 4 ++-- scripts/readmanifest.pm.in | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/prebuilts.conf b/scripts/prebuilts.conf index c7bc89c61..394436538 100644 --- a/scripts/prebuilts.conf +++ b/scripts/prebuilts.conf @@ -1,2 +1,2 @@ -# A list of URLs from where we obtain Nix archives. -http://losser.st-lab.cs.uu.nl/~eelco/nix-dist/ +# A list of URLs from where `nix-pull' obtain Nix archives if +# no URL is specified on the command line. diff --git a/scripts/readmanifest.pm.in b/scripts/readmanifest.pm.in index e8819d8b8..2c6223807 100644 --- a/scripts/readmanifest.pm.in +++ b/scripts/readmanifest.pm.in @@ -10,15 +10,16 @@ sub processURL { $url =~ s/\/$//; print "obtaining list of Nix archives at $url...\n"; - system "wget --cache=off '$url'/MANIFEST -O '$manifest' 2> /dev/null"; # !!! escape - if ($?) { die "`wget' failed"; } + system("curl --fail --silent --show-error " . + "'$url/MANIFEST' > '$manifest' 2> /dev/null") == 0 + or die "curl failed: $?"; open MANIFEST, "<$manifest"; my $inside = 0; my $storepath; - my $narname; + my $narurl; my $hash; my @preds; @@ -31,7 +32,7 @@ sub processURL { if (/^\{$/) { $inside = 1; undef $storepath; - undef $narname; + undef $narurl; undef $hash; @preds = (); } @@ -39,10 +40,9 @@ sub processURL { } else { if (/^\}$/) { $inside = 0; - my $fullurl = "$url/$narname"; - $$storepaths2urls{$storepath} = $fullurl; - $$urls2hashes{$fullurl} = $hash; + $$storepaths2urls{$storepath} = $narurl; + $$urls2hashes{$narurl} = $hash; foreach my $p (@preds) { $$successors{$p} = $storepath; @@ -52,8 +52,8 @@ sub processURL { elsif (/^\s*StorePath:\s*(\/\S+)\s*$/) { $storepath = $1; } - elsif (/^\s*NarName:\s*(\S+)\s*$/) { - $narname = $1; + elsif (/^\s*NarURL:\s*(\S+)\s*$/) { + $narurl = $1; } elsif (/^\s*MD5:\s*(\S+)\s*$/) { $hash = $1;