aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Harring <ferringb@chromium.org>2012-01-13 12:18:48 (GMT)
committerZac Medico <zmedico@gentoo.org>2012-01-13 12:18:48 (GMT)
commit5d5364e982820fda56db5a40884e1c5f8e784b96 (patch)
treee17fdd30092b7a0777bb9f74195b8fd6be551995
parenttest_config: fix AttributeError: 'str' (diff)
downloadportage-5d5364e982820fda56db5a40884e1c5f8e784b96.zip
portage-5d5364e982820fda56db5a40884e1c5f8e784b96.tar.gz
portage-5d5364e982820fda56db5a40884e1c5f8e784b96.tar.bz2
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
-rwxr-xr-xbin/misc-functions.sh15
1 files changed, 13 insertions, 2 deletions
diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 5a726b3..df0493b 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"