3
0
Fork 0
forked from mirrors/nixpkgs

Ignore fake collisions

svn path=/nixpkgs/trunk/; revision=21075
This commit is contained in:
Yury G. Kudryashov 2010-04-14 19:26:31 +00:00
parent cd56e341de
commit 295af6ab17

View file

@ -1,7 +1,7 @@
#! @perl@ -w
use strict;
use Cwd;
use Cwd 'abs_path';
use IO::Handle;
use File::Path;
use File::Basename;
@ -96,9 +96,17 @@ sub createLinks {
}
elsif (-l $dstFile) {
if (!$ignoreCollisions) {
my $target = readlink $dstFile;
die "collission between `$srcFile' and `$target'";
my $oldTarget = readlink $dstFile;
my $oldTargetReal = abs_path $oldTarget;
my $newTarget = $srcFile;
my $newTargetReal = abs_path $newTarget;
unless ($newTargetReal eq $oldTargetReal) {
if ($ignoreCollisions) {
warn "collision between `$newTarget' and `$oldTarget'\n";
}
else {
die "collision between `$newTarget' and `$oldTarget'";
}
}
}
@ -114,7 +122,7 @@ my %done;
my %postponed;
sub addPkg;
sub addPkg {
sub addPkg($;$) {
my $pkgDir = shift;
my $ignoreCollisions = shift;
@ -131,6 +139,7 @@ sub addPkg {
close PROP;
my @propagated = split ' ', $propagated;
foreach my $p (@propagated) {
print "$pkgDir propagates $p\n";
$postponed{$p} = 1 unless defined $done{$p};
}
}