diff options
author | Jeremy Katz <katzj@redhat.com> | 2002-07-17 04:44:53 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2002-07-17 04:44:53 +0000 |
commit | c381b3773715f651b2a3fc1dda3b2f89cb4bd771 (patch) | |
tree | 38fd9b0150542c76ac3e3036c91a25ca2cd4d2af /comps.py | |
parent | bd290197c0caf86203b3e10b993beac0043b7b84 (diff) | |
download | anaconda-c381b3773715f651b2a3fc1dda3b2f89cb4bd771.tar.gz anaconda-c381b3773715f651b2a3fc1dda3b2f89cb4bd771.tar.xz anaconda-c381b3773715f651b2a3fc1dda3b2f89cb4bd771.zip |
confuse concepts even more at least as far as naming is concerned. we need to use the depsDict refcounting even with optional packages, because an optional package can be a dependency of another optional package though its kind of weird to do so.
Diffstat (limited to 'comps.py')
-rw-r--r-- | comps.py | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -373,6 +373,13 @@ class Component: self.newpkgDict[p] = (PKGTYPE_OPTIONAL, 1) p.registerComponent(self) self.pkgDict[p] = None + # up the refcount since, otherwise, when you have things + # which are deps as optional also, Bad Things Happen (tm) + if p.name in self.depsDict.keys(): + self.depsDict[p.name] = self.depsDict[p.name] + 1 + else: + self.depsDict[p.name] = 1 + self.updateDependencyCountForAddition(p) elif isinstance(p, Component): print "selecting component" @@ -391,6 +398,12 @@ class Component: p.unregisterComponent(self) if self.pkgDict.has_key(p): del self.pkgDict[p] + # dec the refcount since, otherwise, when you have things + # which are deps as optional also, Bad Things Happen (tm) + if p.name in self.depsDict.keys(): + self.depsDict[p.name] = self.depsDict[p.name] - 1 + if self.depsDict[p.name] == 0: + del self.depsDict[p.name] self.updateDependencyCountForRemoval(p) elif isinstance(p, Component): p.unselect(forInclude = 1, toplevel = 0) |