From 60e86b124f09763b1f0f55fc4c635a255bd028d2 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 24 Nov 2003 08:20:49 +0000 Subject: * Get rid of tab characters. --- scripts/nix-pull.in | 124 ++++++++++++++++++++++++++-------------------------- 1 file changed, 62 insertions(+), 62 deletions(-) (limited to 'scripts') diff --git a/scripts/nix-pull.in b/scripts/nix-pull.in index 40e7d62f3a20..4cb6409d7742 100644 --- a/scripts/nix-pull.in +++ b/scripts/nix-pull.in @@ -27,7 +27,7 @@ while () { chomp; if (/^\s*(\S+)\s*(\#.*)?$/) { my $url = $1; - $url =~ s/\/$//; + $url =~ s/\/$//; print "obtaining list of Nix archives at $url...\n"; @@ -36,70 +36,70 @@ while () { open MANIFEST, "<$manifest"; - my $inside = 0; + my $inside = 0; - my $storepath; - my $narname; - my $hash; - my @preds; + my $storepath; + my $narname; + my $hash; + my @preds; while () { - chomp; - s/\#.*$//g; - next if (/^$/); - - if (!$inside) { - if (/^\{$/) { - $inside = 1; - undef $storepath; - undef $narname; - undef $hash; - @preds = (); - } - else { die "bad line: $_"; } - } else { - if (/^\}$/) { - $inside = 0; - my $fullurl = "$url/$narname"; - print "$storepath\n"; - - # Construct a Fix expression that fetches and unpacks a - # Nix archive from the network. - my $fetch = - "App(IncludeFix(\"fetchurl/fetchurl.fix\"), " . - "[(\"url\", \"$fullurl\"), (\"md5\", \"$hash\")])"; - my $fixexpr = - "App(IncludeFix(\"nar/unnar.fix\"), " . - "[ (\"nar\", $fetch)" . - ", (\"outPath\", \"$storepath\")" . - "])"; - - if (!$first) { $fullexpr .= "," }; - $first = 0; - $fullexpr .= $fixexpr; # !!! O(n^2)? - - push @srcpaths, $storepath; - - foreach my $p (@preds) { - push @sucs, $p; - push @sucs, $storepath; - } - - } - elsif (/^\s*StorePath:\s*(\/\S+)\s*$/) { - $storepath = $1; - } - elsif (/^\s*NarName:\s*(\S+)\s*$/) { - $narname = $1; - } - elsif (/^\s*MD5:\s*(\S+)\s*$/) { - $hash = $1; - } - elsif (/^\s*SuccOf:\s*(\/\S+)\s*$/) { - push @preds, $1; - } - else { die "bad line: $_"; } - } + chomp; + s/\#.*$//g; + next if (/^$/); + + if (!$inside) { + if (/^\{$/) { + $inside = 1; + undef $storepath; + undef $narname; + undef $hash; + @preds = (); + } + else { die "bad line: $_"; } + } else { + if (/^\}$/) { + $inside = 0; + my $fullurl = "$url/$narname"; + print "$storepath\n"; + + # Construct a Fix expression that fetches and unpacks a + # Nix archive from the network. + my $fetch = + "App(IncludeFix(\"fetchurl/fetchurl.fix\"), " . + "[(\"url\", \"$fullurl\"), (\"md5\", \"$hash\")])"; + my $fixexpr = + "App(IncludeFix(\"nar/unnar.fix\"), " . + "[ (\"nar\", $fetch)" . + ", (\"outPath\", \"$storepath\")" . + "])"; + + if (!$first) { $fullexpr .= "," }; + $first = 0; + $fullexpr .= $fixexpr; # !!! O(n^2)? + + push @srcpaths, $storepath; + + foreach my $p (@preds) { + push @sucs, $p; + push @sucs, $storepath; + } + + } + elsif (/^\s*StorePath:\s*(\/\S+)\s*$/) { + $storepath = $1; + } + elsif (/^\s*NarName:\s*(\S+)\s*$/) { + $narname = $1; + } + elsif (/^\s*MD5:\s*(\S+)\s*$/) { + $hash = $1; + } + elsif (/^\s*SuccOf:\s*(\/\S+)\s*$/) { + push @preds, $1; + } + else { die "bad line: $_"; } + } } close MANIFEST; -- cgit 1.4.1