From: Fabian Groffen Date: Thu, 22 Dec 2011 09:47:11 +0000 (+0100) Subject: Merge remote-tracking branch 'overlays-gentoo-org/master' into prefix X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=80319ff9c03b94303c4df153dc1f1de7462e5542;p=portage.git Merge remote-tracking branch 'overlays-gentoo-org/master' into prefix Conflicts: bin/ebuild-helpers/prepstrip pym/portage/data.py --- 80319ff9c03b94303c4df153dc1f1de7462e5542 diff --cc bin/misc-functions.sh index 1e3785c54,c74b4a411..8b58bda2e mode 100644,100755..100644 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh diff --cc bin/phase-functions.sh index e62a9ade6,7407aba93..493bb54fc --- a/bin/phase-functions.sh +++ b/bin/phase-functions.sh @@@ -128,9 -132,11 +132,11 @@@ filter_readonly_variables() ${PORTAGE_SAVED_READONLY_VARS} ${PORTAGE_MUTABLE_FILTERED_VARS} " + elif ! has --allow-extra-vars $* ; then + filtered_vars+=" ${binpkg_untrusted_vars}" fi - "${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}"/filter-bash-environment.py "${filtered_vars}" || die "filter-bash-environment.py failed" + "${PORTAGE_PYTHON:-@PREFIX_PORTAGE_PYTHON@}" "${PORTAGE_BIN_PATH}"/filter-bash-environment.py "${filtered_vars}" || die "filter-bash-environment.py failed" } # @FUNCTION: preprocess_ebuild_env diff --cc pym/portage/data.py index 1351c7f73,c4d967a1b..a136093a4 --- a/pym/portage/data.py +++ b/pym/portage/data.py @@@ -156,26 -141,46 +156,51 @@@ def _get_global(k) # Avoid instantiating portage.settings when the desired # variable is set in os.environ. - elif k == '_portage_grpname': + elif k in ('_portage_grpname', '_portage_username'): 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: - # 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'] + if k == '_portage_grpname': + env_key = 'PORTAGE_GRPNAME' + else: + env_key = 'PORTAGE_USERNAME' + + if env_key in os.environ: + v = os.environ[env_key] elif hasattr(portage, 'settings'): - v = portage.settings.get('PORTAGE_USERNAME') + v = 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 = os.path.join(os.environ.get('ROOT', os.sep), + portage.const.EPREFIX.lstrip(os.sep)) + try: + eroot_st = os.stat(eroot) + except OSError: + pass + else: + if k == '_portage_grpname': + try: + grp_struct = grp.getgrgid(eroot_st.st_gid) + except KeyError: + pass + else: + v = grp_struct.gr_name + else: + try: + pwd_struct = pwd.getpwuid(eroot_st.st_uid) + except KeyError: + pass + else: + v = pwd_struct.pw_name + if v is None: - v = 'portage' + # PREFIX LOCAL: use var iso hardwired 'portage' - v = PORTAGE_USERNAME ++ if k == '_portage_grpname': ++ v = PORTAGE_GRPNAME ++ else: ++ v = PORTAGE_USERNAME + # END PREFIX LOCAL else: raise AssertionError('unknown name: %s' % k) diff --cc pym/portage/dbapi/vartree.py index edc398300,d93d3c2ea..47457431b --- 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', )