From d62cb125019caf52f2934f70ba4d0cf6251098fa Mon Sep 17 00:00:00 2001 From: Shad L. Lords Date: Mon, 26 Oct 2009 18:21:45 -0600 Subject: [PATCH] Determine upgradability of SME server --- partedUtils.py | 1 + textw/upgrade_text.py | 21 +++++++-------------- upgrade.py | 13 +++++-------- 3 files changed, 13 insertions(+), 22 deletions(-) diff --git a/partedUtils.py b/partedUtils.py index 388998a..2ed81f2 100644 --- a/partedUtils.py +++ b/partedUtils.py @@ -516,6 +516,7 @@ def productMatches(oldproduct, newproduct): return 1 productUpgrades = { + "SME Server": ("Mitel Networks", "SME Server", "e-smith server", ), "Red Hat Enterprise Linux AS": ("Red Hat Linux Advanced Server", ), "Red Hat Enterprise Linux WS": ("Red Hat Linux Advanced Workstation",), # FIXME: this probably shouldn't be in a release... diff --git a/textw/upgrade_text.py b/textw/upgrade_text.py index 217e514..48ff783 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.log import log from rhpl.translate import _ @@ -196,26 +196,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) 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 02c714e..2c9b887 100644 --- a/upgrade.py +++ b/upgrade.py @@ -60,7 +60,7 @@ def findRootParts(intf, id, dispatch, dir, chroot): if id.rootParts is not None and len(id.rootParts) > 0: dispatch.skipStep("findinstall", skip = 0) - if productName.find("Red Hat Enterprise Linux") == -1: + if productName.find("SME Server") == -1: dispatch.skipStep("installtype", skip = 1) else: dispatch.skipStep("findinstall", skip = 1) @@ -513,10 +513,10 @@ def upgradeFindPackages(intf, method, id, instPath, dir): pass sys.exit(0) - if not os.access(instPath + "/etc/redhat-release", os.R_OK): + if not os.access(instPath + "/etc/e-smith-release", os.R_OK): rc = intf.messageWindow(_("Warning"), _("This system does not have an " - "/etc/redhat-release file. It is possible " + "/etc/e-smith-release file. It is possible " "that this is not a %s system. " "Continuing with the upgrade process may " "leave the system in an unusable state. Do " @@ -533,7 +533,7 @@ def upgradeFindPackages(intf, method, id, instPath, dir): # Figure out current version for upgrade nag and for determining weird # upgrade cases supportedUpgradeVersion = -1 - mi = ts.dbMatch('provides', 'redhat-release') + mi = ts.dbMatch('provides', 'e-smith-release') for h in mi: if h[rpm.RPMTAG_EPOCH] is None: epoch = None @@ -541,7 +541,7 @@ def upgradeFindPackages(intf, method, id, instPath, dir): epoch = str(h[rpm.RPMTAG_EPOCH]) if supportedUpgradeVersion <= 0: - val = rpm.labelCompare((None, '3', '1'), + val = rpm.labelCompare(('21', '6.0', '11'), (epoch, h[rpm.RPMTAG_VERSION], h[rpm.RPMTAG_RELEASE])) if val > 0: @@ -550,9 +550,6 @@ def upgradeFindPackages(intf, method, id, instPath, dir): supportedUpgradeVersion = 1 break - if productName.find("Red Hat Enterprise Linux") == -1: - supportedUpgradeVersion = 1 - if supportedUpgradeVersion == 0: rc = intf.messageWindow(_("Warning"), _("You appear to be upgrading from a system " -- 1.5.5.6