* Doh! Edited `readmanifest.pm' instead of `readmanifest.pm.in'.

This commit is contained in:
Eelco Dolstra 2004-01-16 14:54:39 +00:00
parent 291030b900
commit b1c5f3c10d
2 changed files with 11 additions and 11 deletions

View File

@ -1,2 +1,2 @@
# A list of URLs from where we obtain Nix archives. # A list of URLs from where `nix-pull' obtain Nix archives if
http://losser.st-lab.cs.uu.nl/~eelco/nix-dist/ # no URL is specified on the command line.

View File

@ -10,15 +10,16 @@ sub processURL {
$url =~ s/\/$//; $url =~ s/\/$//;
print "obtaining list of Nix archives at $url...\n"; print "obtaining list of Nix archives at $url...\n";
system "wget --cache=off '$url'/MANIFEST -O '$manifest' 2> /dev/null"; # !!! escape system("curl --fail --silent --show-error " .
if ($?) { die "`wget' failed"; } "'$url/MANIFEST' > '$manifest' 2> /dev/null") == 0
or die "curl failed: $?";
open MANIFEST, "<$manifest"; open MANIFEST, "<$manifest";
my $inside = 0; my $inside = 0;
my $storepath; my $storepath;
my $narname; my $narurl;
my $hash; my $hash;
my @preds; my @preds;
@ -31,7 +32,7 @@ sub processURL {
if (/^\{$/) { if (/^\{$/) {
$inside = 1; $inside = 1;
undef $storepath; undef $storepath;
undef $narname; undef $narurl;
undef $hash; undef $hash;
@preds = (); @preds = ();
} }
@ -39,10 +40,9 @@ sub processURL {
} else { } else {
if (/^\}$/) { if (/^\}$/) {
$inside = 0; $inside = 0;
my $fullurl = "$url/$narname";
$$storepaths2urls{$storepath} = $fullurl; $$storepaths2urls{$storepath} = $narurl;
$$urls2hashes{$fullurl} = $hash; $$urls2hashes{$narurl} = $hash;
foreach my $p (@preds) { foreach my $p (@preds) {
$$successors{$p} = $storepath; $$successors{$p} = $storepath;
@ -52,8 +52,8 @@ sub processURL {
elsif (/^\s*StorePath:\s*(\/\S+)\s*$/) { elsif (/^\s*StorePath:\s*(\/\S+)\s*$/) {
$storepath = $1; $storepath = $1;
} }
elsif (/^\s*NarName:\s*(\S+)\s*$/) { elsif (/^\s*NarURL:\s*(\S+)\s*$/) {
$narname = $1; $narurl = $1;
} }
elsif (/^\s*MD5:\s*(\S+)\s*$/) { elsif (/^\s*MD5:\s*(\S+)\s*$/) {
$hash = $1; $hash = $1;