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-411388-garchives=archives.gentoo.org@lists.gentoo.org>)
	id 1RdfJT-0001Sn-PR
	for garchives@archives.gentoo.org; Thu, 22 Dec 2011 09:51:48 +0000
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 3A2CE21C048;
	Thu, 22 Dec 2011 09:51:38 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	by pigeon.gentoo.org (Postfix) with ESMTP id EFDCC21C022
	for <gentoo-commits@lists.gentoo.org>; Thu, 22 Dec 2011 09:51:37 +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 99CE81B400F
	for <gentoo-commits@lists.gentoo.org>; Thu, 22 Dec 2011 09:51:36 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by pelican.gentoo.org (Postfix) with ESMTP id 0BDBE80042
	for <gentoo-commits@lists.gentoo.org>; Thu, 22 Dec 2011 09:51:36 +0000 (UTC)
From: "Fabian Groffen" <grobian@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" <grobian@gentoo.org>
Message-ID: <80319ff9c03b94303c4df153dc1f1de7462e5542.grobian@gentoo>
Subject: [gentoo-commits] proj/portage:prefix commit in: /
X-VCS-Repository: proj/portage
X-VCS-Committer: grobian
X-VCS-Committer-Name: Fabian Groffen
X-VCS-Revision: 80319ff9c03b94303c4df153dc1f1de7462e5542
Date: Thu, 22 Dec 2011 09:51:36 +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: 74c29238-b246-4f90-9a03-ad2de456d678
X-Archives-Hash: 6ff43c22a796b2e5be1ed6fb91739f27

commit:     80319ff9c03b94303c4df153dc1f1de7462e5542
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 22 09:47:11 2011 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Thu Dec 22 09:47:11 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a=
=3Dcommit;h=3D80319ff9

Merge remote-tracking branch 'overlays-gentoo-org/master' into prefix

Conflicts:
	bin/ebuild-helpers/prepstrip
	pym/portage/data.py


 bin/ebuild-helpers/prepstrip             |   24 +++----
 bin/misc-functions.sh                    |   49 +++++++++++-
 bin/phase-functions.sh                   |    8 ++-
 cnf/make.conf                            |    6 ++
 cnf/make.conf.ia64.diff                  |   23 +-----
 cnf/make.conf.s390.diff                  |   23 +-----
 cnf/make.globals                         |    4 +-
 doc/package/ebuild.docbook               |    1 +
 doc/package/ebuild/eapi/4-python.docbook |   49 ++++++++++++
 doc/portage.docbook                      |    1 +
 man/ebuild.5                             |    9 ++
 man/emerge.1                             |    4 +-
 man/make.conf.5                          |    4 +
 pym/_emerge/MergeListItem.py             |    2 +-
 pym/_emerge/PackageMerge.py              |    2 +-
 pym/_emerge/Scheduler.py                 |    8 +-
 pym/_emerge/depgraph.py                  |   10 +-
 pym/_emerge/main.py                      |    5 +-
 pym/_emerge/resolver/output.py           |    2 +-
 pym/_emerge/resolver/slot_collision.py   |    2 +-
 pym/_emerge/search.py                    |    2 +-
 pym/portage/data.py                      |   55 ++++++++++----
 pym/portage/dbapi/vartree.py             |  125 ++++++++++++++++++++++++=
-----
 pym/portage/eclass_cache.py              |    2 +
 pym/portage/package/ebuild/doebuild.py   |    4 +
 25 files changed, 313 insertions(+), 111 deletions(-)

diff --cc bin/misc-functions.sh
index 1e3785c,c74b4a4..8b58bda
mode 100644,100755..100644
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
diff --cc bin/phase-functions.sh
index e62a9ad,7407aba..493bb54
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@@ -128,9 -132,11 +132,11 @@@ filter_readonly_variables()=20
  			${PORTAGE_SAVED_READONLY_VARS}
  			${PORTAGE_MUTABLE_FILTERED_VARS}
  		"
+ 	elif ! has --allow-extra-vars $* ; then
+ 		filtered_vars+=3D" ${binpkg_untrusted_vars}"
  	fi
 =20
 -	"${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}"/filter-bash=
-environment.py "${filtered_vars}" || die "filter-bash-environment.py fai=
led"
 +	"${PORTAGE_PYTHON:-@PREFIX_PORTAGE_PYTHON@}" "${PORTAGE_BIN_PATH}"/fil=
ter-bash-environment.py "${filtered_vars}" || die "filter-bash-environmen=
t.py failed"
  }
 =20
  # @FUNCTION: preprocess_ebuild_env
diff --cc pym/portage/data.py
index 1351c7f,c4d967a..a136093
--- a/pym/portage/data.py
+++ b/pym/portage/data.py
@@@ -156,26 -141,46 +156,51 @@@ def _get_global(k)
 =20
  	# Avoid instantiating portage.settings when the desired
  	# variable is set in os.environ.
- 	elif k =3D=3D '_portage_grpname':
+ 	elif k in ('_portage_grpname', '_portage_username'):
  		v =3D None
- 		if 'PORTAGE_GRPNAME' in os.environ:
- 			v =3D os.environ['PORTAGE_GRPNAME']
- 		elif hasattr(portage, 'settings'):
- 			v =3D portage.settings.get('PORTAGE_GRPNAME')
- 		if v is None:
- 			# PREFIX LOCAL: use var iso hardwired 'portage'
- 			v =3D PORTAGE_GROUPNAME
- 			# END PREFIX LOCAL
- 	elif k =3D=3D '_portage_username':
- 		v =3D None
- 		if 'PORTAGE_USERNAME' in os.environ:
- 			v =3D os.environ['PORTAGE_USERNAME']
+ 		if k =3D=3D '_portage_grpname':
+ 			env_key =3D 'PORTAGE_GRPNAME'
+ 		else:
+ 			env_key =3D 'PORTAGE_USERNAME'
+=20
+ 		if env_key in os.environ:
+ 			v =3D os.environ[env_key]
  		elif hasattr(portage, 'settings'):
- 			v =3D portage.settings.get('PORTAGE_USERNAME')
+ 			v =3D portage.settings.get(env_key)
+ 		elif portage.const.EPREFIX:
+ 			# For prefix environments, default to the UID and GID of
+ 			# the top-level EROOT directory. The config class has
+ 			# equivalent code, but we also need to do it here if
+ 			# _disable_legacy_globals() has been called.
+ 			eroot =3D os.path.join(os.environ.get('ROOT', os.sep),
+ 				portage.const.EPREFIX.lstrip(os.sep))
+ 			try:
+ 				eroot_st =3D os.stat(eroot)
+ 			except OSError:
+ 				pass
+ 			else:
+ 				if k =3D=3D '_portage_grpname':
+ 					try:
+ 						grp_struct =3D grp.getgrgid(eroot_st.st_gid)
+ 					except KeyError:
+ 						pass
+ 					else:
+ 						v =3D grp_struct.gr_name
+ 				else:
+ 					try:
+ 						pwd_struct =3D pwd.getpwuid(eroot_st.st_uid)
+ 					except KeyError:
+ 						pass
+ 					else:
+ 						v =3D pwd_struct.pw_name
+=20
  		if v is None:
 -			v =3D 'portage'
 +			# PREFIX LOCAL: use var iso hardwired 'portage'
- 			v =3D PORTAGE_USERNAME
++			if k =3D=3D '_portage_grpname':
++				v =3D PORTAGE_GRPNAME
++			else:
++				v =3D PORTAGE_USERNAME
 +			# END PREFIX LOCAL
  	else:
  		raise AssertionError('unknown name: %s' % k)
 =20
diff --cc pym/portage/dbapi/vartree.py
index edc3983,d93d3c2..4745743
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@@ -30,11 -30,9 +30,12 @@@ portage.proxy.lazyimport.lazyimport(glo
  	'portage.util.movefile:movefile',
  	'portage.util._dyn_libs.PreservedLibsRegistry:PreservedLibsRegistry',
  	'portage.util._dyn_libs.LinkageMapELF:LinkageMapELF@LinkageMap',
 +	'portage.util._dyn_libs.LinkageMapMachO:LinkageMapMachO',
 +	'portage.util._dyn_libs.LinkageMapPeCoff:LinkageMapPeCoff',
 +	'portage.util._dyn_libs.LinkageMapXCoff:LinkageMapXCoff',
  	'portage.versions:best,catpkgsplit,catsplit,cpv_getkey,pkgcmp,' + \
  		'_pkgsplit@pkgsplit',
+ 	'subprocess',
  	'tarfile',
  )
 =20