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
}
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.$$"
# 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
phase_retval = exit_status_check(phase_retval)
if phase_retval == os.EX_OK:
# Post phase logic and tasks that have been factored out of
- # ebuild.sh.
+ # ebuild.sh. Call preinst_mask last so that INSTALL_MASK can
+ # can be used to wipe out any gmon.out files created during
+ # previous functions (in case any tools were built with -pg
+ # in CFLAGS).
myargs = [_shell_quote(misc_sh_binary),
- "preinst_bsdflags", "preinst_mask",
+ "preinst_bsdflags",
"preinst_sfperms", "preinst_selinux_labels",
- "preinst_suid_scan"]
+ "preinst_suid_scan", "preinst_mask"]
_doebuild_exit_status_unlink(
mysettings.get("EBUILD_EXIT_STATUS_FILE"))
mysettings["EBUILD_PHASE"] = ""