aboutsummaryrefslogtreecommitdiff
path: root/pym
diff options
context:
space:
mode:
authorMichał Górny <gentoo@mgorny.alt.pl>2010-07-27 09:31:47 +0200
committerZac Medico <zmedico@gentoo.org>2010-07-27 00:36:32 -0700
commitaddd9a9b6027260bfbde35efc5408b5efe5341d6 (patch)
treef6fc2dad6bf2f922db881393ad627ed2a1bb09e9 /pym
parentFix PackageSet._updateAtomMap() to use ExtendedAtomDict.setdefault() (diff)
downloadportage-addd9a9b6027260bfbde35efc5408b5efe5341d6.tar.gz
portage-addd9a9b6027260bfbde35efc5408b5efe5341d6.tar.bz2
portage-addd9a9b6027260bfbde35efc5408b5efe5341d6.zip
Use a directory for the default set configuration.
Expect /usr/share/portage/config/sets to be a directory containing any number of set configuration files. The default Portage sets.conf should be now installed as sets/portage.conf, and other ebuilds are free to install their own set configuration files there.
Diffstat (limited to 'pym')
-rw-r--r--pym/_emerge/main.py2
-rw-r--r--pym/portage/sets/__init__.py20
2 files changed, 15 insertions, 7 deletions
diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index b553e15e3..e4449e805 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -1010,7 +1010,7 @@ def missing_sets_warning(root_config, missing_sets):
if root_config.sets:
msg.append(" sets defined: %s" % ", ".join(root_config.sets))
msg.append(" This usually means that '%s'" % \
- (os.path.join(portage.const.GLOBAL_CONFIG_PATH, "sets.conf"),))
+ (os.path.join(portage.const.GLOBAL_CONFIG_PATH, "sets/portage.conf"),))
msg.append(" is missing or corrupt.")
msg.append(" Falling back to default world and system set configuration!!!")
for line in msg:
diff --git a/pym/portage/sets/__init__.py b/pym/portage/sets/__init__.py
index fb87ce104..ab9869cee 100644
--- a/pym/portage/sets/__init__.py
+++ b/pym/portage/sets/__init__.py
@@ -176,9 +176,17 @@ class SetConfig(object):
return myatoms
def load_default_config(settings, trees):
- setconfigpaths = [os.path.join(GLOBAL_CONFIG_PATH, "sets.conf")]
- setconfigpaths.append(os.path.join(settings["PORTDIR"], "sets.conf"))
- setconfigpaths += [os.path.join(x, "sets.conf") for x in settings["PORTDIR_OVERLAY"].split()]
- setconfigpaths.append(os.path.join(settings["PORTAGE_CONFIGROOT"],
- USER_CONFIG_PATH, "sets.conf"))
- return SetConfig(setconfigpaths, settings, trees)
+ def _getfiles():
+ for path, dirs, files in os.walk(os.path.join(GLOBAL_CONFIG_PATH, "sets")):
+ for f in files:
+ yield os.path.join(path, f)
+
+ dbapi = trees["porttree"].dbapi
+ for repo in dbapi.getRepositories():
+ path = dbapi.getRepositoryPath(repo)
+ yield os.path.join(path, "sets.conf")
+
+ yield os.path.join(settings["PORTAGE_CONFIGROOT"],
+ USER_CONFIG_PATH, "sets.conf")
+
+ return SetConfig(_getfiles(), settings, trees)