From: Fabian Groffen Date: Wed, 14 Dec 2011 15:23:13 +0000 (+0100) Subject: Merge remote-tracking branch 'overlays-gentoo-org/master' into prefix X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=87863efd98a474f01af099609903cbf7e7a3754d;p=portage.git 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 --- 87863efd98a474f01af099609903cbf7e7a3754d diff --cc bin/phase-functions.sh index 331afc8ae,664202ad9..9aa033cba --- a/bin/phase-functions.sh +++ b/bin/phase-functions.sh @@@ -28,7 -29,7 +29,7 @@@ PORTAGE_READONLY_VARS="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" PORTAGE_SAVED_READONLY_VARS="A CATEGORY P PF PN PR PV PVR" diff --cc pym/_emerge/Binpkg.py index 213ced256,6c70b19f0..e6e2e21d5 --- 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 class Binpkg(CompositeTask): diff --cc pym/portage/const.py index 2223b4c5e,77c68eb0d..aa45cb273 --- a/pym/portage/const.py +++ b/pym/portage/const.py @@@ -190,10 -145,8 +190,10 @@@ MANIFEST2_IDENTIFIERS = ("AUX", "MIS # constant should be minimal, in favor of access via the EPREFIX setting 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="" +# PREFIX LOCAL: rely on EPREFIX from autotools +#EPREFIX="" +# END PREFIX LOCAL # pick up EPREFIX from the environment if set if "PORTAGE_OVERRIDE_EPREFIX" in os.environ: diff --cc pym/portage/data.py index f2f541fe8,cf94ab0cd..5651e7d74 --- a/pym/portage/data.py +++ b/pym/portage/data.py @@@ -90,16 -86,8 +90,20 @@@ def _get_global(k) secpass = 2 #Discover the uid and gid of the portage user/group try: ++<<<<<<< HEAD ++======= + portage_uid = pwd.getpwnam(_get_global('_portage_username')).pw_uid ++>>>>>>> overlays-gentoo-org/master portage_gid = 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 = int(_get_global('_portage_grpname')) + else: + portage_gid = None + # END PREFIX LOCAL + try: + portage_uid = pwd.getpwnam(_get_global('_portage_uname')).pw_uid if secpass < 1 and portage_gid in os.getgroups(): secpass = 1 except KeyError: @@@ -149,16 -134,24 +153,28 @@@ pass v = sorted(set(v)) + # Avoid instantiating portage.settings when the desired + # variable is set in os.environ. elif k == '_portage_grpname': - env = getattr(portage, 'settings', os.environ) - # PREFIX LOCAL: use var iso hardwired 'portage' - v = env.get('PORTAGE_GRPNAME', PORTAGE_GROUPNAME) - # END PREFIX LOCAL - elif k == '_portage_uname': - env = getattr(portage, 'settings', os.environ) - # PREFIX LOCAL: use var iso hardwired 'portage' - v = env.get('PORTAGE_USERNAME', PORTAGE_USERNAME) - # END PREFIX LOCAL + v = None + if 'PORTAGE_GRPNAME' in os.environ: + v = os.environ['PORTAGE_GRPNAME'] + elif hasattr(portage, 'settings'): + v = portage.settings.get('PORTAGE_GRPNAME') + if v is None: - v = 'portage' ++ # PREFIX LOCAL: use var iso hardwired 'portage' ++ v = PORTAGE_GROUPNAME ++ # END PREFIX LOCAL + elif k == '_portage_username': + v = None + if 'PORTAGE_USERNAME' in os.environ: + v = os.environ['PORTAGE_USERNAME'] + elif hasattr(portage, 'settings'): + v = portage.settings.get('PORTAGE_USERNAME') + if v is None: - v = 'portage' ++ # PREFIX LOCAL: use var iso hardwired 'portage' ++ v = PORTAGE_USERNAME ++ # END PREFIX LOCAL else: raise AssertionError('unknown name: %s' % k) @@@ -188,14 -181,13 +204,17 @@@ def _init(settings) initialize global variables. This allows settings to come from make.conf instead of requiring them to be set in the calling environment. """ - if '_portage_grpname' not in _initialized_globals: - v = settings.get('PORTAGE_GRPNAME') - if v is not None: - globals()['_portage_grpname'] = v - _initialized_globals.add('_portage_grpname') - - if '_portage_uname' not in _initialized_globals: - v = settings.get('PORTAGE_USERNAME') - if v is not None: - globals()['_portage_uname'] = v - _initialized_globals.add('_portage_uname') + if '_portage_grpname' not in _initialized_globals and \ + '_portage_username' not in _initialized_globals: + - v = settings.get('PORTAGE_GRPNAME', 'portage') ++ # PREFIX LOCAL: use var iso hardwired 'portage' ++ v = settings.get('PORTAGE_GRPNAME', PORTAGE_GROUPNAME) ++ # END PREFIX LOCAL + globals()['_portage_grpname'] = v + _initialized_globals.add('_portage_grpname') + - v = settings.get('PORTAGE_USERNAME', 'portage') ++ # PREFIX LOCAL: use var iso hardwired 'portage' ++ v = settings.get('PORTAGE_USERNAME', PORTAGE_USERNAME) ++ # END PREFIX LOCAL + globals()['_portage_username'] = v + _initialized_globals.add('_portage_username') diff --cc pym/portage/dbapi/vartree.py index 09d7721d7,a9a147a98..edc398300 --- 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 a2f65057f,d6ee647e8..acff99232 --- 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 += "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", ] # user config variables