aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-06-02 02:36:52 (GMT)
committerZac Medico <zmedico@gentoo.org>2012-06-02 02:36:52 (GMT)
commitbbacf8674168cf033de0ccb161f568d0b26f032b (patch)
treef8ac1cddb8b2a1f896d1908945ee7fb24651903c
parentecompressdir: fix funk_up_dir return value (diff)
downloadportage-bbacf8674168cf033de0ccb161f568d0b26f032b.zip
portage-bbacf8674168cf033de0ccb161f568d0b26f032b.tar.gz
portage-bbacf8674168cf033de0ccb161f568d0b26f032b.tar.bz2
ecompressdir: fix ln -s for bug #418309
This fixes parallel funk_up_dir decompress calls so that they don't inappropriately compete with eachother to fix the same broken symlinks.
-rwxr-xr-xbin/ebuild-helpers/ecompressdir10
1 files changed, 7 insertions, 3 deletions
diff --git a/bin/ebuild-helpers/ecompressdir b/bin/ebuild-helpers/ecompressdir
index 7d5d432..f39f883 100755
--- a/bin/ebuild-helpers/ecompressdir
+++ b/bin/ebuild-helpers/ecompressdir
@@ -80,9 +80,13 @@ funk_up_dir() {
skip_dir_dest=${T}/ecompress-skip/${actual_dir#${ED}}/${brokenlink%/*}/${olddest}
fi
[[ -e ${skip_dir_dest} ]] && continue
- [[ ${act} == "compress" ]] \
- && newdest="${olddest}${suffix}" \
- || newdest="${olddest%${suffix}}"
+ if [[ ${act} == "compress" ]] ; then
+ newdest=${olddest}${suffix}
+ else
+ [[ ${olddest} == *${suffix} ]] || continue
+ newdest=${olddest%${suffix}}
+ fi
+ [[ -f ${newdest} ]] || continue
rm -f "${brokenlink}"
[[ ${act} == "compress" ]] \
&& ln -snf "${newdest}" "${brokenlink}${suffix}" \