diff options
author | msivak <msivak> | 2007-10-26 08:51:25 +0000 |
---|---|---|
committer | msivak <msivak> | 2007-10-26 08:51:25 +0000 |
commit | e8f54cd09cd4ee9eb0322db38054ef0663006091 (patch) | |
tree | 93c4402bf93836c6ea8c3e9a9c37c710f9127b7c | |
parent | be4afb2c00dfc1813ce75b360ee8ae8d470eb892 (diff) | |
download | anaconda-e8f54cd09cd4ee9eb0322db38054ef0663006091.tar.gz anaconda-e8f54cd09cd4ee9eb0322db38054ef0663006091.tar.xz anaconda-e8f54cd09cd4ee9eb0322db38054ef0663006091.zip |
Inform user about the arch mismatch and offer to upgrade rpm platform
Bug #217132
2007-10-26 Martin Sivak <msivak@redhat.com>
* backend.py (doRepoSetup): Update the platform file if necessary
* dispatch.py: Add new step for detecting platform upgrade
* flags.py (Flags): Add flag for controlling the rpm platform update
* iutil.py (writeRpmPlatform): Now controlled by the updateRpmPlatform
flag
* upgrade.py: Add isUpgradingArch, queryUpgradeArch and add the
upgradearchitecture step (#217132)
-rw-r--r-- | ChangeLog | 14 | ||||
-rw-r--r-- | backend.py | 1 | ||||
-rw-r--r-- | dispatch.py | 3 | ||||
-rw-r--r-- | flags.py | 1 | ||||
-rw-r--r-- | iutil.py | 2 | ||||
-rw-r--r-- | upgrade.py | 34 |
6 files changed, 53 insertions, 2 deletions
@@ -1,5 +1,19 @@ 2007-10-26 Martin Sivak <msivak@redhat.com> + * backend.py (doRepoSetup): Update the platform file if necessary + + * dispatch.py: Add new step for detecting platform upgrade + + * flags.py (Flags): Add flag for controlling the rpm platform update + + * iutil.py (writeRpmPlatform): Now controlled by the updateRpmPlatform + flag + + * upgrade.py: Add isUpgradingArch, queryUpgradeArch and add the + upgradearchitecture step (#217132) + +2007-10-26 Martin Sivak <msivak@redhat.com> + * partedUtils.py (DiskSet): Do not ask for partition table init when in rescue mode (#331131) diff --git a/backend.py b/backend.py index 1335f4067..9ec560b20 100644 --- a/backend.py +++ b/backend.py @@ -184,6 +184,7 @@ def doRepoSetup(anaconda): return DISPATCH_BACK if anaconda.id.upgrade: anaconda.backend.checkSupportedUpgrade(anaconda) + iutil.writeRpmPlatform(anaconda.rootPath) def doPostSelection(anaconda): return anaconda.backend.doPostSelection(anaconda) diff --git a/dispatch.py b/dispatch.py index de3ebe9ef..3fe8a614f 100644 --- a/dispatch.py +++ b/dispatch.py @@ -32,7 +32,7 @@ from partitioning import partitionObjectsInitialize from partitioning import partitioningComplete from bootloader import writeBootloader, bootloaderSetupChoices from flags import flags -from upgrade import upgradeMountFilesystems +from upgrade import upgradeMountFilesystems, queryUpgradeArch from upgrade import upgradeSwapSuggestion, upgradeMigrateFind from upgrade import findRootParts, queryUpgradeContinue from network import networkDeviceCheck @@ -73,6 +73,7 @@ installSteps = [ ("autopartitionexecute", doAutoPartition, ), ("partition", ), ("upgrademount", upgradeMountFilesystems, ), + ("upgradearchitecture", queryUpgradeArch, ), ("upgradecontinue", queryUpgradeContinue, ), ("upgradeswapsuggestion", upgradeSwapSuggestion, ), ("addswap", ), @@ -71,6 +71,7 @@ class Flags: self.__dict__['flags']['selinux'] = SELINUX_DEFAULT self.__dict__['flags']['debug'] = 0 self.__dict__['flags']['targetarch'] = None + self.__dict__['flags']['updateRpmPlatform'] = False self.__dict__['flags']['cmdline'] = self.createCmdlineDict() self.__dict__['flags']['useIPv4'] = True self.__dict__['flags']['useIPv6'] = True @@ -496,7 +496,7 @@ def writeRpmPlatform(root="/"): if flags.test: return - if os.access("%s/etc/rpm/platform" %(root,), os.R_OK): + if not flags.updateRpmPlatform and os.access("%s/etc/rpm/platform" %(root,), os.R_OK): return if not os.access("%s/etc/rpm" %(root,), os.X_OK): os.mkdir("%s/etc/rpm" %(root,)) diff --git a/upgrade.py b/upgrade.py index ff71bec12..f35a9e0c3 100644 --- a/upgrade.py +++ b/upgrade.py @@ -52,6 +52,39 @@ if rhpl.getArch() == "ppc": if rhpl.getArch() == "x86_64": upgrade_remove_blacklist.extend( [("perl","i386")] ) +def isUpgradingArch(anaconda): + """anaconda -> (bool, oldarch) + Check if the upgrade should change architecture of instalation""" + + rpmplatform = open(anaconda.rootPath+"/etc/rpm/platform").readline().strip() + rpmarch = rpmplatform[:rpmplatform.index("-")] + + return rhpl.arch.canonArch!=rpmarch, rpmarch + + +def queryUpgradeArch(anaconda): + archupgrade, oldrpmarch = isUpgradingArch(anaconda) #Check if we are to upgrade the architecture of previous product + + if anaconda.dir == DISPATCH_FORWARD or not archupgrade: + return DISPATCH_FORWARD + + rc = anaconda.intf.messageWindow(_("Proceed with upgrade?"), + _("You have choosen the upgrade for %s " + "architecture, but the installed system " + "is for %s architecture. " + "\n\n" % (rhpl.arch.canonArch, oldrpmarch,)) + + _("Would you like to upgrade " + " the installed system to the %s architecture?" % (rhpl.arch.canonArch,)), + type="custom", custom_icon=["error","error"], + custom_buttons=[_("_Exit installer"), _("_Continue")]) + + if rc == 0: + sys.exit(0) + + flags.updateRpmPlatform = True + + return DISPATCH_FORWARD + def queryUpgradeContinue(anaconda): if anaconda.dir == DISPATCH_FORWARD: return @@ -389,6 +422,7 @@ def setSteps(anaconda): "upgrademount", "upgrademigfind", "upgrademigratefs", + "upgradearchitecture", "upgradecontinue", "reposetup", "upgbootloader", |