about summary refs log tree commit diff
path: root/scripts/nix-pull.in
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/nix-pull.in')
-rw-r--r--scripts/nix-pull.in17
1 files changed, 13 insertions, 4 deletions
diff --git a/scripts/nix-pull.in b/scripts/nix-pull.in
index 9a1c1b6b5e4c..f584b6abd1c5 100644
--- a/scripts/nix-pull.in
+++ b/scripts/nix-pull.in
@@ -28,10 +28,18 @@ while (<CONFFILE>) {
             my $fn = $1;
             next if $fn =~ /\.\./;
             next if $fn =~ /\//;
-            next unless $fn =~ /^([0-9a-z]{32})-([0-9a-z]{32})(-s-([0-9a-z]{32}))?.*\.nar\.bz2$/;
+            next unless $fn =~ /^([0-9a-z]{32})-([0-9a-z]{32})(.*)\.nar\.bz2$/;
             my $hash = $1;
-            my $id = $2;
-            my $fsid = $4;
+	    my $id = $2;
+	    my $outname = $3;
+	    my $fsid;
+	    if ($outname =~ /^-/) {
+		next unless $outname =~ /^-((s-([0-9a-z]{32}))?.*)$/;
+		$outname = $1;
+		$fsid = $3;
+	    } else {
+		$outname = "";
+	    }
 
             print "registering $id -> $url/$fn\n";
 
@@ -43,7 +51,8 @@ while (<CONFFILE>) {
             my $fixexpr = 
                 "App(IncludeFix(\"nar/unnar.fix\"), " .
                 "[ (\"nar\", $fetch)" .
-                ", (\"name\", \"fetched-$id\")" .
+                ", (\"name\", \"$outname\")" .
+                ", (\"id\", \"$id\")" .
                 "])";
             
             my $fixfile = "/tmp/nix-pull-tmp.fix";