if self.has_option(sname, "multiset") and self.getboolean(sname, "multiset"):
if hasattr(setclass, "multiBuilder"):
try:
- self.psets.update(setclass.multiBuilder(optdict, self))
+ self.psets.update(setclass.multiBuilder(optdict, self.settings, self.trees))
except SetConfigError, e:
self.errors.append("Configuration error in section '%s': %s" % (sname, str(e)))
continue
setname = "sets/"+sname
if hasattr(setclass, "singleBuilder"):
try:
- self.psets[setname] = setclass.singleBuilder(optdict, self)
+ self.psets[setname] = setclass.singleBuilder(optdict, self.settings, self.trees)
except SetConfigError, e:
self.errors.append("Configuration error in section '%s': %s" % (sname, str(e)))
continue
myatoms.append(cp)
self._setAtoms(myatoms)
- def singleBuilder(self, options, setconfig):
- return EverythingSet(setconfig.trees["vartree"].dbapi)
+ def singleBuilder(self, options, settings, trees):
+ return EverythingSet(trees["vartree"].dbapi)
singleBuilder = classmethod(singleBuilder)
class CategorySet(PackageSet):
return bool(visible in ["1", "yes", "true", "on"])
_builderGetVisible = classmethod(_builderGetVisible)
- def singleBuilder(cls, options, setconfig):
+ def singleBuilder(cls, options, settings, trees):
if not "category" in options:
raise SetConfigError("no category given")
if not category in categories:
raise SetConfigError("invalid category name '%s'" % category)
- repository = cls._builderGetRepository(options, setconfig.trees.keys())
+ repository = cls._builderGetRepository(options, trees.keys())
visible = cls._builderGetVisible(options)
- return CategorySet(category, dbapi=setconfig.trees[repository].dbapi, only_visible=visible)
+ return CategorySet(category, dbapi=trees[repository].dbapi, only_visible=visible)
singleBuilder = classmethod(singleBuilder)
- def multiBuilder(cls, options, setconfig):
+ def multiBuilder(cls, options, settings, trees):
rValue = {}
if "categories" in options:
categories = options["categories"].split()
- invalid = set(categories).difference(setconfig.settings.categories)
+ invalid = set(categories).difference(settings.categories)
if invalid:
raise SetConfigError("invalid categories: %s" % ", ".join(list(invalid)))
else:
- categories = setconfig.settings.categories
+ categories = settings.categories
- repository = cls._builderGetRepository(options, setconfig.trees.keys())
+ repository = cls._builderGetRepository(options, trees.keys())
visible = cls._builderGetVisible(options)
name_pattern = options.get("name_pattern", "$category/*")
raise SetConfigError("name_pattern doesn't include $category placeholder")
for cat in categories:
- myset = CategorySet(cat, setconfig.trees[repository].dbapi, only_visible=visible)
+ myset = CategorySet(cat, trees[repository].dbapi, only_visible=visible)
myname = name_pattern.replace("$category", cat)
myname = myname.replace("${category}", cat)
rValue[myname] = myset
return
self._setAtoms(self.mapPathsToAtoms(consumers))
- def singleBuilder(cls, options, setconfig):
- return PreservedLibraryConsumerSet(setconfig.trees["vartree"].dbapi)
+ def singleBuilder(cls, options, settings, trees):
+ return PreservedLibraryConsumerSet(trees["vartree"].dbapi)
singleBuilder = classmethod(singleBuilder)
class MissingLibraryConsumerSet(LibraryConsumerSet):
return
self._setAtoms(self.mapPathsToAtoms(consumers))
- def singleBuilder(cls, options, setconfig):
+ def singleBuilder(cls, options, settings, trees):
if options.get("debug", "true").lower() in ["true", "on", "1", "yes"]:
debug = True
else:
debug = False
- return MissingLibraryConsumerSet(setconfig.trees["vartree"].dbapi, debug=debug)
+ return MissingLibraryConsumerSet(trees["vartree"].dbapi, debug=debug)
singleBuilder = classmethod(singleBuilder)
self._setAtoms(data.keys())
self._mtime = mtime
- def singleBuilder(self, options, setconfig):
+ def singleBuilder(self, options, settings, trees):
if not "filename" in options:
raise SetConfigError("no filename specified")
return ConfigFileSet(options[filename])
singleBuilder = classmethod(singleBuilder)
- def multiBuilder(self, options, setconfig):
+ def multiBuilder(self, options, settings, trees):
rValue = {}
- directory = options.get("directory", \
- os.path.join(setconfig.settings["PORTAGE_CONFIGROOT"], USER_CONFIG_PATH.lstrip(os.sep), "sets"))
+ directory = options.get("directory", os.path.join(settings["PORTAGE_CONFIGROOT"], USER_CONFIG_PATH.lstrip(os.sep), "sets"))
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")
data, errors = self.loader.load()
self._setAtoms(data.keys())
- def singleBuilder(self, options, setconfig):
+ def singleBuilder(self, options, settings, trees):
if not "filename" in options:
raise SetConfigError("no filename specified")
return ConfigFileSet(options[filename])
singleBuilder = classmethod(singleBuilder)
- def multiBuilder(self, options, setconfig):
+ def multiBuilder(self, options, settings, trees):
rValue = {}
- directory = options.get("directory", \
- os.path.join(setconfig.settings["PORTAGE_CONFIGROOT"], USER_CONFIG_PATH.lstrip(os.sep)))
+ directory = options.get("directory", os.path.join(settings["PORTAGE_CONFIGROOT"], USER_CONFIG_PATH.lstrip(os.sep)))
name_pattern = options.get("name_pattern", "sets/package_$suffix")
if not "$suffix" in name_pattern and not "${suffix}" in name_pattern:
raise SetConfigError("name_pattern doesn't include $suffix placeholder")
self.replace(newworldlist)
self.unlock()
- def singleBuilder(self, options, setconfig):
- return WorldSet(setconfig.settings["ROOT"])
+ def singleBuilder(self, options, settings, trees):
+ return WorldSet(settings["ROOT"])
singleBuilder = classmethod(singleBuilder)
mylist = stack_lists(mylist, incremental=1)
self._setAtoms([x[1:] for x in mylist if x[0] == "*"])
- def singleBuilder(self, options, setconfig):
- return PackagesSystemSet(setconfig.settings.profiles)
+ def singleBuilder(self, options, settings, trees):
+ return PackagesSystemSet(settings.profiles)
singleBuilder = classmethod(singleBuilder)
applied_list.append(glsaid)
write_atomic(self._checkfile, "\n".join(applied_list))
- def singleBuilder(cls, options, setconfig):
+ def singleBuilder(cls, options, settings, trees):
if "use_emerge_resoler" in options \
and options.get("use_emerge_resolver").lower() in ["1", "yes", "true", "on"]:
least_change = False
else:
least_change = True
- return cls(setconfig.settings, setconfig.trees["vartree"].dbapi, \
- setconfig.trees["porttree"].dbapi, least_change=least_change)
+ return cls(settings, trees["vartree"].dbapi, trees["porttree"].dbapi, least_change=least_change)
singleBuilder = classmethod(singleBuilder)
class NewGlsaSet(SecuritySet):
text = pipe.stdout.read()
self._setAtoms(text.split("\n"))
- def singleBuilder(self, options, setconfig):
+ def singleBuilder(self, options, settings, trees):
if not command in options:
raise SetConfigError("no command specified")
return CommandOutputSet(options["command"])