From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org)
	by finch.gentoo.org with esmtp (Exim 4.60)
	(envelope-from <gentoo-commits+bounces-416799-garchives=archives.gentoo.org@lists.gentoo.org>)
	id 1Rlg7g-0000fl-Fb
	for garchives@archives.gentoo.org; Fri, 13 Jan 2012 12:20:44 +0000
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 38DD3E044C;
	Fri, 13 Jan 2012 12:20:35 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	by pigeon.gentoo.org (Postfix) with ESMTP id 09B52E04BA
	for <gentoo-commits@lists.gentoo.org>; Fri, 13 Jan 2012 12:20:34 +0000 (UTC)
Received: from pelican.gentoo.org (unknown [66.219.59.40])
	(using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 834A81B4035
	for <gentoo-commits@lists.gentoo.org>; Fri, 13 Jan 2012 12:20:34 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by pelican.gentoo.org (Postfix) with ESMTP id 83C4680044
	for <gentoo-commits@lists.gentoo.org>; Fri, 13 Jan 2012 12:20:33 +0000 (UTC)
From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" <zmedico@gentoo.org>
Message-ID: <5d5364e982820fda56db5a40884e1c5f8e784b96.zmedico@gentoo>
Subject: [gentoo-commits] proj/portage:master commit in: bin/
X-VCS-Repository: proj/portage
X-VCS-Files: bin/misc-functions.sh
X-VCS-Directories: bin/
X-VCS-Committer: zmedico
X-VCS-Committer-Name: Zac Medico
X-VCS-Revision: 5d5364e982820fda56db5a40884e1c5f8e784b96
Date: Fri, 13 Jan 2012 12:20:33 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: quoted-printable
X-Archives-Salt: 0a9dfd32-91bd-4a8d-aecd-23b59ea82d1c
X-Archives-Hash: bfef1f2d42c579bc29635c4194c318a9

commit:     5d5364e982820fda56db5a40884e1c5f8e784b96
Author:     Brian Harring <ferringb <AT> chromium <DOT> org>
AuthorDate: Fri Jan 13 12:18:48 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jan 13 12:18:48 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a=
=3Dcommit;h=3D5d5364e9

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=3Dchromium-os:25060
TEST=3Dset PKG_INSTALL_MASK, check ${D} vs what's in the binpkg

Change-Id: I0f81a9e394b7b0b64dbbcbe8d189876cb8421dfa

---
 bin/misc-functions.sh |   15 +++++++++++++--
 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() {
=20
 	# 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=3D"${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 p=
ackaging tree"
+
+	install_mask "${PROOT}" "${PKG_INSTALL_MASK}"
+
 	local tar_options=3D""
 	[[ $PORTAGE_VERBOSE =3D 1 ]] && tar_options+=3D" -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=3D${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"