summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-03-29 05:55:49 +0000
committerZac Medico <zmedico@gentoo.org>2008-03-29 05:55:49 +0000
commit769d85ae3d1bc0bdf206308f2dc615bd319d01b7 (patch)
tree6210c6108f27e2b1ea52e8e44fa73181f17b45b5 /bin
parent0f64276849ec1abf43b975a581bbab715f90b85f (diff)
downloadportage-769d85ae3d1bc0bdf206308f2dc615bd319d01b7.tar.gz
portage-769d85ae3d1bc0bdf206308f2dc615bd319d01b7.tar.bz2
portage-769d85ae3d1bc0bdf206308f2dc615bd319d01b7.zip
Bug #214619 - Run dyn_package() and preinst_mask() from ${T} instead of
${D} in order to avoid leaving gmon.out files in ${D} in case any tools were built with -pf in CFLAGS. Also, call preinst_mask() after all other functions so that INSTALL_MASK can be used to wipe out any gmon.out files created during previous functions. (trunk r9592) svn path=/main/branches/2.1.2/; revision=9595
Diffstat (limited to 'bin')
-rwxr-xr-xbin/misc-functions.sh12
1 files changed, 9 insertions, 3 deletions
diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 94c26995a..67284f9e9 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -407,6 +407,11 @@ preinst_mask() {
eerror "${FUNCNAME}: D is unset"
return 1
fi
+
+ # Make sure $PWD is not ${D} so that we don't leave gmon.out files
+ # in there in case any tools were built with -pg in CFLAGS.
+ cd "${T}"
+
# remove man pages, info pages, docs if requested
for f in man info doc; do
if hasq no${f} $FEATURES; then
@@ -525,7 +530,9 @@ preinst_selinux_labels() {
}
dyn_package() {
- cd "${PORTAGE_BUILDDIR}/image"
+ # Make sure $PWD is not ${D} so that we don't leave gmon.out files
+ # in there in case any tools were built with -pg in CFLAGS.
+ cd "${T}"
install_mask "${PORTAGE_BUILDDIR}/image" "${PKG_INSTALL_MASK}"
local pkg_dest="${PKGDIR}/All/${PF}.tbz2"
local pkg_tmp="${PKGDIR}/All/${PF}.tbz2.$$"
@@ -534,10 +541,9 @@ dyn_package() {
# Sandbox is disabled in case the user wants to use a symlink
# for $PKGDIR and/or $PKGDIR/All.
export SANDBOX_ON="0"
- tar $tar_options -cf - $PORTAGE_BINPKG_TAR_OPTS . | \
+ tar $tar_options -cf - $PORTAGE_BINPKG_TAR_OPTS -C "${D}" . | \
bzip2 -f > "${pkg_tmp}" || \
die "Failed to create tarball"
- cd ..
export PYTHONPATH=${PORTAGE_PYM_PATH:-/usr/lib/portage/pym}
python -c "import xpak; t=xpak.tbz2('${pkg_tmp}'); t.recompose('${PORTAGE_BUILDDIR}/build-info')"
if [ $? -ne 0 ]; then