aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2003-11-24 08:20:49 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2003-11-24 08:20:49 +0000
commit60e86b124f09763b1f0f55fc4c635a255bd028d2 (patch)
tree165bf417cc102d7d5d84c59aa9d0c8f6e191af22 /scripts
parentaf7e6fe22e8db606eb92c044140c00e6d8fe61cc (diff)
* Get rid of tab characters.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/nix-pull.in124
1 files changed, 62 insertions, 62 deletions
diff --git a/scripts/nix-pull.in b/scripts/nix-pull.in
index 40e7d62f3..4cb6409d7 100644
--- a/scripts/nix-pull.in
+++ b/scripts/nix-pull.in
@@ -27,7 +27,7 @@ while (<CONFFILE>) {
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 (<CONFFILE>) {
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 (<MANIFEST>) {
- 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;