[PATCH] remove unneeded rpm relics

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You can apply this patch instead of the one that adds rpm-stub.py.
-- 
Matt Wilson
rPath, Inc.
msw@xxxxxxxxx
Index: anaconda
===================================================================
RCS file: /usr/local/CVS/anaconda/anaconda,v
retrieving revision 1.407
diff -u -r1.407 anaconda
--- anaconda	6 Mar 2006 19:45:27 -0000	1.407
+++ anaconda	7 Mar 2006 02:58:36 -0000
@@ -348,6 +348,7 @@
 except ImportError:
     pass
 
+from constants import *
 # Set up logging as early as possible.
 import logging
 from anaconda_log import logger
@@ -771,10 +772,11 @@
     import cmdline
     from encodings import utf_8, idna, ascii, punycode
     import email.Utils
-    import yuminstall
-    import yum.sqlitesack
-    import yum.sqlitecache
-    import sqlite
+    if BACKEND_YUM:
+        import yuminstall
+        import yum.sqlitesack
+        import yum.sqlitecache
+        import sqlite
 
     installclass.availableClasses()
 
@@ -1113,8 +1115,15 @@
 	log.critical (_("unknown install method: %s"), method)
 	sys.exit(1)
 
-from yuminstall import YumBackend 
-backend = YumBackend(methodobj, rootPath)
+if BACKEND_YUM:
+    from yuminstall import YumBackend
+    BackendClass = YumBackend
+elif BACKEND_CONARY:
+    import backend
+    # FIXME: stub until conaryinstall.AnacondaBackend is implemented
+    BackendClass = backend.AnacondaBackend
+backend = BackendClass(methodobj, rootPath)
+
 floppyDevice = floppy.probeFloppyDevice()
 
 # create device nodes for detected devices if we're not running in test mode
Index: constants.py
===================================================================
RCS file: /usr/local/CVS/anaconda/constants.py,v
retrieving revision 1.28
diff -u -r1.28 constants.py
--- constants.py	6 Oct 2005 00:22:51 -0000	1.28
+++ constants.py	7 Mar 2006 02:58:36 -0000
@@ -16,6 +16,8 @@
 from rhpl.translate import _, N_
 
 BETANAG = 1
+BACKEND_YUM = 0
+BACKEND_CONARY = 1
 
 DEBUG = 0
 
Index: dispatch.py
===================================================================
RCS file: /usr/local/CVS/anaconda/dispatch.py,v
retrieving revision 1.158
diff -u -r1.158 dispatch.py
--- dispatch.py	4 Mar 2006 15:57:34 -0000	1.158
+++ dispatch.py	7 Mar 2006 02:58:36 -0000
@@ -25,10 +25,8 @@
 from autopart import doAutoPartition
 from packages import firstbootConfiguration
 from packages import betaNagScreen
-from packages import selectLanguageSupportGroups
 from packages import setupTimezone
 from packages import setFileCons
-from packages import fixupConditionals
 from partitioning import partitionObjectsInitialize
 from partitioning import partitioningComplete
 from bootloader import writeBootloader, bootloaderSetupChoices
@@ -105,8 +103,6 @@
     ("tasksel", ("intf", "backend", "dispatch", "id.instClass")),   
     ("group-selection", ("backend", "intf")),
     ("postselection", doPostSelection, ("backend", "intf", "id", "instPath", "dir")),
-    #("selectlangpackages", selectLanguageSupportGroups, ("id.grpset","id.instLanguage")),    
-    #("fixupconditionals", fixupConditionals, ("id.grpset",)),
     ("confirminstall", ("intf", "id",)),
     ("confirmupgrade", ("intf", "id",)),
     ("install", ("dir", "intf", "id")),
Index: exception.py
===================================================================
RCS file: /usr/local/CVS/anaconda/exception.py,v
retrieving revision 1.60
diff -u -r1.60 exception.py
--- exception.py	23 Feb 2006 20:11:33 -0000	1.60
+++ exception.py	7 Mar 2006 02:58:36 -0000
@@ -21,7 +21,6 @@
 import traceback
 import iutil
 import types
-import rpm
 import bdb
 from string import joinfields
 from cPickle import Pickler
@@ -169,7 +168,7 @@
         pkgList.sort()
         for pkg in pkgList:
             p = dispatch.id.grpset.hdrlist.pkgs[pkg]
-            out.write("%s: %s, " % (p[rpm.RPMTAG_NAME],
+            out.write("%s: %s, " % (p['name'],
                                     p.isSelected()))
         out.write("\n")
 
Index: floppy.py
===================================================================
RCS file: /usr/local/CVS/anaconda/floppy.py,v
retrieving revision 1.29
diff -u -r1.29 floppy.py
--- floppy.py	11 Oct 2005 21:29:41 -0000	1.29
+++ floppy.py	7 Mar 2006 02:58:36 -0000
@@ -18,7 +18,6 @@
 import iutil
 import re
 import os, stat
-import rpm
 import kudzu
 from constants import *
 from flags import flags
Index: gui.py
===================================================================
RCS file: /usr/local/CVS/anaconda/gui.py,v
retrieving revision 1.451
diff -u -r1.451 gui.py
--- gui.py	14 Feb 2006 19:23:59 -0000	1.451
+++ gui.py	7 Mar 2006 02:58:37 -0000
@@ -34,7 +34,6 @@
 import gtk.glade
 import gobject
 import htmlbuffer
-import rpm
 import kudzu
 import gettext
 import warnings
@@ -49,7 +48,9 @@
 import logging
 log = logging.getLogger("anaconda")
 
-rpm.addMacro("_i18ndomains", "redhat-dist")
+if BACKEND_YUM:
+    import rpm
+    rpm.addMacro("_i18ndomains", "redhat-dist")
 isys.bind_textdomain_codeset("redhat-dist", "UTF-8")
 
 StayOnScreen = "stayOnScreen"
Index: language.py
===================================================================
RCS file: /usr/local/CVS/anaconda/language.py,v
retrieving revision 1.64
diff -u -r1.64 language.py
--- language.py	1 Mar 2006 03:09:35 -0000	1.64
+++ language.py	7 Mar 2006 02:58:37 -0000
@@ -16,7 +16,6 @@
 import os
 import string
 import locale
-import rpm
 
 from rhpl.translate import cat
 from rhpl.simpleconfig import SimpleConfigFile
Index: packages.py
===================================================================
RCS file: /usr/local/CVS/anaconda/packages.py,v
retrieving revision 1.308
diff -u -r1.308 packages.py
--- packages.py	3 Feb 2006 20:45:04 -0000	1.308
+++ packages.py	7 Mar 2006 02:58:37 -0000
@@ -18,7 +18,6 @@
 
 import iutil
 import isys
-import rpm
 import os
 import timer
 import time
@@ -193,195 +192,6 @@
     except RuntimeError:
         log.error("Failed to set clock")
 
-def doPostInstall(method, id, intf, instPath):
-    if flags.test:
-	return
-
-    w = intf.progressWindow(_("Post Install"),
-                            _("Performing post install configuration..."), 6)
-
-    upgrade = id.getUpgrade()
-    arch = iutil.getArch ()
-
-    if upgrade:
-	logname = '/root/upgrade.log'
-    else:
-	logname = '/root/install.log'
-
-    instLogName = instPath + logname
-    instLog = open(instLogName, "a")
-    
-    try:
-	if not upgrade:
-	    w.set(1)
-
-	    copyExtraModules(instPath, id.grpset, id.extraModules)
-
-	    w.set(2)
-
-            # we need to write out the network bits before kudzu runs
-            # to avoid getting devices in the wrong order (#102276)
-            id.network.write(instPath)
-		       
-	    w.set(3)
-
-	    # blah.  If we're on a serial mouse, and we have X, we need to
-	    # close the mouse device, then run kudzu, then open it again.
-
-	    # turn it off
-	    mousedev = None
-
-	    # XXX currently Bad Things (X async reply) happen when doing
-	    # Mouse Magic on Sparc (Mach64, specificly)
-	    # The s390 doesn't even have a mouse!
-            if os.environ.get('DISPLAY') == ':1' and arch != 'sparc':
-		try:
-                    import xmouse
-		    mousedev = xmouse.get()[0]
-		except RuntimeError:
-		    pass
-
-	    if mousedev:
-		try:
-		    os.rename (mousedev, "/dev/disablemouse")
-		except OSError:
-		    pass
-		try:
-		    xmouse.reopen()
-		except RuntimeError:
-		    pass
-
-	    if arch != "s390" and flags.setupFilesystems:
-		# we need to unmount usbdevfs before mounting it
-		usbWasMounted = iutil.isUSBDevFSMounted()
-		if usbWasMounted:
-                    isys.umount('/proc/bus/usb', removeDir = 0)
-
-		    # see if unmount suceeded, if not pretent it isnt mounted
-		    # because we're screwed anywyas if system is going to
-		    # lock up
-		    if iutil.isUSBDevFSMounted():
-			usbWasMounted = 0
-		    
-                unmountUSB = 0
-                try:
-                    isys.mount('/usbfs', instPath+'/proc/bus/usb', 'usbfs')
-                    unmountUSB = 1
-                except:
-                    log.error("Mount of /proc/bus/usb in chroot failed")
-                    pass
-
-                argv = [ "/usr/sbin/kudzu", "-q" ]
-                if id.grpset.hdrlist.has_key("kernel"):
-                    ver = "%s-%s" %(id.grpset.hdrlist["kernel"][rpm.RPMTAG_VERSION],
-                                    id.grpset.hdrlist["kernel"][rpm.RPMTAG_RELEASE])
-                    argv.extend(["-k", ver])
-                
-                devnull = os.open("/dev/null", os.O_RDWR)
-                iutil.execWithRedirect(argv[0], argv, root = instPath,
-                                       stdout = devnull)
-                # turn it back on            
-                if mousedev:
-                    try:
-                        os.rename ("/dev/disablemouse", mousedev)
-                    except OSError:
-                        pass
-                    try:
-                        xmouse.reopen()
-                    except RuntimeError:
-                        pass
-
-                if unmountUSB:
-                    try:
-                        isys.umount(instPath + '/proc/bus/usb', removeDir = 0)
-                    except SystemError:
-                        # if we fail to unmount, then we should just not
-                        # try to remount it.  this protects us from random
-                        # suckage
-                        usbWasMounted = 0
-
-		if usbWasMounted:
-                    isys.mount('/usbfs', '/proc/bus/usb', 'usbfs')
-
-	w.set(4)
-
-        if upgrade and id.dbpath is not None:
-            # remove the old rpmdb
-	    try:
-		iutil.rmrf (id.dbpath)
-	    except OSError:
-		pass
-
-        if upgrade:
-	    # needed for prior systems which were not xinetd based
-	    migrateXinetd(instPath, instLogName)
-
-            # needed for prior to 2.6 so that mice have some chance
-            # of working afterwards. FIXME: this is a hack
-            migrateMouseConfig(instPath, instLogName)
-
-        #if id.grpset.hdrlist.has_key("rhgb") and id.grpset.hdrlist["rhgb"].isSelected():
-        #    log.info("rhgb installed, adding to boot loader config")
-        #   id.bootloader.args.append("rhgb quiet")
-
-        w.set(5)
-
-        w.set(6)
-
-
-    finally:
-	pass
-
-    if upgrade:
-        instLog.write(_("\n\nThe following packages were available in "
-                        "this version but NOT upgraded:\n"))
-    else:
-        instLog.write(_("\n\nThe following packages were available in "
-                        "this version but NOT installed:\n"))
-        
-    # XXX hack - we should really write a proper lvm "config".  but for now
-    # just vgscan if they have /sbin/lvm and some appearance of volumes
-    if (os.access(instPath + "/sbin/lvm", os.X_OK) and
-        os.access(instPath + "/dev/mapper", os.X_OK) and
-        len(os.listdir("/dev/mapper")) > 1):
-        rc = iutil.execWithRedirect("/sbin/lvm",
-                                    ["lvm", "vgscan", "-v"],
-                                    stdout = "/dev/tty5",
-                                    stderr = "/dev/tty5",
-                                    root = instPath,
-                                    searchPath = 1)
-
-    # write out info on install method used
-    try:
-	if id.methodstr is not None:
-	    if os.access (instPath + "/etc/sysconfig/installinfo", os.R_OK):
-		os.rename (instPath + "/etc/sysconfig/installinfo",
-			   instPath + "/etc/sysconfig/installinfo.rpmsave")
-
-	    f = open(instPath + "/etc/sysconfig/installinfo", "w+")
-	    f.write("INSTALLMETHOD=%s\n" % (string.split(id.methodstr, ':')[0],))
-
-	    try:
-		ii = open("/tmp/isoinfo", "r")
-		il = ii.readlines()
-		ii.close()
-		for line in il:
-		    f.write(line)
-	    except:
-		pass
-	    f.close()
-	else:
-	    log.warning("methodstr not set for some reason")
-    except:
-	log.error("Failed to write out installinfo")
-        
-    w.pop ()
-
-    sys.stdout.flush()
-    
-    if flags.setupFilesystems:
-	syslog.stop()
-
 # FIXME: this is a huge gross hack.  hard coded list of files
 # created by anaconda so that we can not be killed by selinux
 def setFileCons(instPath, partitions):
@@ -462,74 +272,6 @@
     iutil.execWithRedirect(argv[0], argv, root = instPath,
 			   stdout = logfile, stderr = logfile)
     os.close(logfile)
-
-def copyExtraModules(instPath, grpset, extraModules):
-    kernelVersions = grpset.kernelVersionList()
-    foundModule = 0
-
-    try:
-        f = open("/etc/arch")
-        arch = f.readline().strip()
-        del f
-    except IOError:
-        arch = os.uname()[2]
-
-    for (path, name) in extraModules:
-        if not path:
-            path = "/modules.cgz"
-	pattern = ""
-	names = ""
-	for (n, tag) in kernelVersions:
-            if tag == "up":
-                pkg = "kernel"
-            else:
-                pkg = "kernel-%s" %(tag,)
-            arch = grpset.hdrlist[pkg][rpm.RPMTAG_ARCH]
-            # version 1 path
-            pattern = pattern + " %s/%s/%s.ko " % (n, arch, name)
-            # version 0 path
-            pattern = pattern + " %s/%s.ko " % (n, name)
-            names = names + " %s.ko" % (name,)
-	command = ("cd %s/lib/modules; gunzip < %s | "
-                   "%s/bin/cpio --quiet -iumd %s" % 
-                   (instPath, path, instPath, pattern))
-	log.info("running: '%s'" % (command, ))
-	os.system(command)
-
-	for (n, tag) in kernelVersions:
-            if tag == "up":
-                pkg = "kernel"
-            else:
-                pkg = "kernel-%s" %(tag,)
-            
-	    toDir = "%s/lib/modules/%s/updates" % \
-		    (instPath, n)
-	    to = "%s/%s.ko" % (toDir, name)
-
-            if (os.path.isdir("%s/lib/modules/%s" %(instPath, n)) and not
-                os.path.isdir("%s/lib/modules/%s/updates" %(instPath, n))):
-                os.mkdir("%s/lib/modules/%s/updates" %(instPath, n))
-            if not os.path.isdir(toDir):
-                continue
-
-            arch = grpset.hdrlist[pkg][rpm.RPMTAG_ARCH]
-            for p in ("%s/%s.ko" %(arch, name), "%s.ko" %(name,)):
-                fromFile = "%s/lib/modules/%s/%s" % (instPath, n, p)
-
-                if (os.access(fromFile, os.R_OK)):
-                    log.info("moving %s to %s" % (fromFile, to))
-                    os.rename(fromFile, to)
-                    # the file might not have been owned by root in the cgz
-                    os.chown(to, 0, 0)
-                    foundModule = 1
-                else:
-                    log.warning("missing DD module %s (this may be okay)" % 
-                        fromFile)
-
-    if foundModule == 1:
-        for (n, tag) in kernelVersions:
-            recreateInitrd(n, instPath)
-
 
 #Recreate initrd for use when driver disks add modules
 def recreateInitrd (kernelTag, instRoot):
Index: upgrade.py
===================================================================
RCS file: /usr/local/CVS/anaconda/upgrade.py,v
retrieving revision 1.157
diff -u -r1.157 upgrade.py
--- upgrade.py	22 Feb 2006 21:27:13 -0000	1.157
+++ upgrade.py	7 Mar 2006 02:58:37 -0000
@@ -17,7 +17,6 @@
 import os
 import iutil
 import time
-import rpm
 import sys
 import os.path
 import partedUtils

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux