about summary refs log tree commit diff
path: root/scripts/readmanifest.pm.in
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/readmanifest.pm.in')
-rw-r--r--scripts/readmanifest.pm.in11
1 files changed, 8 insertions, 3 deletions
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;
                 }
 
             }