summaryrefslogtreecommitdiffstats
path: root/yuminstall.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2008-03-12 19:34:41 -0400
committerJeremy Katz <katzj@redhat.com>2008-03-12 19:35:28 -0400
commite66f150d28503f9628ff01556ba05e292d684bb6 (patch)
treeddb20a5ca19be9aee01a1e22bc86436b172cb8be /yuminstall.py
parent003587d96a3f2c7f4e3fb87e509f491346381cae (diff)
downloadanaconda-e66f150d28503f9628ff01556ba05e292d684bb6.tar.gz
anaconda-e66f150d28503f9628ff01556ba05e292d684bb6.tar.xz
anaconda-e66f150d28503f9628ff01556ba05e292d684bb6.zip
yum.remove removes installed packages, not to be installed packages (#436226)
So go back to removing from the tsInfo ourselves and add support for globs
Diffstat (limited to 'yuminstall.py')
-rw-r--r--yuminstall.py28
1 files changed, 23 insertions, 5 deletions
diff --git a/yuminstall.py b/yuminstall.py
index 4fa1fa85b..2858ab206 100644
--- a/yuminstall.py
+++ b/yuminstall.py
@@ -1614,11 +1614,29 @@ class YumBackend(AnacondaBackend):
return 0
def deselectPackage(self, pkg, *args):
- try:
- mbrs = self.ayum.remove(pattern=pkg)
- return len(mbrs)
- except yum.Errors.RemoveError:
- log.debug("no package matching %s" % pkg)
+ sp = pkg.rsplit(".", 2)
+ txmbrs = []
+ if len(sp) == 2:
+ txmbrs = self.ayum.tsInfo.matchNaevr(name=sp[0], arch=sp[1])
+
+ if len(txmbrs) == 0:
+ exact, match, unmatch = yum.packages.parsePackages(self.ayum.pkgSack.returnPackages(), [pkg], casematch=1)
+ for p in exact + match:
+ txmbrs.append(p)
+
+ if len(txmbrs) > 0:
+ for x in txmbrs:
+ self.ayum.tsInfo.remove(x.pkgtup)
+ # we also need to remove from the conditionals
+ # dict so that things don't get pulled back in as a result
+ # of them. yes, this is ugly. conditionals should die.
+ for req, pkgs in self.ayum.tsInfo.conditionals.iteritems():
+ if x in pkgs:
+ pkgs.remove(x)
+ self.ayum.tsInfo.conditionals[req] = pkgs
+ return len(txmbrs)
+ else:
+ log.debug("no such package %s to remove" %(pkg,))
return 0
def upgradeFindPackages(self):