diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-01-07 23:49:08 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-01-07 23:49:08 +0000 |
commit | db01c740b2056d1eea3734345c37f73cc06a6279 (patch) | |
tree | ee37acbee2333023146099c432a8a46a9930f0cb | |
parent | 5948cc706b8d8aabf4195c5f89158dba8c920a4a (diff) | |
download | portage-db01c740b2056d1eea3734345c37f73cc06a6279.tar.gz portage-db01c740b2056d1eea3734345c37f73cc06a6279.tar.bz2 portage-db01c740b2056d1eea3734345c37f73cc06a6279.zip |
Bug #250469 - Fix unpack() so that deb2targz is called in a way such that
$DISTDIR write access is not required.
svn path=/main/trunk/; revision=12389
-rwxr-xr-x | bin/ebuild.sh | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh index 49bbe78ff..ab71871f2 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -406,10 +406,24 @@ unpack() { # that reason. We just make sure on AIX `deb2targz` is # installed. if type -P deb2targz > /dev/null; then - deb2targz "${srcdir}/${x}" || die "$myfail" - mv "${srcdir}/${x/.deb/.tar.gz}" data.tar.gz + y=${x##*/} + local created_symlink=0 + if [ ! "$srcdir$x" -ef "$y" ] ; then + # deb2targz always extracts into the same directory as + # the source file, so create a symlink in the current + # working directory if necessary. + ln -sf "$srcdir$x" "$y" || die "$myfail" + created_symlink=1 + fi + deb2targz "$y" || die "$myfail" + if [ $created_symlink = 1 ] ; then + # Clean up the symlink so the ebuild + # doesn't inadvertently install it. + rm -f "$y" + fi + mv -f "${y%.deb}".tar.gz data.tar.gz || die "$myfail" else - ar x "${srcdir}/${x}" || die "$myfail" + ar x "$srcdir$x" || die "$myfail" fi ;; lzma) |