From: Brian Harring Date: Fri, 13 Jan 2012 12:18:48 +0000 (-0800) Subject: Modify PKG_INSTALL_MASK to apply only to binpkg creation. X-Git-Tag: v2.2.0_alpha85~33 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5d5364e982820fda56db5a40884e1c5f8e784b96;p=portage.git Modify PKG_INSTALL_MASK to apply only to binpkg creation. Primarily useful for certain cases where cros needs to suppress debug symbols being included for specific pkgs, and/or suppressing binpkgs from carrying sensitive configuration data, but we still wish for it to be installed. BUG=chromium-os:25060 TEST=set PKG_INSTALL_MASK, check ${D} vs what's in the binpkg Change-Id: I0f81a9e394b7b0b64dbbcbe8d189876cb8421dfa --- diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh index 5a726b36b..df0493bbe 100755 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh @@ -1101,8 +1101,16 @@ dyn_package() { # 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 "${ED}" "${PKG_INSTALL_MASK}" + + 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. + cp -la "${PORTAGE_BUILDDIR}/image" "${PROOT}" || die "failed creating packaging tree" + + install_mask "${PROOT}" "${PKG_INSTALL_MASK}" + local tar_options="" [[ $PORTAGE_VERBOSE = 1 ]] && tar_options+=" -v" # Sandbox is disabled in case the user wants to use a symlink @@ -1111,7 +1119,7 @@ dyn_package() { [ -z "${PORTAGE_BINPKG_TMPFILE}" ] && \ die "PORTAGE_BINPKG_TMPFILE is unset" mkdir -p "${PORTAGE_BINPKG_TMPFILE%/*}" || die "mkdir failed" - tar $tar_options -cf - $PORTAGE_BINPKG_TAR_OPTS -C "${D}" . | \ + tar $tar_options -cf - $PORTAGE_BINPKG_TAR_OPTS -C "${PROOT}" . | \ $PORTAGE_BZIP2_COMMAND -c > "$PORTAGE_BINPKG_TMPFILE" assert "failed to pack binary package: '$PORTAGE_BINPKG_TMPFILE'" PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \ @@ -1132,6 +1140,9 @@ dyn_package() { [ -n "${md5_hash}" ] && \ echo ${md5_hash} > "${PORTAGE_BUILDDIR}"/build-info/BINPKGMD5 vecho ">>> Done." + + # cleanup our temp tree + rm -rf "${PROOT}" cd "${PORTAGE_BUILDDIR}" >> "$PORTAGE_BUILDDIR/.packaged" || \ die "Failed to create $PORTAGE_BUILDDIR/.packaged"