diff options
author | Marius Mauch <genone@gentoo.org> | 2008-05-02 03:24:30 +0000 |
---|---|---|
committer | Marius Mauch <genone@gentoo.org> | 2008-05-02 03:24:30 +0000 |
commit | 8d2dd63139cb96dacfcce6c49bf19a20f7ef6ee4 (patch) | |
tree | 457075e51dac89209cc9a82f166b7a56d838934f | |
parent | 908e8bf9c693a7d0b6b9dc7a7c463e26bffb7b18 (diff) | |
download | portage-8d2dd63139cb96dacfcce6c49bf19a20f7ef6ee4.tar.gz portage-8d2dd63139cb96dacfcce6c49bf19a20f7ef6ee4.tar.bz2 portage-8d2dd63139cb96dacfcce6c49bf19a20f7ef6ee4.zip |
check if a given package set is defined more than once
svn path=/main/trunk/; revision=10075
-rw-r--r-- | pym/portage/sets/__init__.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/pym/portage/sets/__init__.py b/pym/portage/sets/__init__.py index 476aea4ca..554b534bc 100644 --- a/pym/portage/sets/__init__.py +++ b/pym/portage/sets/__init__.py @@ -32,7 +32,6 @@ class SetConfig(SafeConfigParser): self.settings = settings self._parsed = False self.active = [] - self.aliases = {} def _parse(self): if self._parsed: @@ -58,11 +57,17 @@ class SetConfig(SafeConfigParser): # create single or multiple instances of the given class depending on configuration if self.has_option(sname, "multiset") and self.getboolean(sname, "multiset"): if hasattr(setclass, "multiBuilder"): + newsets = {} try: - self.psets.update(setclass.multiBuilder(optdict, self.settings, self.trees)) + newsets = setclass.multiBuilder(optdict, self.settings, self.trees) except SetConfigError, e: self.errors.append("Configuration error in section '%s': %s" % (sname, str(e))) continue + for x in newsets: + if x in self.psets: + self.errors.append("Redefinition of set '%s' (sections: '%s', '%s')" % (setname, self.psets[setname].creator, sname)) + newsets[x].creator = sname + self.psets.update(newsets) else: self.errors.append("Section '%s' is configured as multiset, but '%s' doesn't support that configuration" % (sname, classname)) continue @@ -71,9 +76,12 @@ class SetConfig(SafeConfigParser): setname = self.get(sname, "name") except NoOptionError: setname = sname + if setname in self.psets: + self.errors.append("Redefinition of set '%s' (sections: '%s', '%s')" % (setname, self.psets[setname].creator, sname)) if hasattr(setclass, "singleBuilder"): try: self.psets[setname] = setclass.singleBuilder(optdict, self.settings, self.trees) + self.psets[setname].creator = sname except SetConfigError, e: self.errors.append("Configuration error in section '%s': %s" % (sname, str(e))) continue |