diff options
author | José Romildo Malaquias <malaquias@gmail.com> | 2020-06-11 12:50:31 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-11 12:50:31 -0300 |
commit | 87eb2f4342bdfa7c7bfcd1ba33f55eda0890a2ba (patch) | |
tree | 9a12961f354af2a228e11b26772f0629d96c9d50 /pkgs/build-support/buildenv/builder.pl | |
parent | aace7084163168c2d387404bded5f9e42e1da6f2 (diff) | |
parent | 4a1ef63c55a6dca0a06547c7738369c690ba6032 (diff) | |
download | nixpkgs-87eb2f4342bdfa7c7bfcd1ba33f55eda0890a2ba.tar nixpkgs-87eb2f4342bdfa7c7bfcd1ba33f55eda0890a2ba.tar.gz nixpkgs-87eb2f4342bdfa7c7bfcd1ba33f55eda0890a2ba.tar.bz2 nixpkgs-87eb2f4342bdfa7c7bfcd1ba33f55eda0890a2ba.tar.lz nixpkgs-87eb2f4342bdfa7c7bfcd1ba33f55eda0890a2ba.tar.xz nixpkgs-87eb2f4342bdfa7c7bfcd1ba33f55eda0890a2ba.tar.zst nixpkgs-87eb2f4342bdfa7c7bfcd1ba33f55eda0890a2ba.zip |
Merge pull request #90004 from romildo/buildenv
buildenv: paths to link resolving to the same absolute path is not a conflict
Diffstat (limited to 'pkgs/build-support/buildenv/builder.pl')
-rwxr-xr-x | pkgs/build-support/buildenv/builder.pl | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/pkgs/build-support/buildenv/builder.pl b/pkgs/build-support/buildenv/builder.pl index fc6ffce735c..411b147cc58 100755 --- a/pkgs/build-support/buildenv/builder.pl +++ b/pkgs/build-support/buildenv/builder.pl @@ -129,6 +129,15 @@ sub findFiles { return; } + # If target already exists and both targets resolves to the same path, skip + if (defined $oldTarget && $oldTarget ne "" && abs_path($target) eq abs_path($oldTarget)) { + # Prefer the target that is not a symlink, if any + if (-l $oldTarget && ! -l $target) { + $symlinks{$relName} = [$target, $priority]; + } + return; + } + # If target already exists as a symlink to a file (not a # directory) in a higher-priority package, skip. if (defined $oldTarget && $priority > $oldPriority && $oldTarget ne "" && ! -d $oldTarget) { |