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-408671-garchives=archives.gentoo.org@lists.gentoo.org>) id 1RaqiZ-0007qx-Tb for garchives@archives.gentoo.org; Wed, 14 Dec 2011 15:26:04 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5A44521C0EE; Wed, 14 Dec 2011 15:25:55 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 101A721C0EE for <gentoo-commits@lists.gentoo.org>; Wed, 14 Dec 2011 15:25:54 +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 7F889654CD for <gentoo-commits@lists.gentoo.org>; Wed, 14 Dec 2011 15:25:54 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id D7C168004A for <gentoo-commits@lists.gentoo.org>; Wed, 14 Dec 2011 15:25:53 +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: <87863efd98a474f01af099609903cbf7e7a3754d.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: 87863efd98a474f01af099609903cbf7e7a3754d Date: Wed, 14 Dec 2011 15:25:53 +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: f994f0e0-4176-46c1-826f-e8d1cafc5f21 X-Archives-Hash: d1c2ab8269969dd086c8fb6d727b2198 commit: 87863efd98a474f01af099609903cbf7e7a3754d Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> AuthorDate: Wed Dec 14 15:23:13 2011 +0000 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> CommitDate: Wed Dec 14 15:23:13 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D87863efd Merge remote-tracking branch 'overlays-gentoo-org/master' into prefix Conflicts: bin/egencache bin/phase-functions.sh pym/portage/const.py pym/portage/data.py pym/portage/package/ebuild/_config/special_env_vars.py bin/ebuild-ipc.py | 38 +++- bin/ebuild.sh | 9 - bin/egencache | 6 +- bin/lock-helper.py | 1 + bin/phase-functions.sh | 7 +- bin/repoman | 14 +- man/emerge.1 | 4 +- pym/_emerge/AbstractEbuildProcess.py | 16 ++- pym/_emerge/Binpkg.py | 6 +- pym/_emerge/FifoIpcDaemon.py | 16 +- pym/_emerge/Scheduler.py | 2 +- pym/_emerge/SpawnProcess.py | 31 ++-- pym/_emerge/actions.py | 19 +- pym/_emerge/emergelog.py | 9 +- pym/_emerge/main.py | 2 +- pym/portage/__init__.py | 2 +- pym/portage/_legacy_globals.py | 2 - pym/portage/const.py | 9 +- pym/portage/data.py | 65 ++++-- pym/portage/dbapi/vartree.py | 4 +- pym/portage/locks.py | 221 ++++++++++++++= ------ pym/portage/output.py | 15 +- .../package/ebuild/_config/LocationsManager.py | 5 +- .../package/ebuild/_config/special_env_vars.py | 8 +- pym/portage/package/ebuild/_spawn_nofetch.py | 2 +- pym/portage/package/ebuild/config.py | 50 +++-- pym/portage/package/ebuild/doebuild.py | 15 +- pym/portage/package/ebuild/fetch.py | 3 +- pym/portage/package/ebuild/prepare_build_dirs.py | 3 +- pym/portage/repository/config.py | 7 +- pym/portage/tests/dbapi/test_fakedbapi.py | 2 +- pym/portage/tests/ebuild/test_doebuild_spawn.py | 5 + pym/portage/tests/ebuild/test_ipc_daemon.py | 13 +- pym/portage/tests/emerge/test_simple.py | 7 +- pym/portage/tests/locks/test_asynchronous_lock.py | 62 +++++- pym/portage/tests/locks/test_lock_nonblock.py | 17 ++- pym/portage/tests/repoman/test_simple.py | 6 +- pym/portage/tests/resolver/ResolverPlayground.py | 6 +- pym/portage/util/movefile.py | 6 +- pym/portage/xpak.py | 2 +- pym/repoman/utilities.py | 2 +- 41 files changed, 480 insertions(+), 239 deletions(-) diff --cc bin/phase-functions.sh index 331afc8,664202a..9aa033c --- a/bin/phase-functions.sh +++ b/bin/phase-functions.sh @@@ -28,7 -29,7 +29,7 @@@ PORTAGE_READONLY_VARS=3D"D EBUILD EBUILD_ PORTAGE_TMPDIR PORTAGE_UPDATE_ENV PORTAGE_USERNAME \ PORTAGE_VERBOSE PORTAGE_WORKDIR_MODE PORTDIR PORTDIR_OVERLAY \ PROFILE_PATHS REPLACING_VERSIONS REPLACED_BY_VERSION T WORKDIR \ - PORTAGE_OVERRIDE_EPREFIX ED EROOT" - __PORTAGE_TEST_HARDLINK_LOCKS" ++ __PORTAGE_TEST_HARDLINK_LOCKS ED EROOT" =20 PORTAGE_SAVED_READONLY_VARS=3D"A CATEGORY P PF PN PR PV PVR" =20 diff --cc pym/_emerge/Binpkg.py index 213ced2,6c70b19..e6e2e21 --- a/pym/_emerge/Binpkg.py +++ b/pym/_emerge/Binpkg.py @@@ -20,9 -20,8 +21,9 @@@ from portage import _unicode_decod from portage import _unicode_encode import io import logging - import shutil + import textwrap from portage.output import colorize +from portage.const import EPREFIX =20 class Binpkg(CompositeTask): =20 diff --cc pym/portage/const.py index 2223b4c,77c68eb..aa45cb2 --- a/pym/portage/const.py +++ b/pym/portage/const.py @@@ -190,10 -145,8 +190,10 @@@ MANIFEST2_IDENTIFIERS =3D ("AUX", "MIS # constant should be minimal, in favor of access via the EPREFIX settin= g of # a config instance (since it's possible to contruct a config instance = with # a different EPREFIX). Therefore, the EPREFIX constant should *NOT* be= used - # in the definition of any other contstants within this file. + # in the definition of any other constants within this file. -EPREFIX=3D"" +# PREFIX LOCAL: rely on EPREFIX from autotools +#EPREFIX=3D"" +# END PREFIX LOCAL =20 # pick up EPREFIX from the environment if set if "PORTAGE_OVERRIDE_EPREFIX" in os.environ: diff --cc pym/portage/data.py index f2f541f,cf94ab0..5651e7d --- a/pym/portage/data.py +++ b/pym/portage/data.py @@@ -90,16 -86,8 +90,20 @@@ def _get_global(k) secpass =3D 2 #Discover the uid and gid of the portage user/group try: ++<<<<<<< HEAD ++=3D=3D=3D=3D=3D=3D=3D + portage_uid =3D pwd.getpwnam(_get_global('_portage_username')).pw_ui= d ++>>>>>>> overlays-gentoo-org/master portage_gid =3D grp.getgrnam(_get_global('_portage_grpname')).gr_gid + except KeyError: + # PREFIX LOCAL: some sysadmins are insane, bug #344307 + if _get_global('_portage_grpname').isdigit(): + portage_gid =3D int(_get_global('_portage_grpname')) + else: + portage_gid =3D None + # END PREFIX LOCAL + try: + portage_uid =3D pwd.getpwnam(_get_global('_portage_uname')).pw_uid if secpass < 1 and portage_gid in os.getgroups(): secpass =3D 1 except KeyError: @@@ -149,16 -134,24 +153,28 @@@ pass v =3D sorted(set(v)) =20 + # Avoid instantiating portage.settings when the desired + # variable is set in os.environ. elif k =3D=3D '_portage_grpname': - env =3D getattr(portage, 'settings', os.environ) - # PREFIX LOCAL: use var iso hardwired 'portage' - v =3D env.get('PORTAGE_GRPNAME', PORTAGE_GROUPNAME) - # END PREFIX LOCAL - elif k =3D=3D '_portage_uname': - env =3D getattr(portage, 'settings', os.environ) - # PREFIX LOCAL: use var iso hardwired 'portage' - v =3D env.get('PORTAGE_USERNAME', PORTAGE_USERNAME) - # END PREFIX LOCAL + 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: - v =3D 'portage' ++ # 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'] + elif hasattr(portage, 'settings'): + v =3D portage.settings.get('PORTAGE_USERNAME') + if v is None: - v =3D 'portage' ++ # PREFIX LOCAL: use var iso hardwired 'portage' ++ v =3D PORTAGE_USERNAME ++ # END PREFIX LOCAL else: raise AssertionError('unknown name: %s' % k) =20 @@@ -188,14 -181,13 +204,17 @@@ def _init(settings) initialize global variables. This allows settings to come from make.co= nf instead of requiring them to be set in the calling environment. """ - if '_portage_grpname' not in _initialized_globals: - v =3D settings.get('PORTAGE_GRPNAME') - if v is not None: - globals()['_portage_grpname'] =3D v - _initialized_globals.add('_portage_grpname') -=20 - if '_portage_uname' not in _initialized_globals: - v =3D settings.get('PORTAGE_USERNAME') - if v is not None: - globals()['_portage_uname'] =3D v - _initialized_globals.add('_portage_uname') + if '_portage_grpname' not in _initialized_globals and \ + '_portage_username' not in _initialized_globals: +=20 - v =3D settings.get('PORTAGE_GRPNAME', 'portage') ++ # PREFIX LOCAL: use var iso hardwired 'portage' ++ v =3D settings.get('PORTAGE_GRPNAME', PORTAGE_GROUPNAME) ++ # END PREFIX LOCAL + globals()['_portage_grpname'] =3D v + _initialized_globals.add('_portage_grpname') +=20 - v =3D settings.get('PORTAGE_USERNAME', 'portage') ++ # PREFIX LOCAL: use var iso hardwired 'portage' ++ v =3D settings.get('PORTAGE_USERNAME', PORTAGE_USERNAME) ++ # END PREFIX LOCAL + globals()['_portage_username'] =3D v + _initialized_globals.add('_portage_username') diff --cc pym/portage/dbapi/vartree.py index 09d7721,a9a147a..edc3983 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@@ -27,11 -27,9 +27,12 @@@ portage.proxy.lazyimport.lazyimport(glo 'portage.util.digraph:digraph', 'portage.util.env_update:env_update', 'portage.util.listdir:dircache,listdir', + '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', 'tarfile', diff --cc pym/portage/package/ebuild/_config/special_env_vars.py index a2f6505,d6ee647..acff992 --- a/pym/portage/package/ebuild/_config/special_env_vars.py +++ b/pym/portage/package/ebuild/_config/special_env_vars.py @@@ -66,9 -66,7 +66,9 @@@ environ_whitelist +=3D=20 "REPLACING_VERSIONS", "REPLACED_BY_VERSION", "ROOT", "ROOTPATH", "T", "TMP", "TMPDIR", "USE_EXPAND", "USE_ORDER", "WORKDIR", - "XARGS", "PORTAGE_OVERRIDE_EPREFIX", + "XARGS", "__PORTAGE_TEST_HARDLINK_LOCKS", + "BPREFIX", "DEFAULT_PATH", "EXTRA_PATH", + "PORTAGE_GROUP", "PORTAGE_USER", ] =20 # user config variables