From 6e5246e6a463a40849bae470304e50da03521151 Mon Sep 17 00:00:00 2001 From: Marius Mauch Date: Sun, 28 Sep 2008 17:01:58 +0000 Subject: [PATCH] disable redefintion errors when updating the set definitions svn path=/main/trunk/; revision=11582 --- pym/portage/sets/__init__.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pym/portage/sets/__init__.py b/pym/portage/sets/__init__.py index 8e6a0ea86..022e31897 100644 --- a/pym/portage/sets/__init__.py +++ b/pym/portage/sets/__init__.py @@ -53,11 +53,10 @@ class SetConfig(SafeConfigParser): return for k, v in options.items(): self.set(section, k, v) - self._parsed = False - self._parse() + self._parse(update=True) - def _parse(self): - if self._parsed: + def _parse(self, update=False): + if self._parsed and not update: return for sname in self.sections(): # find classname for current section, default to file based sets @@ -87,7 +86,7 @@ class SetConfig(SafeConfigParser): self.errors.append("Configuration error in section '%s': %s" % (sname, str(e))) continue for x in newsets: - if x in self.psets: + if x in self.psets and not update: self.errors.append("Redefinition of set '%s' (sections: '%s', '%s')" % (x, self.psets[x].creator, sname)) newsets[x].creator = sname if self.has_option(sname, "world-candidate") and not self.getboolean(sname, "world-candidate"): @@ -101,7 +100,7 @@ class SetConfig(SafeConfigParser): setname = self.get(sname, "name") except NoOptionError: setname = sname - if setname in self.psets: + if setname in self.psets and not update: self.errors.append("Redefinition of set '%s' (sections: '%s', '%s')" % (setname, self.psets[setname].creator, sname)) if hasattr(setclass, "singleBuilder"): try: -- 2.26.2