1 |
From d62cb125019caf52f2934f70ba4d0cf6251098fa Mon Sep 17 00:00:00 2001 |
2 |
From: Shad L. Lords <slords@mail.com> |
3 |
Date: Mon, 26 Oct 2009 18:21:45 -0600 |
4 |
Subject: [PATCH] Determine upgradability of SME server |
5 |
|
6 |
--- |
7 |
partedUtils.py | 1 + |
8 |
textw/upgrade_text.py | 21 +++++++-------------- |
9 |
upgrade.py | 13 +++++-------- |
10 |
3 files changed, 13 insertions(+), 22 deletions(-) |
11 |
|
12 |
diff --git a/partedUtils.py b/partedUtils.py |
13 |
index 388998a..2ed81f2 100644 |
14 |
--- a/partedUtils.py |
15 |
+++ b/partedUtils.py |
16 |
@@ -516,6 +516,7 @@ def productMatches(oldproduct, newproduct): |
17 |
return 1 |
18 |
|
19 |
productUpgrades = { |
20 |
+ "SME Server": ("Mitel Networks", "SME Server", "e-smith server", ), |
21 |
"Red Hat Enterprise Linux AS": ("Red Hat Linux Advanced Server", ), |
22 |
"Red Hat Enterprise Linux WS": ("Red Hat Linux Advanced Workstation",), |
23 |
# FIXME: this probably shouldn't be in a release... |
24 |
diff --git a/textw/upgrade_text.py b/textw/upgrade_text.py |
25 |
index 217e514..48ff783 100644 |
26 |
--- a/textw/upgrade_text.py |
27 |
+++ b/textw/upgrade_text.py |
28 |
@@ -20,8 +20,8 @@ from snack import * |
29 |
from fsset import * |
30 |
from flags import flags |
31 |
from constants import * |
32 |
-import upgradeclass |
33 |
-UpgradeClass = upgradeclass.InstallClass |
34 |
+import smeupgradeclass |
35 |
+UpgradeClass = smeupgradeclass.InstallClass |
36 |
|
37 |
from rhpl.log import log |
38 |
from rhpl.translate import _ |
39 |
@@ -196,26 +196,19 @@ class UpgradeExamineWindow: |
40 |
else: |
41 |
scroll = 0 |
42 |
partList = [] |
43 |
- partList.append(_("Reinstall System")) |
44 |
+ partList.append(_("Erase ALL disks, and perform a fresh install")) |
45 |
|
46 |
for (drive, fs, desc) in parts: |
47 |
- if drive[:5] != "/dev/": |
48 |
- devname = "/dev/" + drive |
49 |
- else: |
50 |
- devname = drive |
51 |
- partList.append("%s (%s)" %(desc, drive)) |
52 |
+ partList.append(_("Upgrade existing \"%s\" system") %(desc)) |
53 |
|
54 |
(button, choice) = ListboxChoiceWindow(screen, _("System to Upgrade"), |
55 |
- _("One or more existing Linux installations " |
56 |
- "have been found " |
57 |
- "on your system.\n\nPlease choose one to upgrade, " |
58 |
- "or select 'Reinstall System' to freshly install " |
59 |
- "your system."), partList, |
60 |
+ _("Your system is upgradeable."), partList, |
61 |
[ TEXT_OK_BUTTON, |
62 |
TEXT_BACK_BUTTON ], |
63 |
width = 55, scroll = scroll, |
64 |
height = height, |
65 |
- help = "upgraderoot") |
66 |
+ help = "upgraderoot", |
67 |
+ default = 1) |
68 |
|
69 |
if button == TEXT_BACK_CHECK: |
70 |
return INSTALL_BACK |
71 |
diff --git a/upgrade.py b/upgrade.py |
72 |
index 02c714e..2c9b887 100644 |
73 |
--- a/upgrade.py |
74 |
+++ b/upgrade.py |
75 |
@@ -60,7 +60,7 @@ def findRootParts(intf, id, dispatch, dir, chroot): |
76 |
|
77 |
if id.rootParts is not None and len(id.rootParts) > 0: |
78 |
dispatch.skipStep("findinstall", skip = 0) |
79 |
- if productName.find("Red Hat Enterprise Linux") == -1: |
80 |
+ if productName.find("SME Server") == -1: |
81 |
dispatch.skipStep("installtype", skip = 1) |
82 |
else: |
83 |
dispatch.skipStep("findinstall", skip = 1) |
84 |
@@ -513,10 +513,10 @@ def upgradeFindPackages(intf, method, id, instPath, dir): |
85 |
pass |
86 |
sys.exit(0) |
87 |
|
88 |
- if not os.access(instPath + "/etc/redhat-release", os.R_OK): |
89 |
+ if not os.access(instPath + "/etc/e-smith-release", os.R_OK): |
90 |
rc = intf.messageWindow(_("Warning"), |
91 |
_("This system does not have an " |
92 |
- "/etc/redhat-release file. It is possible " |
93 |
+ "/etc/e-smith-release file. It is possible " |
94 |
"that this is not a %s system. " |
95 |
"Continuing with the upgrade process may " |
96 |
"leave the system in an unusable state. Do " |
97 |
@@ -533,7 +533,7 @@ def upgradeFindPackages(intf, method, id, instPath, dir): |
98 |
# Figure out current version for upgrade nag and for determining weird |
99 |
# upgrade cases |
100 |
supportedUpgradeVersion = -1 |
101 |
- mi = ts.dbMatch('provides', 'redhat-release') |
102 |
+ mi = ts.dbMatch('provides', 'e-smith-release') |
103 |
for h in mi: |
104 |
if h[rpm.RPMTAG_EPOCH] is None: |
105 |
epoch = None |
106 |
@@ -541,7 +541,7 @@ def upgradeFindPackages(intf, method, id, instPath, dir): |
107 |
epoch = str(h[rpm.RPMTAG_EPOCH]) |
108 |
|
109 |
if supportedUpgradeVersion <= 0: |
110 |
- val = rpm.labelCompare((None, '3', '1'), |
111 |
+ val = rpm.labelCompare(('21', '6.0', '11'), |
112 |
(epoch, h[rpm.RPMTAG_VERSION], |
113 |
h[rpm.RPMTAG_RELEASE])) |
114 |
if val > 0: |
115 |
@@ -550,9 +550,6 @@ def upgradeFindPackages(intf, method, id, instPath, dir): |
116 |
supportedUpgradeVersion = 1 |
117 |
break |
118 |
|
119 |
- if productName.find("Red Hat Enterprise Linux") == -1: |
120 |
- supportedUpgradeVersion = 1 |
121 |
- |
122 |
if supportedUpgradeVersion == 0: |
123 |
rc = intf.messageWindow(_("Warning"), |
124 |
_("You appear to be upgrading from a system " |
125 |
-- |
126 |
1.5.5.6 |
127 |
|