From c978b14d9a400c30616f27b63d8aa2d6d0522c0f Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 13 Jan 2012 08:21:31 -0800 Subject: dyn_install: skip copy if possible Also, fix EPREFIX breakage since commit 5d5364e982820fda56db5a40884e1c5f8e784b96. --- bin/misc-functions.sh | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'bin') diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh index 431e89f32..2c002cc95 100755 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh @@ -1095,24 +1095,29 @@ preinst_selinux_labels() { } dyn_package() { + local PROOT [[ " ${FEATURES} " == *" force-prefix "* ]] || \ - case "$EAPI" in 0|1|2) local ED=${D} ;; esac + case "$EAPI" in 0|1|2) local EPREFIX= ED=${D} ;; esac # 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}" - local PROOT="${T}/packaging" - # make a temporary copy of ${D} so that any modifications we do that - # are binpkg specific, do not influence the actual installed image. - rm -rf "${PROOT}" || die "failed removing stale package tree" - cp -pPR $(cp --help | grep -qs -e-l && echo -l) \ - "${PORTAGE_BUILDDIR}/image" "${PROOT}" \ - || die "failed creating packaging tree" - - install_mask "${PROOT}" "${PKG_INSTALL_MASK}" + if [[ -n ${PKG_INSTALL_MASK} ]] ; then + PROOT=${T}/packaging/ + # make a temporary copy of ${D} so that any modifications we do that + # are binpkg specific, do not influence the actual installed image. + rm -rf "${PROOT}" || die "failed removing stale package tree" + cp -pPR $(cp --help | grep -qs -e-l && echo -l) \ + "${D}" "${PROOT}" \ + || die "failed creating packaging tree" + + install_mask "${PROOT%/}${EPREFIX}/" "${PKG_INSTALL_MASK}" + else + PROOT=${D} + fi local tar_options="" [[ $PORTAGE_VERBOSE = 1 ]] && tar_options+=" -v" @@ -1145,7 +1150,7 @@ dyn_package() { vecho ">>> Done." # cleanup our temp tree - rm -rf "${PROOT}" + [[ -n ${PKG_INSTALL_MASK} ]] && rm -rf "${PROOT}" cd "${PORTAGE_BUILDDIR}" >> "$PORTAGE_BUILDDIR/.packaged" || \ die "Failed to create $PORTAGE_BUILDDIR/.packaged" -- cgit v1.2.3-1-g7c22