From 0d157eed999c4c5b44b34f4a7b638b5d089155c0 Mon Sep 17 00:00:00 2001
From: Eelco Dolstra <e.dolstra@tudelft.nl>
Date: Tue, 21 Dec 2004 13:05:25 +0000
Subject: [PATCH] * Don't barf on lines in nix-pull manifests that we don't
 recognise.   Necessary for compatibility with 0.7 patch deployment. * Bumped
 version number to 0.6.1.

---
 configure.ac               |  2 +-
 scripts/readmanifest.pm.in | 19 ++++++++++++-------
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/configure.ac b/configure.ac
index 872c0b6f9..bfbace3f0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-AC_INIT(nix, "0.6")
+AC_INIT(nix, "0.6.1")
 AC_CONFIG_SRCDIR(README)
 AC_CONFIG_AUX_DIR(config)
 AM_INIT_AUTOMAKE
diff --git a/scripts/readmanifest.pm.in b/scripts/readmanifest.pm.in
index d5527bf3b..c63f18ac6 100644
--- a/scripts/readmanifest.pm.in
+++ b/scripts/readmanifest.pm.in
@@ -17,6 +17,7 @@ sub processURL {
     open MANIFEST, "<$manifest";
 
     my $inside = 0;
+    my $type;
 
     my $storePath;
     my $narurl;
@@ -29,23 +30,27 @@ sub processURL {
         next if (/^$/);
 
         if (!$inside) {
-            if (/^\{$/) { 
+            if (/^\s*(\w*)\s*\{$/) {
                 $inside = 1;
+                $type = $1;
+                $type = "narfile" if $type eq "";
                 undef $storePath;
                 undef $narurl;
                 undef $hash;
                 @preds = ();
 	    }
-            else { die "bad line: $_"; }
         } else {
             if (/^\}$/) {
                 $inside = 0;
 
-		$$storePaths2urls{$storePath} = $narurl;
-		$$urls2hashes{$narurl} = $hash;
+                if ($type eq "narfile") {
 
-                foreach my $p (@preds) {
-		    $$successors{$p} = $storePath;
+                    $$storePaths2urls{$storePath} = $narurl;
+                    $$urls2hashes{$narurl} = $hash;
+
+                    foreach my $p (@preds) {
+                        $$successors{$p} = $storePath;
+                    }
                 }
 
             }
@@ -61,7 +66,7 @@ sub processURL {
             elsif (/^\s*SuccOf:\s*(\/\S+)\s*$/) {
                 push @preds, $1;
             }
-            else { die "bad line: $_"; }
+
         }
     }
 
-- 
GitLab