diff options
author | Matt Wilson <msw@redhat.com> | 2001-06-22 20:38:45 +0000 |
---|---|---|
committer | Matt Wilson <msw@redhat.com> | 2001-06-22 20:38:45 +0000 |
commit | b43b22451556077cf160799598e72b787e02af6c (patch) | |
tree | 4c52035f0edddf2d32704674bf4649cabf45ce6a | |
parent | 64b0587de521d01512eeca0fa42c67aac666f68b (diff) | |
download | anaconda-b43b22451556077cf160799598e72b787e02af6c.tar.gz anaconda-b43b22451556077cf160799598e72b787e02af6c.tar.xz anaconda-b43b22451556077cf160799598e72b787e02af6c.zip |
1) more fixups for upgrades: fix step list to actually run the transaction,
set the upgrade flag in id when we get picked
2) removed self from migrateXinetd
3) moved GUI splash screen to its own file - this should make it pop up
even faster.
4) copyright notices in anaconda, splashscreen.py
5) reworked the dep checker to build a new ts every time we make a pass.
RPM doesn't seem to like to have a package in the ts as available *and*
upgrade/install.
6) fixed fstab reading for 'none' devices
7) removed a debugging print from xf86config.py
8) removed threadding import from progress_gui.py
-rwxr-xr-x | anaconda | 28 | ||||
-rw-r--r-- | comps.py | 41 | ||||
-rw-r--r-- | fsset.py | 14 | ||||
-rwxr-xr-x | gui.py | 56 | ||||
-rw-r--r-- | installclasses/upgradeclass.py | 7 | ||||
-rw-r--r-- | iw/progress_gui.py | 1 | ||||
-rw-r--r-- | packages.py | 2 | ||||
-rw-r--r-- | splashscreen.py | 71 | ||||
-rw-r--r-- | upgrade.py | 3 | ||||
-rw-r--r-- | upgradeclass.py | 7 | ||||
-rw-r--r-- | xf86config.py | 1 |
11 files changed, 150 insertions, 81 deletions
@@ -1,4 +1,28 @@ #!/usr/bin/python +# +# anaconda: The Red Hat Linux Installation program +# +# (in alphabetical order...) +# +# Brent Fox <bfox@redhat.com> +# Mike Fulbright <msf@redhat.com> +# Jeremy Katz <katzj@redhat.com> +# Erik Troan <ewt@redhat.com> +# Matt Wilson <msw@redhat.com> +# +# ... And a many others +# +# Copyright 2001 Red Hat, Inc. +# +# This software may be freely redistributed under the terms of the GNU +# library public license. +# +# You should have received a copy of the GNU Library Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# + +# This toplevel file is a little messy at the moment... import sys, os @@ -391,8 +415,8 @@ if (display_mode == 'g'): pass # display splash screen - from gui import display_splash_screen - display_splash_screen() + from splashscreen import splashScreenShow + splashScreenShow() if nofallback: from gui import InstallInterface @@ -590,25 +590,35 @@ class ComponentSet: return self.verifiedState = None - - if upgrade: + + if upgrade: db = rpm.opendb (0, instPath) - ts = rpm.TransactionSet(instPath, db) - how = 'u' - else: + how = 'u' + else: + db = None ts = rpm.TransactionSet() - db = None - how = 'i' - - for p in self.packages.packages.values (): - if p.selected: - ts.add(p.h, (p.h, p.h[rpm.RPMTAG_NAME]), how) - else: - ts.add(p.h, (p.h, p.h[rpm.RPMTAG_NAME]), "a") + how = 'i' checkDeps = 1 rc = [] + extras = {} while checkDeps: + if upgrade: + ts = rpm.TransactionSet(instPath, db) + how = 'u' + else: + ts = rpm.TransactionSet() + how = 'i' + + for p in self.packages.values(): + if p.selected: + ts.add(p.h, (p.h, p.h[rpm.RPMTAG_NAME]), how) + else: + if extras.has_key(p.h): + ts.add(p.h, (p.h, p.h[rpm.RPMTAG_NAME]), how) + else: + ts.add(p.h, (p.h, p.h[rpm.RPMTAG_NAME]), "a") + deps = ts.depcheck() checkDeps = 0 @@ -624,8 +634,7 @@ class ComponentSet: log ("depcheck: package %s needs %s (provided by %s)", name, formatRequire(reqname, reqversion, flags), sugname) - - ts.add(header, (header, header[rpm.RPMTAG_NAME]), how) + extras[header] = None checkDeps = 1 else: log ("depcheck: package %s needs %s (not provided)", @@ -659,7 +668,7 @@ class ComponentSet: if self.packages.packages.has_key (reqname): self.packages.packages[reqname].selected = 0 log ("... removed") - + del ts if db: del db @@ -847,6 +847,7 @@ class LoopbackDevice(Device): def getComment (self): return "# LOOP1: %s %s /redhat.img\n" % (self.host, self.hostfs) +# XXX fix RAID def readFstab (path): fsset = FileSystemSet() @@ -894,13 +895,18 @@ def readFstab (path): # all valid fstab entries have 6 fields if len (fields) < 4 or len (fields) > 6: continue + # if we don't support mounting the filesystem, continue if not fileSystemTypes.has_key(fields[2]): continue if string.find(fields[3], "noauto") != -1: continue fsystem = fileSystemTypeGet(fields[2]) label = None - if len(fields) >= 6 and fields[0][:6] == "LABEL=": + + + if fields[0] == "none": + device = Device() + elif len(fields) >= 6 and fields[0][:6] == "LABEL=": label = fields[0][6:] if labelToDevice.has_key(label): device = PartitionDevice(labelToDevice[label]) @@ -926,9 +932,11 @@ def readFstab (path): if loopIndex.has_key(device): (dev, fs) = loopIndex[device] device = LoopbackDevice(dev, fs) - else: + elif fields[0][:5] == "/dev/": device = PartitionDevice(fields[0][5:]) - + else: + continue + entry = FileSystemSetEntry(device, fields[1], fsystem, fields[3]) if label: entry.setLabel(label) @@ -4,7 +4,6 @@ os.environ["GNOME_DISABLE_CRASH_DIALOG"] = "1" # msw says this is a good idea os.environ["LC_ALL"] = "C" from gtk import * -from gtk import _root_window from _gtk import gtk_set_locale from _gtk import gtk_rc_init from _gtk import gtk_rc_reparse_all @@ -12,6 +11,7 @@ from _gtk import _gtk_nuke_rc_files from _gtk import _gtk_nuke_rc_mtimes import GDK import GdkImlib +from splashscreen import splashScreenPop import time import iutil @@ -70,52 +70,6 @@ import sys import rpm # setup globals -root = _root_window () -cursor = cursor_new (GDK.LEFT_PTR) -root.set_cursor (cursor) - -splashwindow = None - -def display_splash_screen(): - def load_image(file): - try: - im = GdkImlib.Image("/usr/share/anaconda/pixmaps/" + file) - except: - try: - im = GdkImlib.Image("pixmaps/" + file) - except: - print "Unable to load", file - - return im - - global splashwindow - - width = screen_width() - im = None - - # If the xserver is running at 800x600 res or higher, use the - # 800x600 splash screen. - if width >= 800: - im = load_image('first.png') - else: - im = load_image('first-lowres.png') - - if im: - im.render () - splashwindow = GtkWindow () - splashwindow.set_position (WIN_POS_CENTER) - box = GtkEventBox () - pix = im.make_pixmap () - style = box.get_style ().copy () - style.bg[STATE_NORMAL] = style.white - box.set_style (style) - box.add (pix) - splashwindow.add (box) - box.show_all() - splashwindow.show_now() - gdk_flush () - while events_pending (): - mainiteration (FALSE) def processEvents(): gdk_flush() @@ -634,9 +588,6 @@ class InstallControlWindow: self.window.set_default_size (800, 600) self.window.set_usize (800, 600) - cursor = cursor_new (GDK.LEFT_PTR) - _root_window ().set_cursor (cursor) - self.window.set_border_width (10) title = _("Red Hat Linux Installer") @@ -758,9 +709,8 @@ class InstallControlWindow: # Popup the ICW and wait for it to wake us back up self.window.show_all () - global splashwindow - if splashwindow: - splashwindow.destroy () + + splashScreenPop() def run (self, runres): self.setup_window (runres) diff --git a/installclasses/upgradeclass.py b/installclasses/upgradeclass.py index 4d758f46c..8788d4684 100644 --- a/installclasses/upgradeclass.py +++ b/installclasses/upgradeclass.py @@ -31,8 +31,9 @@ class InstallClass(BaseInstallClass): "checkdeps", "dependencies", "monitor", - "confirminstall", + "confirmupgrade", "install", + "installpackages", "instbootloader", "bootdisk", "complete" @@ -40,6 +41,10 @@ class InstallClass(BaseInstallClass): if iutil.getArch() == "alpha" or iutil.getArch() == "ia64": dispatch.skipStep("bootdisk") + + def setInstallData(self, id): + BaseInstallClass.__init__(self, id) + id.upgrade.set(1) def __init__(self, expert): BaseInstallClass.__init__(self, expert) diff --git a/iw/progress_gui.py b/iw/progress_gui.py index de3e9b99e..7fa786894 100644 --- a/iw/progress_gui.py +++ b/iw/progress_gui.py @@ -4,7 +4,6 @@ import string import rpm import os import gui -from threading import * from translate import _, N_ import sys from packages import doInstall diff --git a/packages.py b/packages.py index 15efeccb1..87ddf4f47 100644 --- a/packages.py +++ b/packages.py @@ -734,7 +734,7 @@ def doInstall(method, id, intf, instPath): sys.stdout.flush() -def migrateXinetd(self, instPath, instLog): +def migrateXinetd(instPath, instLog): if not os.access (instPath + "/usr/sbin/inetdconvert", os.X_OK): log("did not find %s" % instPath + "/usr/sbin/inetdconvert") return diff --git a/splashscreen.py b/splashscreen.py new file mode 100644 index 000000000..f1deebbc0 --- /dev/null +++ b/splashscreen.py @@ -0,0 +1,71 @@ +# +# splashscreen.py: a quick splashscreen window that displays during ipl +# +# Matt Wilson <msw@redhat.com> +# +# Copyright 2001 Red Hat, Inc. +# +# This software may be freely redistributed under the terms of the GNU +# library public license. +# +# You should have received a copy of the GNU Library Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# + +from gtk import * +from gtk import _root_window +import GDK +import GdkImlib + +splashwindow = None + +def splashScreenShow(): + root = _root_window () + cursor = cursor_new (GDK.LEFT_PTR) + root.set_cursor (cursor) + + def load_image(file): + try: + im = GdkImlib.Image("/usr/share/anaconda/pixmaps/" + file) + except: + try: + im = GdkImlib.Image("pixmaps/" + file) + except: + print "Unable to load", file + + return im + + global splashwindow + + width = screen_width() + im = None + + # If the xserver is running at 800x600 res or higher, use the + # 800x600 splash screen. + if width >= 800: + im = load_image('first.png') + else: + im = load_image('first-lowres.png') + + if im: + im.render () + splashwindow = GtkWindow () + splashwindow.set_position (WIN_POS_CENTER) + box = GtkEventBox () + pix = im.make_pixmap () + style = box.get_style ().copy () + style.bg[STATE_NORMAL] = style.white + box.set_style (style) + box.add (pix) + splashwindow.add (box) + box.show_all() + splashwindow.show_now() + gdk_flush () + while events_pending (): + mainiteration (FALSE) + +def splashScreenPop(): + global splashwindow + if splashwindow: + splashwindow.destroy () diff --git a/upgrade.py b/upgrade.py index c2502b8ee..92617c74e 100644 --- a/upgrade.py +++ b/upgrade.py @@ -218,8 +218,7 @@ def upgradeFindPackages (intf, method, id, instPath): # and rebuild the database so we can run the dependency problem # sets against the on disk db - rebuildpath = "%s%s%s" % (instPath, "/var/lib/anaconda-rebuilddb", - rebuildTime) + rebuildpath = instPath + id.dbpath rc = rpm.rebuilddb (instPath) if rc: try: diff --git a/upgradeclass.py b/upgradeclass.py index 4d758f46c..8788d4684 100644 --- a/upgradeclass.py +++ b/upgradeclass.py @@ -31,8 +31,9 @@ class InstallClass(BaseInstallClass): "checkdeps", "dependencies", "monitor", - "confirminstall", + "confirmupgrade", "install", + "installpackages", "instbootloader", "bootdisk", "complete" @@ -40,6 +41,10 @@ class InstallClass(BaseInstallClass): if iutil.getArch() == "alpha" or iutil.getArch() == "ia64": dispatch.skipStep("bootdisk") + + def setInstallData(self, id): + BaseInstallClass.__init__(self, id) + id.upgrade.set(1) def __init__(self, expert): BaseInstallClass.__init__(self, expert) diff --git a/xf86config.py b/xf86config.py index 07545d638..514999536 100644 --- a/xf86config.py +++ b/xf86config.py @@ -961,7 +961,6 @@ class XF86Config: serverPath = "/usr/X11R6/bin/" + servername - print "forking" serverpid = os.fork() if (not serverpid): |