summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-03-29 05:30:41 +0000
committerZac Medico <zmedico@gentoo.org>2008-03-29 05:30:41 +0000
commitd724a11a0e7abfdff7e918d70207f71a0ecd92e1 (patch)
tree41a0203916ffd243479e4eddc7170b547bd84dfa /bin/misc-functions.sh
parentAdd a note about PKG_INSTALL_MASK. (diff)
downloadportage-multirepo-d724a11a0e7abfdff7e918d70207f71a0ecd92e1.tar.gz
portage-multirepo-d724a11a0e7abfdff7e918d70207f71a0ecd92e1.tar.bz2
portage-multirepo-d724a11a0e7abfdff7e918d70207f71a0ecd92e1.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. svn path=/main/trunk/; revision=9592
Diffstat (limited to 'bin/misc-functions.sh')
-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 48323e2d..41b38e5a 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -433,6 +433,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
@@ -551,7 +556,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 tar_options=""
[ "${PORTAGE_QUIET}" == "1" ] || tar_options="${tar_options} -v"
@@ -561,10 +568,9 @@ dyn_package() {
[ -z "${PORTAGE_BINPKG_TMPFILE}" ] && \
PORTAGE_BINPKG_TMPFILE="${PKGDIR}/${CATEGORY}/${PF}.tbz2"
mkdir -p "${PORTAGE_BINPKG_TMPFILE%/*}" || die "mkdir failed"
- tar $tar_options -cf - $PORTAGE_BINPKG_TAR_OPTS . | \
+ tar $tar_options -cf - $PORTAGE_BINPKG_TAR_OPTS -C "${D}" . | \
bzip2 -f > "$PORTAGE_BINPKG_TMPFILE" || \
die "Failed to create tarball"
- cd ..
export PYTHONPATH="${PORTAGE_PYM_PATH:-/usr/lib/portage/pym}:${PYTHONPATH}"
python -c "from portage import xpak; t=xpak.tbz2('${PORTAGE_BINPKG_TMPFILE}'); t.recompose('${PORTAGE_BUILDDIR}/build-info')"
if [ $? -ne 0 ]; then