diff options
author | Zac Medico <zmedico@gentoo.org> | 2012-01-13 08:21:31 -0800 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2012-01-13 08:21:31 -0800 |
commit | c978b14d9a400c30616f27b63d8aa2d6d0522c0f (patch) | |
tree | 491f2fabd46ddc78e653082418f5d4572a8da6ba | |
parent | 9ea603a611ddf4a8575ba73edc63b85213d7e701 (diff) | |
download | portage-c978b14d9a400c30616f27b63d8aa2d6d0522c0f.tar.gz portage-c978b14d9a400c30616f27b63d8aa2d6d0522c0f.tar.bz2 portage-c978b14d9a400c30616f27b63d8aa2d6d0522c0f.zip |
dyn_install: skip copy if possible
Also, fix EPREFIX breakage since commit
5d5364e982820fda56db5a40884e1c5f8e784b96.
-rwxr-xr-x | bin/misc-functions.sh | 27 |
1 files changed, 16 insertions, 11 deletions
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" |