Merge remote-tracking branch 'overlays-gentoo-org/master' into prefix
authorFabian Groffen <grobian@gentoo.org>
Sat, 10 Dec 2011 10:56:53 +0000 (11:56 +0100)
committerFabian Groffen <grobian@gentoo.org>
Sat, 10 Dec 2011 10:56:53 +0000 (11:56 +0100)
Conflicts:
bin/dispatch-conf
bin/egencache
bin/phase-functions.sh
bin/portageq
bin/repoman
cnf/make.globals
pym/_emerge/Binpkg.py
pym/portage/__init__.py
pym/portage/data.py
pym/portage/dispatch_conf.py
pym/portage/package/ebuild/_config/special_env_vars.py

15 files changed:
1  2 
bin/dispatch-conf
bin/egencache
bin/phase-functions.sh
bin/portageq
bin/repoman
man/make.conf.5
pym/_emerge/Binpkg.py
pym/_emerge/main.py
pym/portage/__init__.py
pym/portage/const.py
pym/portage/data.py
pym/portage/dispatch_conf.py
pym/portage/package/ebuild/_config/special_env_vars.py
pym/portage/package/ebuild/config.py
pym/portage/util/env_update.py

index e639b66d854c0d42d9ec43922fbc2222c327e062,75e991189367e559db732a6a9aa61f80a5e30a60..1b86461c91f51147be4ab533c002961b0bb975fc
@@@ -92,7 -85,7 +92,7 @@@ class dispatch
          confs = []
          count = 0
  
-         config_root = os.environ.get("__PORTAGE_TEST_EPREFIX", EPREFIX)
 -        config_root = portage.const.EPREFIX or os.sep
++        config_root = EPREFIX or os.sep
          self.options = portage.dispatch_conf.read_config(MANDATORY_OPTS)
  
          if "log-file" in self.options:
diff --cc bin/egencache
index d27754d4abffec99d4ae0634798b317deb2b0f94,6d18f66e554a448f638e017cdfceadaa39df8004..b7893e694ce22ee8165327cec27e37b30a6394bb
@@@ -842,12 -841,10 +842,10 @@@ def egencache_main(args)
        if options.portdir is not None:
                env['PORTDIR'] = options.portdir
  
-       eprefix = os.environ.get("__PORTAGE_TEST_EPREFIX")
-       if not eprefix:
-               eprefix = EPREFIX
 -      eprefix = portage.const.EPREFIX
++      eprefix = EPREFIX
  
        settings = portage.config(config_root=config_root,
-               local_config=False, env=env, _eprefix=eprefix)
+               local_config=False, env=env, eprefix=eprefix)
  
        default_opts = None
        if not options.ignore_default_opts:
index 40decb75d8b08c66406fd790d78766b8c296f3db,f862b30feb1550c9e2f3274c6fb9e2f9d55efc68..331afc8ae5cbe8c044202522535dd196479a7523
@@@ -28,7 -28,7 +28,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_TEST_EPREFIX ED EROOT"
 -      PORTAGE_OVERRIDE_EPREFIX"
++      PORTAGE_OVERRIDE_EPREFIX ED EROOT"
  
  PORTAGE_SAVED_READONLY_VARS="A CATEGORY P PF PN PR PV PVR"
  
diff --cc bin/portageq
Simple merge
diff --cc bin/repoman
Simple merge
diff --cc man/make.conf.5
Simple merge
index 4b66033b0b66b06eec3d9413a7d98f6f30d65dc3,b25906918d7b3e7d53cb9d2ced3444a2467451b1..213ced2560e538a4422ed7aa869864dea69a104d
@@@ -19,8 -19,8 +20,9 @@@ from portage import _unicode_decod
  from portage import _unicode_encode
  import io
  import logging
+ import shutil
  from portage.output import colorize
 +from portage.const import EPREFIX
  
  class Binpkg(CompositeTask):
  
                finally:
                        f.close()
  
-               self._buildprefix = pkg_xpak.getfile(_unicode_encode("EPREFIX",
++              # PREFIX LOCAL: deal with EPREFIX from binpkg
 +              # Retrieve the EPREFIX this package was built with
-               if not self._buildprefix:
-                       self._buildprefix = ''
++              self._build_prefix = pkg_xpak.getfile(_unicode_encode("EPREFIX",
 +                      encoding=_encodings['repo.content']))
-                       self._buildprefix = self._buildprefix.strip()
++              if not self._buil_dprefix:
++                      self._build_prefix = ''
 +              else:
++                      self._build_prefix = self._build_prefix.strip()
 +              # We want to install in "our" prefix, not the binary one
 +              self.settings["EPREFIX"] = EPREFIX
 +              f = io.open(_unicode_encode(os.path.join(infloc, 'EPREFIX'),
 +                      encoding=_encodings['fs'], errors='strict'),
 +                      mode='w', encoding=_encodings['content'], errors='strict')
 +              try:
 +                      f.write(_unicode_decode(EPREFIX + "\n"))
 +              finally:
 +                      f.close()
++              # END PREFIX LOCAL
 +
                env_extractor = BinpkgEnvExtractor(background=self.background,
                        scheduler=self.scheduler, settings=self.settings)
  
                        self.wait()
                        return
  
-               if (self._buildprefix != EPREFIX):
++              # PREFIX LOCAL:
 +              # if the prefix differs, we copy it to the image after
 +              # extraction using chpathtool
++              if (self._build_prefix != EPREFIX):
 +                      pkgloc = self._work_dir
 +              else:
 +                      pkgloc = self._image_dir
++              # END PREFIX LOCAL
 +
                extractor = BinpkgExtractorAsync(background=self.background,
                        env=self.settings.environ(),
 -                      image_dir=self._image_dir,
 +                      image_dir=pkgloc,
                        pkg=self.pkg, pkg_path=self._pkg_path,
                        logfile=self.settings.get("PORTAGE_LOG_FILE"),
                        scheduler=self.scheduler)
                        self.wait()
                        return
  
-               if self._buildprefix != EPREFIX:
 -              try:
 -                      with io.open(_unicode_encode(os.path.join(self._infloc, "EPREFIX"),
 -                              encoding=_encodings['fs'], errors='strict'), mode='r',
 -                              encoding=_encodings['repo.content'], errors='replace') as f:
 -                              self._build_prefix = f.read().rstrip('\n')
 -              except IOError:
 -                      self._build_prefix = ""
 -
 -              if self._build_prefix == self.settings["EPREFIX"]:
 -                      ensure_dirs(self.settings["ED"])
 -                      self._current_task = None
 -                      self.returncode = os.EX_OK
++              # PREFIX LOCAL: use chpathtool binary
++              if self._build_prefix != EPREFIX:
 +                      chpathtool = BinpkgChpathtoolAsync(background=self.background,
 +                              image_dir=self._image_dir, work_dir=self._work_dir,
-                               buildprefix=self._buildprefix, eprefix=EPREFIX,
++                              buildprefix=self._build_prefix, eprefix=EPREFIX,
 +                              pkg=self.pkg, scheduler=self.scheduler)
 +                      self._writemsg_level(">>> Adjusting Prefix to %s\n" % EPREFIX)
 +                      self._start_task(chpathtool, self._chpathtool_exit)
 +              else:
                        self.wait()
 -                      return
 -
 -              chpathtool = SpawnProcess(
 -                      args=[portage._python_interpreter,
 -                      os.path.join(self.settings["PORTAGE_BIN_PATH"], "chpathtool.py"),
 -                      self.settings["D"], self._build_prefix, self.settings["EPREFIX"]],
 -                      background=self.background, env=self.settings.environ(), 
 -                      scheduler=self.scheduler,
 -                      logfile=self.settings.get('PORTAGE_LOG_FILE'))
 -              self._writemsg_level(">>> Adjusting Prefix to %s\n" % self.settings["EPREFIX"])
 -              self._start_task(chpathtool, self._chpathtool_exit)
++              # END PREFIX LOCAL
  
        def _chpathtool_exit(self, chpathtool):
                if self._final_exit(chpathtool) != os.EX_OK:
                        self._unlock_builddir()
-                       writemsg("!!! Error Adjusting Prefix to %s\n" % EPREFIX,
-                               noiselevel=-1)
+                       self._writemsg_level("!!! Error Adjusting Prefix to %s" %
+                               (self.settings["EPREFIX"],),
+                               noiselevel=-1, level=logging.ERROR)
+                       self.wait()
+                       return
 -              # We want to install in "our" prefix, not the binary one
 -              with io.open(_unicode_encode(os.path.join(self._infloc, "EPREFIX"),
 -                      encoding=_encodings['fs'], errors='strict'), mode='w',
 -                      encoding=_encodings['repo.content'], errors='strict') as f:
 -                      f.write(self.settings["EPREFIX"] + "\n")
 -
 -              # Move the files to the correct location for merge.
 -              image_tmp_dir = os.path.join(
 -                      self.settings["PORTAGE_BUILDDIR"], "image_tmp")
 -              build_d = os.path.join(self.settings["D"],
 -                      self._build_prefix.lstrip(os.sep))
 -              if not os.path.isdir(build_d):
 -                      # Assume this is a virtual package or something.
 -                      shutil.rmtree(self._image_dir)
 -                      ensure_dirs(self.settings["ED"])
 -              else:
 -                      os.rename(build_d, image_tmp_dir)
 -                      shutil.rmtree(self._image_dir)
 -                      ensure_dirs(os.path.dirname(self.settings["ED"].rstrip(os.sep)))
 -                      os.rename(image_tmp_dir, self.settings["ED"])
 -
                self.wait()
  
        def _unlock_builddir(self):
Simple merge
index c5b7f76824a75d16da8423e0cfd6d31c989fffd0,1df956633c6c95d03b3f70e2f9b042575621b8d9..21ca69e126d81dbb17950f3c893a8c0c7ff43045
@@@ -505,11 -505,9 +506,8 @@@ def create_trees(config_root=None, targ
  
        if env is None:
                env = os.environ
-       eprefix = env.get("__PORTAGE_TEST_EPREFIX")
-       if not eprefix:
-               eprefix = EPREFIX
 -
        settings = config(config_root=config_root, target_root=target_root,
-               env=env, _eprefix=eprefix)
+               env=env, eprefix=eprefix)
        settings.lock()
  
        trees._target_eroot = settings['EROOT']
index 83d6696588b5c21477416dbf8facbe485244f0eb,a32933c4bec27201d945d20f056f12b0f215d3c5..2223b4c5e1bb79d1d667310122512485ae717bc5
@@@ -191,13 -146,11 +191,13 @@@ MANIFEST2_IDENTIFIERS    = ("AUX", "MIS
  # 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.
 -EPREFIX=""
 +# PREFIX LOCAL: rely on EPREFIX from autotools
 +#EPREFIX=""
 +# END PREFIX LOCAL
  
  # pick up EPREFIX from the environment if set
- if "__PORTAGE_TEST_EPREFIX" in os.environ:
-       EPREFIX = os.environ["__PORTAGE_TEST_EPREFIX"]
+ if "PORTAGE_OVERRIDE_EPREFIX" in os.environ:
+       EPREFIX = os.environ["PORTAGE_OVERRIDE_EPREFIX"]
        if EPREFIX:
                EPREFIX = os.path.normpath(EPREFIX)
  
index e8a0a3ab00500827771eb65a981763c0158f9919,53af6b9665405fe99b93fd0ffcde36068cb890d3..196e5dc95996a44ada21bbb7ef869b106ace4a77
@@@ -95,15 -86,8 +90,16 @@@ def _get_global(k)
                        secpass = 2
                #Discover the uid and gid of the portage user/group
                try:
-                       portage_gid = grp.getgrnam(_get_global('_portage_grpname'))[2]
 -                      portage_uid = pwd.getpwnam(_get_global('_portage_uname')).pw_uid
+                       portage_gid = grp.getgrnam(_get_global('_portage_grpname')).gr_gid
 +              except KeyError:
-                       # some sysadmins are insane, bug #344307
++                      # 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'))[2]
++                      portage_uid = pwd.getpwnam(_get_global('_portage_uname')).pw_uid
                        if secpass < 1 and portage_gid in os.getgroups():
                                secpass = 1
                except KeyError:
index bfd6517b29a7bd871ba9cdd16668e5f6069a149b,7f407fffed77e72a5df281f549b6c70a3687661a..11a6a7d839f1f11b245740a294a03e38e9f13aef
@@@ -40,8 -39,8 +40,9 @@@ def diffstatusoutput_len(cmd)
          return (1, 1)
  
  def read_config(mandatory_opts):
-     eprefix = os.environ.get("__PORTAGE_TEST_EPREFIX", EPREFIX)
-     config_path = os.path.join(eprefix, "etc/dispatch-conf.conf")
 -    eprefix = portage.const.EPREFIX
++    eprefix = EPREFIX
+     config_path = os.path.join(eprefix or os.sep, "etc/dispatch-conf.conf")
++>>>>>>> overlays-gentoo-org/master
      loader = KeyValuePairFileLoader(config_path, None)
      opts, errors = loader.load()
      if not opts:
index d07f68b35e11eefe1dbc87bcd0e78eff95ea0aa9,3911e97730a546f5881c93dec7e66f239949e809..a2f65057fe9a7161457da84ff449aa8ddf89177b
@@@ -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_TEST_EPREFIX",
+       "XARGS", "PORTAGE_OVERRIDE_EPREFIX",
 +      "BPREFIX", "DEFAULT_PATH", "EXTRA_PATH",
 +      "PORTAGE_GROUP", "PORTAGE_USER",
  ]
  
  # user config variables
Simple merge
Simple merge