From 295af6ab173534e65c53fb4d2e4afff2fc8476c7 Mon Sep 17 00:00:00 2001 From: "Yury G. Kudryashov" Date: Wed, 14 Apr 2010 19:26:31 +0000 Subject: [PATCH] Ignore fake collisions svn path=/nixpkgs/trunk/; revision=21075 --- pkgs/build-support/buildenv/builder.pl | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/pkgs/build-support/buildenv/builder.pl b/pkgs/build-support/buildenv/builder.pl index 37eb21887fd0..856eca7b80be 100755 --- a/pkgs/build-support/buildenv/builder.pl +++ b/pkgs/build-support/buildenv/builder.pl @@ -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}; } }