From: Marius Mauch Date: Fri, 2 May 2008 03:24:30 +0000 (-0000) Subject: check if a given package set is defined more than once X-Git-Tag: v2.2_pre6~61 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8d2dd63139cb96dacfcce6c49bf19a20f7ef6ee4;p=portage.git check if a given package set is defined more than once svn path=/main/trunk/; revision=10075 --- 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