about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2005-03-18T09·43+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2005-03-18T09·43+0000
commit7272c3f8178b6509e6d949b1e7538bbde49de58a (patch)
tree52d568184507669e5579e115c0601734ffd4278d
parent67eff20906899e315a6fbbaab02f18326ac5afb8 (diff)
* Ignore hash conflicts in gc-releases.pl.
-rwxr-xr-xscripts/gc-releases.pl2
-rwxr-xr-xscripts/generate-patches.pl.in2
-rw-r--r--scripts/readmanifest.pm.in11
3 files changed, 10 insertions, 5 deletions
diff --git a/scripts/gc-releases.pl b/scripts/gc-releases.pl
index 2423d8c0e54e..ed40aded5ed4 100755
--- a/scripts/gc-releases.pl
+++ b/scripts/gc-releases.pl
@@ -32,7 +32,7 @@ my %successors;
 
 foreach my $manifest (@ARGV) {
     print STDERR "loading $manifest\n";
-    if (readManifest($manifest, \%narFiles, \%patches, \%successors) < 3) {
+    if (readManifest($manifest, \%narFiles, \%patches, \%successors, 1) < 3) {
 #        die "manifest `$manifest' is too old (i.e., for Nix <= 0.7)\n";
     }
 }
diff --git a/scripts/generate-patches.pl.in b/scripts/generate-patches.pl.in
index 9392ef5c75a9..3856dd568447 100755
--- a/scripts/generate-patches.pl.in
+++ b/scripts/generate-patches.pl.in
@@ -328,7 +328,7 @@ foreach my $p (keys %dstOutPaths) {
             { url => "$patchesURL/$finalName", hash => "$hashAlgo:$narDiffHash"
             , size => $narDiffSize, basePath => $closest, baseHash => "$hashAlgo:$baseHash"
             , narHash => "$hashAlgo:$narHash", patchType => "nar-bsdiff"
-            };
+            }, 0;
     }
 }
 
diff --git a/scripts/readmanifest.pm.in b/scripts/readmanifest.pm.in
index 5066cdde1375..f71a2f0811b8 100644
--- a/scripts/readmanifest.pm.in
+++ b/scripts/readmanifest.pm.in
@@ -5,6 +5,7 @@ sub addPatch {
     my $patches = shift;
     my $storePath = shift;
     my $patch = shift;
+    my $allowConflicts = shift;
 
     $$patches{$storePath} = []
         unless defined $$patches{$storePath};
@@ -18,7 +19,8 @@ sub addPatch {
                 $found = 1 if ($patch2->{basePath} eq $patch->{basePath});
             } else {
                 die "conflicting hashes for URL $patch->{url}, " .
-                    "namely $patch2->{hash} and $patch->{hash}";
+                    "namely $patch2->{hash} and $patch->{hash}"
+                    unless $allowConflicts;
             }
         }
     }
@@ -34,6 +36,8 @@ sub readManifest {
     my $narFiles = shift;
     my $patches = shift;
     my $successors = shift;
+    my $allowConflicts = shift;
+    $allowConflicts = 0 unless defined $allowConflicts;
 
     open MANIFEST, "<$manifest"
         or die "cannot open `$manifest': $!";
@@ -100,7 +104,8 @@ sub readManifest {
                                 $found = 1;
                             } else {
                                 die "conflicting hashes for URL $url, " .
-                                    "namely $narFile->{hash} and $hash";
+                                    "namely $narFile->{hash} and $hash"
+                                    unless $allowConflicts;
                             }
                         }
                     }
@@ -124,7 +129,7 @@ sub readManifest {
                         , basePath => $basePath, baseHash => $baseHash
                         , narHash => $narHash, patchType => $patchType
                         , hashAlgo => $hashAlgo
-                        };
+                        }, $allowConflicts;
                 }
 
             }