forked from lix-project/lix
* Disregard the Hash field in manifests.
This commit is contained in:
parent
2897286487
commit
b88460bcbc
|
@ -5,7 +5,6 @@ sub addPatch {
|
||||||
my $patches = shift;
|
my $patches = shift;
|
||||||
my $storePath = shift;
|
my $storePath = shift;
|
||||||
my $patch = shift;
|
my $patch = shift;
|
||||||
my $allowConflicts = shift;
|
|
||||||
|
|
||||||
$$patches{$storePath} = []
|
$$patches{$storePath} = []
|
||||||
unless defined $$patches{$storePath};
|
unless defined $$patches{$storePath};
|
||||||
|
@ -14,15 +13,9 @@ sub addPatch {
|
||||||
|
|
||||||
my $found = 0;
|
my $found = 0;
|
||||||
foreach my $patch2 (@{$patchList}) {
|
foreach my $patch2 (@{$patchList}) {
|
||||||
if ($patch2->{url} eq $patch->{url}) {
|
$found = 1 if
|
||||||
if ($patch2->{hash} eq $patch->{hash}) {
|
$patch2->{url} eq $patch->{url} &&
|
||||||
$found = 1 if ($patch2->{basePath} eq $patch->{basePath});
|
$patch2->{basePath} eq $patch->{basePath};
|
||||||
} else {
|
|
||||||
die "conflicting hashes for URL $patch->{url}, " .
|
|
||||||
"namely $patch2->{hash} and $patch->{hash}"
|
|
||||||
unless $allowConflicts;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
push @{$patchList}, $patch if !$found;
|
push @{$patchList}, $patch if !$found;
|
||||||
|
@ -36,8 +29,6 @@ sub readManifest {
|
||||||
my $narFiles = shift;
|
my $narFiles = shift;
|
||||||
my $localPaths = shift;
|
my $localPaths = shift;
|
||||||
my $patches = shift;
|
my $patches = shift;
|
||||||
my $allowConflicts = shift;
|
|
||||||
$allowConflicts = 0 unless defined $allowConflicts;
|
|
||||||
|
|
||||||
open MANIFEST, "<$manifest"
|
open MANIFEST, "<$manifest"
|
||||||
or die "cannot open `$manifest': $!";
|
or die "cannot open `$manifest': $!";
|
||||||
|
@ -98,15 +89,7 @@ sub readManifest {
|
||||||
|
|
||||||
my $found = 0;
|
my $found = 0;
|
||||||
foreach my $narFile (@{$narFileList}) {
|
foreach my $narFile (@{$narFileList}) {
|
||||||
if ($narFile->{url} eq $url) {
|
$found = 1 if $narFile->{url} eq $url;
|
||||||
if ($narFile->{hash} eq $hash) {
|
|
||||||
$found = 1;
|
|
||||||
} else {
|
|
||||||
die "conflicting hashes for URL $url, " .
|
|
||||||
"namely $narFile->{hash} and $hash"
|
|
||||||
unless $allowConflicts;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (!$found) {
|
if (!$found) {
|
||||||
push @{$narFileList},
|
push @{$narFileList},
|
||||||
|
@ -124,7 +107,7 @@ sub readManifest {
|
||||||
, basePath => $basePath, baseHash => $baseHash
|
, basePath => $basePath, baseHash => $baseHash
|
||||||
, narHash => $narHash, patchType => $patchType
|
, narHash => $narHash, patchType => $patchType
|
||||||
, hashAlgo => $hashAlgo
|
, hashAlgo => $hashAlgo
|
||||||
}, $allowConflicts;
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
elsif ($type eq "localPath") {
|
elsif ($type eq "localPath") {
|
||||||
|
|
Loading…
Reference in a new issue