summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2009-06-01 14:26:27 -0400
committerChris Lumens <clumens@redhat.com>2009-06-01 14:26:27 -0400
commit86fb9ed2ad5f846b7f490940bca5528ae397c643 (patch)
tree201b3751865a18795657dfd048a044308ea61190
parent2aa6d8f67c6bb9a08948e6d520011900e8d1de61 (diff)
downloadanaconda-86fb9ed2ad5f846b7f490940bca5528ae397c643.tar.gz
anaconda-86fb9ed2ad5f846b7f490940bca5528ae397c643.tar.xz
anaconda-86fb9ed2ad5f846b7f490940bca5528ae397c643.zip
We no longer write out /etc/rpm/platform, so don't offer to upgrade it.
-rw-r--r--dispatch.py3
-rw-r--r--flags.py1
-rw-r--r--iutil.py8
-rw-r--r--livecd.py2
-rw-r--r--packages.py2
-rw-r--r--upgrade.py68
-rw-r--r--yuminstall.py4
7 files changed, 7 insertions, 81 deletions
diff --git a/dispatch.py b/dispatch.py
index d6fbcce2a..7dd2c5409 100644
--- a/dispatch.py
+++ b/dispatch.py
@@ -37,7 +37,7 @@ from storage import storageComplete
from storage.partitioning import doAutoPartition
from bootloader import writeBootloader, bootloaderSetupChoices
from flags import flags
-from upgrade import upgradeMountFilesystems, queryUpgradeArch
+from upgrade import upgradeMountFilesystems
from upgrade import upgradeSwapSuggestion, upgradeMigrateFind
from upgrade import findRootParts, queryUpgradeContinue
from installmethod import doMethodComplete
@@ -83,7 +83,6 @@ installSteps = [
("autopartitionexecute", doAutoPartition, ),
("partition", ),
("upgrademount", upgradeMountFilesystems, ),
- ("upgradearchitecture", queryUpgradeArch, ),
("upgradecontinue", queryUpgradeContinue, ),
("upgradeswapsuggestion", upgradeSwapSuggestion, ),
("addswap", ),
diff --git a/flags.py b/flags.py
index d49b2528a..ce77621eb 100644
--- a/flags.py
+++ b/flags.py
@@ -83,7 +83,6 @@ 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
diff --git a/iutil.py b/iutil.py
index 7be68963e..ba1d0b4df 100644
--- a/iutil.py
+++ b/iutil.py
@@ -560,14 +560,14 @@ def isEfi():
return efi
-## Generate the /etc/rpm/platform and /etc/rpm/macros files.
+## Generate the /etc/rpm/macros file.
# @param root The root of the filesystem to create the files in.
def writeRpmPlatform(root="/"):
import rhpl.arch
if flags.test:
return
- if not flags.updateRpmPlatform and os.access("%s/etc/rpm/platform" %(root,), os.R_OK):
+ if 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,))
@@ -581,10 +581,6 @@ def writeRpmPlatform(root="/"):
# now make the current install believe it, too
rhpl.arch.canonArch = myarch
-# f = open("%s/etc/rpm/platform" %(root,), 'w+')
-# f.write("%s-redhat-linux\n" %(myarch,))
-# f.close()
-
# FIXME: writing /etc/rpm/macros feels wrong somehow
# temporary workaround for #92285
if not (myarch.startswith("ppc64") or
diff --git a/livecd.py b/livecd.py
index 6c559a2ce..b186d0089 100644
--- a/livecd.py
+++ b/livecd.py
@@ -348,7 +348,7 @@ class LiveCDCopyBackend(backend.AnacondaBackend):
def doPostInstall(self, anaconda):
self._doFilesystemMangling(anaconda)
- # setup /etc/rpm/platform for the post-install environment
+ # setup /etc/rpm/ for the post-install environment
iutil.writeRpmPlatform(anaconda.rootPath)
# maybe heavy handed, but it'll do
diff --git a/packages.py b/packages.py
index f59cd7b09..ba2f9e309 100644
--- a/packages.py
+++ b/packages.py
@@ -247,7 +247,7 @@ def setFileCons(anaconda):
if flags.selinux:
log.info("setting SELinux contexts for anaconda created files")
- files = ["/etc/rpm/platform", "/etc/rpm/macros",
+ files = ["/etc/rpm/macros",
"/etc/lilo.conf.anaconda", "/lib64", "/usr/lib64",
"/etc/blkid.tab", "/etc/blkid.tab.old",
"/etc/mtab", "/etc/fstab", "/etc/resolv.conf",
diff --git a/upgrade.py b/upgrade.py
index cb9c07fc2..d5ecdd081 100644
--- a/upgrade.py
+++ b/upgrade.py
@@ -46,73 +46,6 @@ import rpm
import logging
log = logging.getLogger("anaconda")
-def guessGuestArch(rootdir):
- """root path -> None|"architecture"
- Guess the architecture of installed system
- """
- iutil.resetRpmDb(rootdir)
- ts = rpm.ts(rootdir)
-
- packages = ["filesystem", "initscripts"]
-
- #get information from packages
- for pkg in packages:
- try:
- mi=ts.dbMatch("name",pkg)
- for hdr in mi:
- return hdr["arch"]
- except:
- pass
-
- return None
-
-
-def isUpgradingArch(anaconda):
- """anaconda -> (bool, oldarch)
- Check if the upgrade should change architecture of installation"""
-
- def compareArch(a, b):
- import re
- if re.match("i.86", a) and re.match("i.86", b):
- return True
- else:
- return a == b
-
- try:
- rpmplatform = open(anaconda.rootPath+"/etc/rpm/platform").readline().strip()
- rpmarch = rpmplatform[:rpmplatform.index("-")]
- return compareArch(rhpl.arch.canonArch, rpmarch), rpmarch
- except IOError:
- #try some fallback methods
- rpmarch = guessGuestArch(anaconda.rootPath)
- if rpmarch:
- return compareArch(rhpl.arch.canonArch, rpmarch), rpmarch
- else:
- return False, "unknown"
-
-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
@@ -337,7 +270,6 @@ def setSteps(anaconda):
"upgrademount",
"upgrademigfind",
"upgrademigratefs",
- "upgradearchitecture",
"enablefilesystems",
"upgradecontinue",
"reposetup",
diff --git a/yuminstall.py b/yuminstall.py
index 0e7a4da85..e7f1d915d 100644
--- a/yuminstall.py
+++ b/yuminstall.py
@@ -1427,9 +1427,9 @@ reposdir=/etc/anaconda.repos.d,/tmp/updates/anaconda.repos.d,/tmp/product/anacon
self.initLog(anaconda.id, anaconda.rootPath)
if flags.setupFilesystems:
- # setup /etc/rpm/platform for the post-install environment
+ # setup /etc/rpm/ for the post-install environment
iutil.writeRpmPlatform(anaconda.rootPath)
-
+
try:
# FIXME: making the /var/lib/rpm symlink here is a hack to
# workaround db->close() errors from rpm