summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dispatch.py8
-rw-r--r--fsset.py24
-rwxr-xr-xgui.py1
-rw-r--r--instdata.py1
-rw-r--r--packages.py4
-rw-r--r--text.py5
-rw-r--r--textw/partitioning_text.py2
-rw-r--r--upgrade.py7
-rw-r--r--users.py4
-rw-r--r--videocard.py2
-rw-r--r--xserver.py4
11 files changed, 29 insertions, 33 deletions
diff --git a/dispatch.py b/dispatch.py
index 858edb2fe..98129c1bc 100644
--- a/dispatch.py
+++ b/dispatch.py
@@ -13,6 +13,10 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
+DISPATCH_BACK = -1
+DISPATCH_FORWARD = 1
+DISPATCH_NOOP = None
+
import string
from types import *
from packages import readPackages, checkDependencies, doInstall
@@ -25,10 +29,6 @@ from bootloader import partitioningComplete, writeBootloader
from flags import flags
from upgrade import upgradeFindPackages
-DISPATCH_BACK = -1
-DISPATCH_FORWARD = 1
-DISPATCH_NOOP = None
-
# These are all of the install steps, in order. Note that upgrade and
# install steps are the same thing! Upgrades skip install steps, while
# installs skip upgrade steps.
diff --git a/fsset.py b/fsset.py
index a81205738..467907fc1 100644
--- a/fsset.py
+++ b/fsset.py
@@ -18,9 +18,10 @@ import isys
import iutil
import os
import parted
+import sys
+import struct
from log import log
from translate import _, N_
-import sys
defaultMountPoints = ('/', '/boot', '/home', '/tmp', '/usr', '/var')
@@ -217,6 +218,7 @@ class extFileSystem(FileSystemType):
self.checked = 1
self.linuxnativefs = 1
self.maxSize = 4 * 1024 * 1024
+ self.extraFormatArgs = []
def formatDevice(self, entry, progress, chroot='/'):
devicePath = entry.device.setupDevice(chroot)
@@ -238,7 +240,6 @@ class ext2FileSystem(extFileSystem):
def __init__(self):
extFileSystem.__init__(self)
self.name = "ext2"
- self.extraFormatArgs = []
fileSystemTypeRegister(ext2FileSystem())
@@ -306,6 +307,8 @@ class swapFileSystem(FileSystemType):
[ "mkswap", '-v1', file ],
stdout = None, stderr = None,
searchPath = 1)
+ if rc:
+ raise SystemError
fileSystemTypeRegister(swapFileSystem())
@@ -352,6 +355,12 @@ class DevptsFileSystem(PsudoFileSystem):
fileSystemTypeRegister(DevptsFileSystem())
+class AutoFileSystem(PsudoFileSystem):
+ def __init__(self):
+ PsudoFileSystem.__init__(self, "auto")
+
+fileSystemTypeRegister(AutoFileSystem())
+
class FileSystemSet:
def __init__(self):
self.messageWindow = None
@@ -495,11 +504,6 @@ class FileSystemSet:
% (entry.device.getDevice(), msg))
sys.exit(0)
- def turnOffSwap(self, devices = 1, files = 0):
- for entry in self.entries:
- if entry.fsystem and entry.fsystem.getName() == "swap":
- entry.umount(chroot)
-
def formattablePartitions(self):
list = []
for entry in self.entries:
@@ -574,8 +578,8 @@ class FileSystemSet:
def hasDirtyFilesystems(self):
if self.rootOnLoop():
- (rootDev, rootFs) = self.getRootDevice()
- mountLoopbackRoot(rootDev, skipMount = 1)
+ entry = self.getEntryByMountPoint('/')
+ mountLoopbackRoot(entry.device.host, skipMount = 1)
dirty = isys.ext2IsDirty("loop1")
unmountLoopbackRoot(skipMount = 1)
if dirty: return 1
@@ -727,7 +731,7 @@ class RAIDDevice(Device):
self.minor = minor
def __del__ (self):
- RAIDDevice.usedMajors.remove(minor)
+ RAIDDevice.usedMajors.remove(self.minor)
def ext2Args (self):
if self.level == 5:
diff --git a/gui.py b/gui.py
index f7b85d991..bdd4ab36f 100755
--- a/gui.py
+++ b/gui.py
@@ -2,7 +2,6 @@
# gui.py - Graphical front end for anaconda
#
# Matt Wilson <msw@redhat.com>
-# Paul Fisher <rao@gnu.org>
#
# Copyright 2001 Red Hat, Inc.
#
diff --git a/instdata.py b/instdata.py
index d27eb338f..71e2e4fe5 100644
--- a/instdata.py
+++ b/instdata.py
@@ -24,7 +24,6 @@ import fsset
import partitioning
import bootloader
from simpleconfig import SimpleConfigFile
-from translate import _
class Boolean:
def set(self, val):
diff --git a/packages.py b/packages.py
index 4c63f5070..c81be2c7c 100644
--- a/packages.py
+++ b/packages.py
@@ -556,8 +556,8 @@ def doInstall(method, id, intf, instPath):
try:
if not upgrade:
# XXX should this go here?
- if self.fdDevice[0:2] == "fd":
- dev = fsset.PartitionDevice(self.fdDevice)
+ if id.floppyDevice[0:2] == "fd":
+ dev = fsset.PartitionDevice(id.floppyDevice)
fs = fsset.fileSystemTypeGet("auto")
entry = fsset.FileSystemSetEntry(dev, '/mnt/floppy', fs,
"nodefaults")
diff --git a/text.py b/text.py
index 1945d334f..b14bd057e 100644
--- a/text.py
+++ b/text.py
@@ -267,10 +267,6 @@ class InstallInterface:
def waitWindow(self, title, text):
return WaitWindow(self.screen, title, text)
- def packageProgressWindow(self, total, totalSize):
- self.screen.pushHelpLine (_(" "))
- return InstallProgressWindow(self.screen, total, totalSize)
-
def drawFrame(self):
self.welcomeText = _("Red Hat Linux (C) 2001 Red Hat, Inc.")
self.screen.drawRootText (0, 0, self.welcomeText)
@@ -331,6 +327,7 @@ class InstallInterface:
step = len(classNames) - 1
while step >= 0 and step < len(classNames):
+ nextWindow = None
s = "from %s import %s; nextWindow = %s" % \
(file, classNames[step], classNames[step])
exec s
diff --git a/textw/partitioning_text.py b/textw/partitioning_text.py
index b1f67465b..d3ddf749e 100644
--- a/textw/partitioning_text.py
+++ b/textw/partitioning_text.py
@@ -313,7 +313,7 @@ class LoopSizeWindow:
# add in size of loopback files if they exist
extra = 0
try:
- import os, stat
+ import stat
isys.mount(rootdev[0], "/mnt/space", fstype = rootdev[1])
extra = extra + os.stat("/mnt/space/redhat.img")[stat.ST_SIZE]
extra = extra + os.stat("/mnt/space/rh-swap.img")[stat.ST_SIZE]
diff --git a/upgrade.py b/upgrade.py
index 3b08d37e6..72e17074e 100644
--- a/upgrade.py
+++ b/upgrade.py
@@ -127,9 +127,8 @@ def swapSuggestion(instPath, fsset):
return (fsList, suggestion, suggMnt)
def swapfileExists(swapname):
-
try:
- rc = os.lstat(swapname)
+ os.lstat(swapname)
return 1
except:
return 0
@@ -138,7 +137,7 @@ def swapfileExists(swapname):
def createSwapFile(instPath, thefsset, mntPoint, size):
fstabPath = instPath + "/etc/fstab"
prefix = ""
- if theFstab.rootOnLoop():
+ if thefsset.rootOnLoop():
instPath = "/mnt/loophost"
prefix = "/initrd/loopfs"
@@ -147,7 +146,7 @@ def createSwapFile(instPath, thefsset, mntPoint, size):
else:
file = "/SWAP"
- existingSwaps = theFstab.swapList(files = 1)
+ existingSwaps = thefsset.swapList(files = 1)
swapFileDict = {}
for n in existingSwaps:
dev = n[0]
diff --git a/users.py b/users.py
index 6c109bcf8..3f84a4f59 100644
--- a/users.py
+++ b/users.py
@@ -91,7 +91,7 @@ class RootPassword(Password):
setPassword(instPath, "root", pure, auth.useMD5)
else:
setPassword(instPath, "root", self.getCrypted (),
- auth.useMD5, alreadyCrypted = 1)
+ auth.useMD5, alreadyCrypted = 1)
def writeKS(self, f):
f.write("rootpw --iscrypted %s\n" % self.getCrypted())
@@ -106,7 +106,7 @@ def cryptPassword(password, useMD5):
for i in range(saltLen):
salt = salt + whrandom.choice (string.letters +
- string.digits + './')
+ string.digits + './')
return crypt.crypt (password, salt)
diff --git a/videocard.py b/videocard.py
index 2aca94f84..0ca6c6106 100644
--- a/videocard.py
+++ b/videocard.py
@@ -35,7 +35,7 @@ def Video_cardsDBLookup(thecard):
count = count + 1
if count >= 16:
- raise RunTimeError, "Could not find card ",origcard
+ raise RuntimeError, "Could not find card %s" % (origcard,)
return card
diff --git a/xserver.py b/xserver.py
index 708539618..fc93cd1f4 100644
--- a/xserver.py
+++ b/xserver.py
@@ -23,7 +23,6 @@ import time
from xf86config import *
from kbd import Keyboard
from mouse import Mouse
-import time
from snack import *
from translate import _
from constants_text import *
@@ -154,11 +153,10 @@ def testx(x):
server = x.test ([':1', 'vt7', '-s', '1440', '-terminate'], spawn=1)
except:
import traceback
- from string import joinfields
server = None
(type, value, tb) = sys.exc_info()
list = traceback.format_exception (type, value, tb)
- text = joinfields (list, "")
+ text = string.joinfields (list, "")
print text
# give time for the server to fail (if it is going to fail...)