From 325e7cfea669b42ee655f18a5c52d063b9d8ea92 Mon Sep 17 00:00:00 2001 From: Shad L. Lords Date: Mon, 19 Oct 2009 08:43:46 -0600 Subject: [PATCH 15/17] Determine upgradability of SME server --- partedUtils.py | 1 + textw/upgrade_text.py | 21 +++++++-------------- upgrade.py | 2 +- yuminstall.py | 7 ++----- 4 files changed, 11 insertions(+), 20 deletions(-) diff --git a/partedUtils.py b/partedUtils.py index 2a2d034..2dfe638 100644 --- a/partedUtils.py +++ b/partedUtils.py @@ -571,6 +571,7 @@ def productMatches(oldproduct, newproduct): return 1 productUpgrades = { + "SME Server": ("Mitel Networks", "SME Server", "e-smith server", ), "Red Hat Enterprise Linux Server": ("Red Hat Enterprise Linux Client release 5", "Red Hat Enterprise Linux Server release 5"), "Red Hat Enterprise Linux Client": ("Red Hat Enterprise Linux Client release 5", diff --git a/textw/upgrade_text.py b/textw/upgrade_text.py index 61c5576..b87ffb2 100644 --- a/textw/upgrade_text.py +++ b/textw/upgrade_text.py @@ -20,8 +20,8 @@ from snack import * from fsset import * from flags import flags from constants import * -import upgradeclass -UpgradeClass = upgradeclass.InstallClass +import smeupgradeclass +UpgradeClass = smeupgradeclass.InstallClass from rhpl.translate import _ import rhpl @@ -200,26 +200,19 @@ class UpgradeExamineWindow: else: scroll = 0 partList = [] - partList.append(_("Reinstall System")) + partList.append(_("Erase ALL disks, and perform a fresh install")) for (drive, fs, desc, label) in parts: - if drive[:5] != "/dev/": - devname = "/dev/" + drive - else: - devname = drive - partList.append("%s (%s)" %(desc, drive)) + partList.append(_("Upgrade existing \"%s\" system") %(desc)) (button, choice) = ListboxChoiceWindow(screen, _("System to Upgrade"), - _("One or more existing Linux installations " - "have been found " - "on your system.\n\nPlease choose one to upgrade, " - "or select 'Reinstall System' to freshly install " - "your system."), partList, + _("Your system is upgradeable."), partList, [ TEXT_OK_BUTTON, TEXT_BACK_BUTTON ], width = 55, scroll = scroll, height = height, - help = "upgraderoot") + help = "upgraderoot", + default = 1) if button == TEXT_BACK_CHECK: return INSTALL_BACK diff --git a/upgrade.py b/upgrade.py index 5beb8a2..429a780 100644 --- a/upgrade.py +++ b/upgrade.py @@ -123,7 +123,7 @@ def findRootParts(anaconda): if anaconda.id.rootParts is not None and len(anaconda.id.rootParts) > 0: anaconda.dispatch.skipStep("findinstall", skip = 0) - if productName.find("Red Hat Enterprise Linux") == -1: + if productName.find("SME Server") == -1: anaconda.dispatch.skipStep("installtype", skip = 1) else: anaconda.dispatch.skipStep("findinstall", skip = 1) diff --git a/yuminstall.py b/yuminstall.py index 8505120..6f405fa 100644 --- a/yuminstall.py +++ b/yuminstall.py @@ -1675,10 +1675,10 @@ class YumBackend(AnacondaBackend): # Figure out current version for upgrade nag and for determining weird # upgrade cases supportedUpgradeVersion = -1 - for pkgtup in self.ayum.rpmdb.whatProvides('redhat-release', None, None): + for pkgtup in self.ayum.rpmdb.whatProvides('e-smith-release', None, None): n, a, e, v, r = pkgtup if supportedUpgradeVersion <= 0: - val = rpmUtils.miscutils.compareEVR((None, '3', '1'), + val = rpmUtils.miscutils.compareEVR(('26', '7.0', '01'), (e, v,r)) if val > 0: supportedUpgradeVersion = 0 @@ -1686,9 +1686,6 @@ class YumBackend(AnacondaBackend): supportedUpgradeVersion = 1 break - if productName.find("Red Hat Enterprise Linux") == -1: - supportedUpgradeVersion = 1 - if supportedUpgradeVersion == 0: rc = anaconda.intf.messageWindow(_("Warning"), _("You appear to be upgrading from a system " -- 1.7.1