[PATCH] Cleanup: remove dead upgrade code

Will Woods wwoods at redhat.com
Wed Apr 10 17:10:25 UTC 2013


We don't support upgrades anymore. Preupgrade is gone. These leftover
attributes are unused and the code is unreachable.

Scrub it all clean, even the comments. NO SURVIVORS.
---
 dracut/parse-kickstart             |  2 +-
 pyanaconda/__init__.py             |  2 --
 pyanaconda/errors.py               |  2 --
 pyanaconda/exception.py            |  2 +-
 pyanaconda/installclass.py         |  2 --
 pyanaconda/kickstart.py            |  6 ------
 pyanaconda/packaging/yumpayload.py | 19 ++++---------------
 pyanaconda/rescue.py               |  2 +-
 8 files changed, 7 insertions(+), 30 deletions(-)

diff --git a/dracut/parse-kickstart b/dracut/parse-kickstart
index 216635c..162daaa 100755
--- a/dracut/parse-kickstart
+++ b/dracut/parse-kickstart
@@ -140,7 +140,7 @@ class DisplayMode(commands.displaymode.FC3_DisplayMode):
         elif self.displayMode == DISPLAY_MODE_GRAPHICAL:
             return "inst.graphical"
 
-# TODO: keymap, lang... device? upgrade? selinux?
+# TODO: keymap, lang... device? selinux?
 
 dracutCmds = {
     'cdrom': Method,
diff --git a/pyanaconda/__init__.py b/pyanaconda/__init__.py
index ba4e3c5..d00caee 100644
--- a/pyanaconda/__init__.py
+++ b/pyanaconda/__init__.py
@@ -76,8 +76,6 @@ class Anaconda(object):
         self.stage2 = None
         self._storage = None
         self.updateSrc = None
-        self.upgrade = flags.cmdline.has_key("preupgrade")
-        self.upgradeRoot = None
         self.mehConfig = None
 
         # *sigh* we still need to be able to write this out
diff --git a/pyanaconda/errors.py b/pyanaconda/errors.py
index 815a930..18020a3 100644
--- a/pyanaconda/errors.py
+++ b/pyanaconda/errors.py
@@ -114,8 +114,6 @@ class ErrorHandler(object):
         return ERROR_RAISE
 
     def _dirtyFSHandler(self, *args, **kwargs):
-        # FIXME: for rescue it must be possible to continue, but for upgrade
-        #        it must be fatal
         devs = kwargs.pop("devices")
         message = _("The following file systems for your Linux system were "
                     "not unmounted cleanly.  Would you like to mount them "
diff --git a/pyanaconda/exception.py b/pyanaconda/exception.py
index 1da8d00..a205365 100644
--- a/pyanaconda/exception.py
+++ b/pyanaconda/exception.py
@@ -156,7 +156,7 @@ def initExceptionHandling(anaconda):
     fileList = [ "/tmp/anaconda.log", "/tmp/packaging.log",
                  "/tmp/program.log", "/tmp/storage.log", "/tmp/ifcfg.log",
                  "/tmp/yum.log", ROOT_PATH + "/root/install.log",
-                 ROOT_PATH + "/root/upgrade.log", "/proc/cmdline" ]
+                 "/proc/cmdline" ]
     if flags.livecdInstall:
         fileList.extend(["/var/log/messages"])
     else:
diff --git a/pyanaconda/installclass.py b/pyanaconda/installclass.py
index 753de20..105b6f9 100644
--- a/pyanaconda/installclass.py
+++ b/pyanaconda/installclass.py
@@ -52,8 +52,6 @@ class BaseInstallClass(object):
     _descriptionFields = ()
     name = "base"
     pkgstext = ""
-    # default to showing the upgrade option
-    showUpgrade = True
     bootloaderTimeoutDefault = None
     bootloaderExtraArgs = []
     _l10n_domain = None
diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
index 0fd4020..c446f41 100644
--- a/pyanaconda/kickstart.py
+++ b/pyanaconda/kickstart.py
@@ -263,12 +263,6 @@ class Bootloader(commands.bootloader.F18_Bootloader):
         else:
             location = self.location
 
-        if self.upgrade and not flags.cmdline.has_key("preupgrade"):
-            raise KickstartValueError, formatErrorMsg(self.lineno, msg="Selected upgrade mode for bootloader but not doing an upgrade")
-
-        if self.upgrade and storage.bootloader.can_update:
-            storage.bootloader.update_only = True
-
         if not location:
             storage.bootloader.skip_bootloader = True
             return
diff --git a/pyanaconda/packaging/yumpayload.py b/pyanaconda/packaging/yumpayload.py
index 3209fe4..d8adde9 100644
--- a/pyanaconda/packaging/yumpayload.py
+++ b/pyanaconda/packaging/yumpayload.py
@@ -1336,8 +1336,6 @@ reposdir=%s
                 log.debug("success")
             elif self.data.packages.handleMissing == KS_MISSING_IGNORE:
                 log.debug("ignoring missing due to ks config")
-            elif self.data.upgrade.upgrade:
-                log.debug("ignoring unresolved deps on upgrade")
             else:
                 for msg in msgs:
                     log.warning(msg)
@@ -1413,14 +1411,11 @@ reposdir=%s
         # doPreInstall
         # create mountpoints for protected device mountpoints (?)
         # write static configs (storage, modprobe.d/anaconda.conf, network, keyboard)
-        #   on upgrade, just make sure /etc/mtab is a symlink to /proc/self/mounts
 
-        if not self.data.upgrade.upgrade:
-            # this adds nofsync, which speeds things up but carries a risk of
-            # rpmdb data loss if a crash occurs. that's why we only do it on
-            # initial install and not for upgrades.
-            rpm.addMacro("__dbi_htconfig",
-                         "hash nofsync %{__dbi_other} %{__dbi_perms}")
+        # nofsync speeds things up at the risk of rpmdb data loss in a crash.
+        # But if we crash mid-install you're boned anyway, so who cares?
+        rpm.addMacro("__dbi_htconfig",
+                     "hash nofsync %{__dbi_other} %{__dbi_perms}")
 
         if self.data.packages.excludeDocs:
             rpm.addMacro("_excludedocs", "1")
@@ -1580,12 +1575,6 @@ reposdir=%s
                 if repo.name == BASE_REPO_NAME or repo.id.startswith("anaconda-"):
                     shutil.rmtree(repo.cachedir)
 
-            # clean the yum cache on upgrade
-            if self.data.upgrade.upgrade:
-                self._yum.cleanMetadata()
-
-        # TODO: on preupgrade, remove the preupgrade dir
-
         self._removeTxSaveFile()
 
         self.writeMultiLibConfig()
diff --git a/pyanaconda/rescue.py b/pyanaconda/rescue.py
index cf3db7d..ad8da43 100644
--- a/pyanaconda/rescue.py
+++ b/pyanaconda/rescue.py
@@ -267,7 +267,7 @@ def doRescue(intf, rescue_mount, ksdata):
 
     if not roots:
         root = None
-    elif len(roots) == 1 or ksdata.upgrade.upgrade:
+    elif len(roots) == 1:
         root = roots[0]
     else:
         height = min (len (roots), 12)
-- 
1.8.1.4



More information about the anaconda-patches mailing list