summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Mauch <genone@gentoo.org>2007-10-05 20:05:43 +0000
committerMarius Mauch <genone@gentoo.org>2007-10-05 20:05:43 +0000
commit4dc662f624cd4f4117c8729e93f22e3bd5ab1596 (patch)
treee7253f0fe5f651f1c2869e16b07c95daee127e19
parent5832ec9302b9787668c554264bdba3ae843f4f82 (diff)
downloadportage-4dc662f624cd4f4117c8729e93f22e3bd5ab1596.tar.gz
portage-4dc662f624cd4f4117c8729e93f22e3bd5ab1596.tar.bz2
portage-4dc662f624cd4f4117c8729e93f22e3bd5ab1596.zip
replace category sets in test configuration with user sets
svn path=/main/trunk/; revision=7959
-rw-r--r--pym/emerge/__init__.py2
-rw-r--r--pym/portage/sets/__init__.py9
-rw-r--r--pym/portage/sets/files.py13
3 files changed, 14 insertions, 10 deletions
diff --git a/pym/emerge/__init__.py b/pym/emerge/__init__.py
index eb47084a1..764f55510 100644
--- a/pym/emerge/__init__.py
+++ b/pym/emerge/__init__.py
@@ -6395,6 +6395,8 @@ def emerge_main():
print "emerge: the given set %s does not support unmerge operations" % s
sys.exit(1)
myfiles.extend(packagesets[s].getAtoms())
+ for e in packagesets[s].errors:
+ print e
myfiles.remove(s)
if ("--tree" in myopts) and ("--columns" in myopts):
diff --git a/pym/portage/sets/__init__.py b/pym/portage/sets/__init__.py
index 481fa8b7a..de588fb4f 100644
--- a/pym/portage/sets/__init__.py
+++ b/pym/portage/sets/__init__.py
@@ -27,6 +27,7 @@ class PackageSet(object):
self._atommap = {}
self._loaded = False
self._loading = False
+ self.errors = []
def __contains__(self, atom):
return atom in self.getAtoms()
@@ -258,11 +259,9 @@ def make_default_config(settings, trees):
sc.set("config", "class", "portage.sets.files.ConfigFileSet")
sc.set("config", "multiset", "true")
- sc.add_section("categories_installed")
- sc.set("categories_installed", "class", "portage.sets.dbapi.CategorySet")
- sc.set("categories_installed", "multiset", "true")
- sc.set("categories_installed", "repository", "vartree")
- sc.set("categories_installed", "name_pattern", "installed/$category")
+ sc.add_section("user_sets")
+ sc.set("user_sets", "class", "portage.sets.files.StaticFileSet")
+ sc.set("user_sets", "multiset", "true")
return sc
diff --git a/pym/portage/sets/files.py b/pym/portage/sets/files.py
index 8a7f39549..b2b4191bf 100644
--- a/pym/portage/sets/files.py
+++ b/pym/portage/sets/files.py
@@ -53,6 +53,9 @@ class StaticFileSet(EditablePackageSet):
if (not self._loaded or self._mtime != mtime):
try:
data, errors = self.loader.load()
+ for fname in errors:
+ for e in errors[fname]:
+ self.errors.append(fname+": "+e)
except EnvironmentError, e:
if e.errno != errno.ENOENT:
raise
@@ -73,10 +76,11 @@ class StaticFileSet(EditablePackageSet):
name_pattern = options.get("name_pattern", "sets/$name")
if not "$name" in name_pattern and not "${name}" in name_pattern:
raise SetConfigError("name_pattern doesn't include $name placeholder")
- for filename in os.listdir(directory):
- myname = name_pattern.replace("$name", filename)
- myname = myname.replace("${name}", filename)
- rValue[myname] = StaticFileSet(os.path.join(directory, filename))
+ if os.path.isdir(directory):
+ for filename in os.listdir(directory):
+ myname = name_pattern.replace("$name", filename)
+ myname = myname.replace("${name}", filename)
+ rValue[myname] = StaticFileSet(os.path.join(directory, filename))
return rValue
multiBuilder = classmethod(multiBuilder)
@@ -129,6 +133,5 @@ class WorldSet(StaticFileSet):
self._lock = None
def singleBuilder(self, options, settings, trees):
- print "world.build"
return WorldSet(settings["ROOT"])
singleBuilder = classmethod(singleBuilder)