1 |
From 7e51d9199e21c699e0f25cbacf68cc431f08c2ef Mon Sep 17 00:00:00 2001 |
2 |
From: Shad L. Lords <slords@mail.com> |
3 |
Date: Mon, 19 Oct 2009 08:43:46 -0600 |
4 |
Subject: [PATCH] Determine upgradability of SME server |
5 |
|
6 |
--- |
7 |
partedUtils.py | 1 + |
8 |
textw/upgrade_text.py | 21 +++++++-------------- |
9 |
upgrade.py | 2 +- |
10 |
yuminstall.py | 7 ++----- |
11 |
4 files changed, 11 insertions(+), 20 deletions(-) |
12 |
|
13 |
diff --git a/partedUtils.py b/partedUtils.py |
14 |
index 2a2d034..2dfe638 100644 |
15 |
--- a/partedUtils.py |
16 |
+++ b/partedUtils.py |
17 |
@@ -571,6 +571,7 @@ def productMatches(oldproduct, newproduct): |
18 |
return 1 |
19 |
|
20 |
productUpgrades = { |
21 |
+ "SME Server": ("Mitel Networks", "SME Server", "e-smith server", ), |
22 |
"Red Hat Enterprise Linux Server": ("Red Hat Enterprise Linux Client release 5", |
23 |
"Red Hat Enterprise Linux Server release 5"), |
24 |
"Red Hat Enterprise Linux Client": ("Red Hat Enterprise Linux Client release 5", |
25 |
diff --git a/textw/upgrade_text.py b/textw/upgrade_text.py |
26 |
index 61c5576..b87ffb2 100644 |
27 |
--- a/textw/upgrade_text.py |
28 |
+++ b/textw/upgrade_text.py |
29 |
@@ -20,8 +20,8 @@ from snack import * |
30 |
from fsset import * |
31 |
from flags import flags |
32 |
from constants import * |
33 |
-import upgradeclass |
34 |
-UpgradeClass = upgradeclass.InstallClass |
35 |
+import smeupgradeclass |
36 |
+UpgradeClass = smeupgradeclass.InstallClass |
37 |
|
38 |
from rhpl.translate import _ |
39 |
import rhpl |
40 |
@@ -200,26 +200,19 @@ class UpgradeExamineWindow: |
41 |
else: |
42 |
scroll = 0 |
43 |
partList = [] |
44 |
- partList.append(_("Reinstall System")) |
45 |
+ partList.append(_("Erase ALL disks, and perform a fresh install")) |
46 |
|
47 |
for (drive, fs, desc, label) in parts: |
48 |
- if drive[:5] != "/dev/": |
49 |
- devname = "/dev/" + drive |
50 |
- else: |
51 |
- devname = drive |
52 |
- partList.append("%s (%s)" %(desc, drive)) |
53 |
+ partList.append(_("Upgrade existing \"%s\" system") %(desc)) |
54 |
|
55 |
(button, choice) = ListboxChoiceWindow(screen, _("System to Upgrade"), |
56 |
- _("One or more existing Linux installations " |
57 |
- "have been found " |
58 |
- "on your system.\n\nPlease choose one to upgrade, " |
59 |
- "or select 'Reinstall System' to freshly install " |
60 |
- "your system."), partList, |
61 |
+ _("Your system is upgradeable."), partList, |
62 |
[ TEXT_OK_BUTTON, |
63 |
TEXT_BACK_BUTTON ], |
64 |
width = 55, scroll = scroll, |
65 |
height = height, |
66 |
- help = "upgraderoot") |
67 |
+ help = "upgraderoot", |
68 |
+ default = 1) |
69 |
|
70 |
if button == TEXT_BACK_CHECK: |
71 |
return INSTALL_BACK |
72 |
diff --git a/upgrade.py b/upgrade.py |
73 |
index 5beb8a2..429a780 100644 |
74 |
--- a/upgrade.py |
75 |
+++ b/upgrade.py |
76 |
@@ -123,7 +123,7 @@ def findRootParts(anaconda): |
77 |
|
78 |
if anaconda.id.rootParts is not None and len(anaconda.id.rootParts) > 0: |
79 |
anaconda.dispatch.skipStep("findinstall", skip = 0) |
80 |
- if productName.find("Red Hat Enterprise Linux") == -1: |
81 |
+ if productName.find("SME Server") == -1: |
82 |
anaconda.dispatch.skipStep("installtype", skip = 1) |
83 |
else: |
84 |
anaconda.dispatch.skipStep("findinstall", skip = 1) |
85 |
diff --git a/yuminstall.py b/yuminstall.py |
86 |
index 95cdbee..92e0aff 100644 |
87 |
--- a/yuminstall.py |
88 |
+++ b/yuminstall.py |
89 |
@@ -1650,10 +1650,10 @@ class YumBackend(AnacondaBackend): |
90 |
# Figure out current version for upgrade nag and for determining weird |
91 |
# upgrade cases |
92 |
supportedUpgradeVersion = -1 |
93 |
- for pkgtup in self.ayum.rpmdb.whatProvides('redhat-release', None, None): |
94 |
+ for pkgtup in self.ayum.rpmdb.whatProvides('e-smith-release', None, None): |
95 |
n, a, e, v, r = pkgtup |
96 |
if supportedUpgradeVersion <= 0: |
97 |
- val = rpmUtils.miscutils.compareEVR((None, '3', '1'), |
98 |
+ val = rpmUtils.miscutils.compareEVR(('26', '7.0', '01'), |
99 |
(e, v,r)) |
100 |
if val > 0: |
101 |
supportedUpgradeVersion = 0 |
102 |
@@ -1661,9 +1661,6 @@ class YumBackend(AnacondaBackend): |
103 |
supportedUpgradeVersion = 1 |
104 |
break |
105 |
|
106 |
- if productName.find("Red Hat Enterprise Linux") == -1: |
107 |
- supportedUpgradeVersion = 1 |
108 |
- |
109 |
if supportedUpgradeVersion == 0: |
110 |
rc = anaconda.intf.messageWindow(_("Warning"), |
111 |
_("You appear to be upgrading from a system " |
112 |
-- |
113 |
1.5.5.6 |
114 |
|