revert r8256 (plans changed)
authorMarius Mauch <genone@gentoo.org>
Tue, 23 Oct 2007 20:58:13 +0000 (20:58 -0000)
committerMarius Mauch <genone@gentoo.org>
Tue, 23 Oct 2007 20:58:13 +0000 (20:58 -0000)
svn path=/main/trunk/; revision=8258

pym/portage/sets/__init__.py
pym/portage/sets/dbapi.py
pym/portage/sets/files.py
pym/portage/sets/profiles.py
pym/portage/sets/security.py
pym/portage/sets/shell.py

index 1802e67419cde3b5ee240be27e3368a5e429aac4..b757c43c47c5972d66f29f1ff27aa7e3ca033021 100644 (file)
@@ -50,7 +50,7 @@ class SetConfig(SafeConfigParser):
                        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
@@ -64,7 +64,7 @@ class SetConfig(SafeConfigParser):
                                        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
index ca481705dd7c9c91c3355340b5ba9562113e35ce..a1b902fdcc4db9abf2072032ab237907ea23f656 100644 (file)
@@ -31,8 +31,8 @@ class EverythingSet(PackageSet):
                                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):
@@ -71,7 +71,7 @@ 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")
 
@@ -79,24 +79,24 @@ class CategorySet(PackageSet):
                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/*")
        
@@ -104,7 +104,7 @@ class CategorySet(PackageSet):
                        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
@@ -147,8 +147,8 @@ class PreservedLibraryConsumerSet(LibraryConsumerSet):
                        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):
@@ -173,10 +173,10 @@ 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)
index 55b5714c3ab05bac6c979b71b03d4fe9f2357f3b..f0dfd78e2561c46eb37fc62366c6a297eea1a079 100644 (file)
@@ -68,16 +68,15 @@ class StaticFileSet(EditablePackageSet):
                        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")
@@ -102,16 +101,15 @@ class ConfigFileSet(PackageSet):
                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")
@@ -164,6 +162,6 @@ class WorldSet(StaticFileSet):
                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)
index b7555c7a559390e7b72f3918800dd3f659cba6c2..35cf4d87db2fb4dc114cc91ab0a90381d2895824 100644 (file)
@@ -21,6 +21,6 @@ class PackagesSystemSet(PackageSet):
                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)
index ff55ea50853e31117341ecc37395d9de05b274b1..b5332699078e21a1db1b78d096ef2112a9d230d7 100644 (file)
@@ -55,14 +55,13 @@ class SecuritySet(PackageSet):
                                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):
index 7696734852b3251ed825c5d1ea7033d6b04d891b..cae28fa4622a9a54329df135d1c6b4591e4b1ebe 100644 (file)
@@ -36,7 +36,7 @@ class CommandOutputSet(PackageSet):
                        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"])