summaryrefslogtreecommitdiffstats
path: root/upgrade.py
diff options
context:
space:
mode:
authorPaul Nasrat <pnasrat@redhat.com>2005-05-12 18:12:12 +0000
committerPaul Nasrat <pnasrat@redhat.com>2005-05-12 18:12:12 +0000
commitba35052dd8e5a91e9e8d59d9192865b5bf89f356 (patch)
tree8ab49dfb046cbf56248bdc809c787b1d423b05c2 /upgrade.py
parent112001ac9b01fd3992a9fb7538dc0d532ef61f23 (diff)
downloadanaconda-ba35052dd8e5a91e9e8d59d9192865b5bf89f356.tar.gz
anaconda-ba35052dd8e5a91e9e8d59d9192865b5bf89f356.tar.xz
anaconda-ba35052dd8e5a91e9e8d59d9192865b5bf89f356.zip
remove perl.i386 on upgrade
Diffstat (limited to 'upgrade.py')
-rw-r--r--upgrade.py45
1 files changed, 33 insertions, 12 deletions
diff --git a/upgrade.py b/upgrade.py
index f28e2e630..f9f0a0299 100644
--- a/upgrade.py
+++ b/upgrade.py
@@ -35,7 +35,12 @@ from product import productName
from rhpl.log import log
from rhpl.translate import _
-upgrade_remove_blacklist = ()
+# blacklist made up of (name, arch) or
+# (name, ) to erase all matches
+upgrade_remove_blacklist = ()
+
+if iutil.getArch() == "x86_64":
+ upgrade_remove_blacklist = (("perl","i386"),)
def findRootParts(intf, id, dispatch, dir, chroot):
if dir == DISPATCH_BACK:
@@ -723,17 +728,33 @@ def upgradeFindPackages(intf, method, id, instPath, dir):
# if they were installed in the past, we want to remove them because
# they'll screw up the upgrade otherwise
for pkg in upgrade_remove_blacklist:
- h = None
- try:
- h = ts.dbMatch('name', pkg).next()
- except StopIteration:
- pass
- if h is not None:
- text = ("Upgrade: %s is on the system but will cause problems "
- "with the upgrade transaction. Removing." %(pkg,))
- log(text)
- id.upgradeDeps = "%s%s\n" %(id.upgradeDeps, text)
- id.upgradeRemove.append(pkg)
+ pkgarch = None
+ pkgnames = None
+ if len(pkg) == 1:
+ pkgname = pkg[0]
+ elif len(pkg) == 2:
+ pkgname, pkgarch = pkg
+ if pkgname is None:
+ continue
+
+ mi = ts.dbMatch('name', pkgname)
+ for h in mi:
+ if h is not None:
+ if pkgarch is None:
+ text = ("Upgrade: %s is on the system but will cause "
+ "problems with the upgrade transaction. Removing." %(pkg,))
+ log(text)
+ id.upgradeDeps = "%s%s\n" %(id.upgradeDeps, text)
+ id.upgradeRemove.append(pkgname)
+ break
+ else:
+ if h['arch'] == pkgarch:
+ text = ("Upgrade: %s.%s is on the system but will "
+ "cause problems with the upgrade transaction. "
+ "Removing." %(pkgname,pkgarch))
+ log(text)
+ id.upgradeDeps = "%s%s\n" %(id.upgradeDeps, text)
+ id.upgradeRemove.append(mi.instance())
# new package dependency fixup
depcheck = hdrlist.DependencyChecker(id.grpset, how = "u")