summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-04-27 22:26:07 +0000
committerZac Medico <zmedico@gentoo.org>2006-04-27 22:26:07 +0000
commit7ddf0f55b83c6d6519685fd99e107e9d2113c18e (patch)
treedca62d1b98781ec7a2f182a0c5bfe05c12c564cd
parent764667c9e3546687a1e11a841bc535d437d30f99 (diff)
downloadportage-7ddf0f55b83c6d6519685fd99e107e9d2113c18e.tar.gz
portage-7ddf0f55b83c6d6519685fd99e107e9d2113c18e.tar.bz2
portage-7ddf0f55b83c6d6519685fd99e107e9d2113c18e.zip
Remove usage of the portage.thirdpartymirrors global variable.
svn path=/main/trunk/; revision=3252
-rw-r--r--pym/portage.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 67615a5d9..b91576b61 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -1704,11 +1704,13 @@ class config:
return mydict
def thirdpartymirrors(self):
- profileroots = [os.path.join(self["PORTDIR"], "profiles")]
- for x in self["PORTDIR_OVERLAY"].split():
- profileroots.insert(0, os.path.join(x, "profiles"))
- thirdparty_lists = [grabdict(os.path.join(x, "thirdpartymirrors")) for x in profileroots]
- return stack_dictlist(thirdparty_lists, incremental=True)
+ if getattr(self, "_thirdpartymirrors", None) is None:
+ profileroots = [os.path.join(self["PORTDIR"], "profiles")]
+ for x in self["PORTDIR_OVERLAY"].split():
+ profileroots.insert(0, os.path.join(x, "profiles"))
+ thirdparty_lists = [grabdict(os.path.join(x, "thirdpartymirrors")) for x in profileroots]
+ self._thirdpartymirrors = stack_dictlist(thirdparty_lists, incremental=True)
+ return self._thirdpartymirrors
def archlist(self):
return flatten([[myarch, "~" + myarch] \
@@ -1778,7 +1780,7 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
print ">>> \"mirror\" mode desired and \"mirror\" restriction found; skipping fetch."
return 1
- global thirdpartymirrors
+ thirdpartymirrors = mysettings.thirdpartymirrors()
check_config_instance(mysettings)
@@ -6875,8 +6877,6 @@ if root!="/":
db[root].addLazySingleton("porttree", portagetree, root)
db[root].addLazyItem("bintree", LazyBintreeItem(root))
-thirdpartymirrors = settings.thirdpartymirrors()
-
# ============================================================================
# COMPATIBILITY
# These attributes should not be used within Portage under any circumstances.
@@ -6885,6 +6885,7 @@ archlist = settings.archlist()
features = settings.features
groups = settings["ACCEPT_KEYWORDS"].split()
pkglines = settings.packages
+thirdpartymirrors = settings.thirdpartymirrors()
profiledir = None
if os.path.isdir(PROFILE_PATH):
profiledir = PROFILE_PATH