When portage updates itself and the new version either inherits
authorZac Medico <zmedico@gentoo.org>
Tue, 31 Aug 2010 18:45:28 +0000 (11:45 -0700)
committerZac Medico <zmedico@gentoo.org>
Tue, 31 Aug 2010 18:45:28 +0000 (11:45 -0700)
git.eclass or has 9999 in its version, trigger the 'use copy of current
sources for install, then restart portage' routine. This is required
since with the live git portage-9999 ebuild we can't use the version
to detect incompatible changes to ebuild.sh. This issue was noticed
due to recent versions of ebuild.sh expecting PORTAGE_BZIP2_COMMAND to
be set, causing incompatibility with installed portage-9999 instances.

pym/_emerge/Scheduler.py
pym/_emerge/depgraph.py
pym/portage/dbapi/vartree.py

index ee5b8a3d5c466bf707e3c0b6e6ee6b22b137960c..b78be89f9292426dc59ac719ed1233c256447dca 100644 (file)
@@ -828,9 +828,12 @@ class Scheduler(PollScheduler):
                if pkg.root == self._running_root.root and \
                        portage.match_from_list(
                        portage.const.PORTAGE_PACKAGE_ATOM, [pkg]):
-                       if self._running_portage:
-                               return pkg.cpv != self._running_portage.cpv
-                       return True
+                       if self._running_portage is None:
+                               return True
+                       elif pkg.cpv != self._running_portage.cpv or \
+                               '9999' in pkg.cpv or \
+                               'git' in pkg.inherited:
+                               return True
                return False
 
        def _restart_if_necessary(self, pkg):
index 25429601eea6227465f03e54f464124f44c71eea..3be0a196b2cf8fc09cd515db90c180fd92a251d8 100644 (file)
@@ -4897,8 +4897,10 @@ class depgraph(object):
                                        pkg.root == self._frozen_config._running_root.root and \
                                        portage.match_from_list(
                                        portage.const.PORTAGE_PACKAGE_ATOM, [pkg]) and \
-                                       not vardb.cpv_exists(pkg.cpv) and \
                                        "--quiet" not in self._frozen_config.myopts:
+                                       if not vardb.cpv_exists(pkg.cpv) or \
+                                               '9999' in pkg.cpv or \
+                                               'git' in pkg.inherited:
                                                if mylist_index < len(mylist) - 1:
                                                        p.append(colorize("WARN", "*** Portage will stop merging at this point and reload itself,"))
                                                        p.append(colorize("WARN", "    then resume the merge."))
index 9c4355143335d491828e1ee90159f68f7269e8a9..52f8d833cb97fce34061d6c7423b678e39130e29 100644 (file)
@@ -3768,7 +3768,9 @@ class dblink(object):
                        self.vartree.dbapi._categories = None
                if self.myroot == "/" and \
                        match_from_list(PORTAGE_PACKAGE_ATOM, [self.mycpv]) and \
-                       not self.vartree.dbapi.cpv_exists(self.mycpv):
+                       (not self.vartree.dbapi.cpv_exists(self.mycpv) or \
+                       '9999' in self.mycpv or \
+                       'git' in self.settings.get('INHERITED', '').split()):
                        # Load lazily referenced portage submodules into memory,
                        # so imports won't fail during portage upgrade/downgrade.
                        portage.proxy.lazyimport._preload_portage_submodules()