Merge remote-tracking branch 'overlays-gentoo-org/master' into prefix
authorFabian Groffen <grobian@gentoo.org>
Thu, 22 Dec 2011 09:47:11 +0000 (10:47 +0100)
committerFabian Groffen <grobian@gentoo.org>
Thu, 22 Dec 2011 09:47:11 +0000 (10:47 +0100)
Conflicts:
bin/ebuild-helpers/prepstrip
pym/portage/data.py

12 files changed:
1  2 
bin/ebuild-helpers/prepstrip
bin/misc-functions.sh
bin/phase-functions.sh
cnf/make.conf
cnf/make.globals
man/emerge.1
man/make.conf.5
pym/_emerge/depgraph.py
pym/_emerge/main.py
pym/portage/data.py
pym/portage/dbapi/vartree.py
pym/portage/package/ebuild/doebuild.py

Simple merge
index 1e3785c5431a4af24bc55a071c23bfa491a369a9,c74b4a411172d0f5daab2659d00febfd858a53a2..8b58bda2eee64357f33812eecbaa66765d3256a3
mode 100644,100755..100644
index e62a9ade62d9889f8ff24631fcd726f023747012,7407aba9356e5225187bf39427425d37ef73d0dc..493bb54fc5e1ebdf39774fec9e9059ae9c12c47b
@@@ -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 cnf/make.conf
Simple merge
Simple merge
diff --cc man/emerge.1
Simple merge
diff --cc man/make.conf.5
Simple merge
Simple merge
Simple merge
index 1351c7f733a7e33e71b6aa44299f6fcbae35b72c,c4d967a1bfe169bcce69c986ae638f2069d2fa5d..a136093a47cade53e9e53f4ff35c5d31b23a0550
@@@ -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)
  
index edc3983006b08a792c9125cc5d46d3cc864cc0e2,d93d3c2ea26d205f02cc3a62b18eb68df228f79e..47457431b67b47f3a9cf89f65a34d2b6fab216b4
@@@ -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',
  )