Fallback to updates from PORTDIR if repository has no 'updates' dir.
authorMichał Górny <gentoo@mgorny.alt.pl>
Thu, 8 Jul 2010 10:58:01 +0000 (12:58 +0200)
committerZac Medico <zmedico@gentoo.org>
Tue, 27 Jul 2010 23:13:16 +0000 (16:13 -0700)
As a backwards-compatibility measure, if a particular repository doesn't
come with an 'updates' directory, fallback to updates from
dbapi.porttree_root.

bin/emaint
pym/_emerge/FakeVartree.py
pym/portage/_global_updates.py

index fb712db8b8e1b5294ac06d5330fb212a5a78b339..2bd17d9fdbe63ef5f37fe9217ba8fd177d461e61 100755 (executable)
@@ -239,6 +239,9 @@ class MoveHandler(object):
                for repo_name in self._portdb.getRepositories():
                        repo = self._portdb.getRepositoryPath(repo_name)
                        updpath = os.path.join(repo, "profiles", "updates")
+                       if not os.path.isdir(updpath):
+                               # as a backwards-compatibility measure, fallback to PORTDIR
+                               updpath = os.path.join(self._portdb.porttree_root, "profiles", "updates")
                        try:
                                rawupdates = grab_updates(updpath)
                        except portage.exception.DirectoryNotFound:
index afc74457d97f6fc0e3226171e7fb59c06fb8d6bf..22f9f3739c6efc5d22bd34fe58f28f0a6df09611 100644 (file)
@@ -185,6 +185,9 @@ def grab_global_updates(portdb):
        for repo_name in portdb.getRepositories():
                repo = portdb.getRepositoryPath(repo_name)
                updpath = os.path.join(repo, "profiles", "updates")
+               if not os.path.isdir(updpath):
+                       # as a backwards-compatibility measure, fallback to PORTDIR
+                       updpath = os.path.join(portdb.porttree_root, "profiles", "updates")
                try:
                        rawupdates = grab_updates(updpath)
                except portage.exception.DirectoryNotFound:
index b287654c0cc00aa81c72751c7e66e247b9d392bf..214052daf1352a0e4146d4ed6f9e0bc839f2cbdc 100644 (file)
@@ -58,6 +58,9 @@ def _global_updates(trees, prev_mtimes):
        for repo_name in portdb.getRepositories():
                repo = portdb.getRepositoryPath(repo_name)
                updpath = os.path.join(repo, "profiles", "updates")
+               if not os.path.isdir(updpath):
+                       # as a backwards-compatibility measure, fallback to PORTDIR
+                       updpath = os.path.join(portdb.porttree_root, "profiles", "updates")
 
                try:
                        if mysettings.get("PORTAGE_CALLER") == "fixpackages":