summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichał Górny <gentoo@mgorny.alt.pl>2010-07-08 12:58:01 +0200
committerZac Medico <zmedico@gentoo.org>2010-07-27 16:13:16 -0700
commitc70f90b3cf0d55f569783d07202b3819d11dc018 (patch)
tree6c5008b3661739b2643216af34839e64af101664
parent3926854e3ab4aec24673f81848d3f75ba9278592 (diff)
downloadportage-c70f90b3cf0d55f569783d07202b3819d11dc018.tar.gz
portage-c70f90b3cf0d55f569783d07202b3819d11dc018.tar.bz2
portage-c70f90b3cf0d55f569783d07202b3819d11dc018.zip
Fallback to updates from PORTDIR if repository has no 'updates' dir.
As a backwards-compatibility measure, if a particular repository doesn't come with an 'updates' directory, fallback to updates from dbapi.porttree_root.
-rwxr-xr-xbin/emaint3
-rw-r--r--pym/_emerge/FakeVartree.py3
-rw-r--r--pym/portage/_global_updates.py3
3 files changed, 9 insertions, 0 deletions
diff --git a/bin/emaint b/bin/emaint
index fb712db8b..2bd17d9fd 100755
--- a/bin/emaint
+++ b/bin/emaint
@@ -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:
diff --git a/pym/_emerge/FakeVartree.py b/pym/_emerge/FakeVartree.py
index afc74457d..22f9f3739 100644
--- a/pym/_emerge/FakeVartree.py
+++ b/pym/_emerge/FakeVartree.py
@@ -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:
diff --git a/pym/portage/_global_updates.py b/pym/portage/_global_updates.py
index b287654c0..214052daf 100644
--- a/pym/portage/_global_updates.py
+++ b/pym/portage/_global_updates.py
@@ -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":