summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2005-04-26 21:39:09 +0000
committerJeremy Katz <katzj@redhat.com>2005-04-26 21:39:09 +0000
commita45d8e95bb23c4549935adf2885746f32abe4ba5 (patch)
treedc848d0c074c2cc13c34b895912c3a21294e7d56
parentd7ef40382dfd9c6dfcf6bf45aac9b721a935e0bf (diff)
downloadanaconda-a45d8e95bb23c4549935adf2885746f32abe4ba5.tar.gz
anaconda-a45d8e95bb23c4549935adf2885746f32abe4ba5.tar.xz
anaconda-a45d8e95bb23c4549935adf2885746f32abe4ba5.zip
2005-04-26 Jeremy Katz <katzj@redhat.com>
* image.py (CdromInstallMethod.getRPMFilename): Beep if we need to insert a new CD (#109264) * harddrive.py (HardDriveInstallMethod.__init__): Do method parsing here instead of in anaconda. Pass intf down. * image.py (ImageInstallMethod.__init__): Likewise. * image.py (CdromImageInstallMethod.__init__): Likewise. * image.py (NfsInstallMethod.__init__): Likewise. * image.py (NfsISOInstallMethod.__init__): Likewise. * installmethod.py (InstallMethod.__init__): Likewise. * urlinstall.py (UrlInstallMethod.__init__): Likewise. * anaconda: Make method __init__'s all basically act the same
-rw-r--r--ChangeLog14
-rwxr-xr-xanaconda36
-rw-r--r--harddrive.py14
-rw-r--r--image.py24
-rw-r--r--installmethod.py4
-rw-r--r--urlinstall.py6
6 files changed, 46 insertions, 52 deletions
diff --git a/ChangeLog b/ChangeLog
index 9f64e7708..83608ab98 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
2005-04-26 Jeremy Katz <katzj@redhat.com>
+ * image.py (CdromInstallMethod.getRPMFilename): Beep if we need to
+ insert a new CD (#109264)
+
+ * harddrive.py (HardDriveInstallMethod.__init__): Do method
+ parsing here instead of in anaconda. Pass intf down.
+ * image.py (ImageInstallMethod.__init__): Likewise.
+ * image.py (CdromImageInstallMethod.__init__): Likewise.
+ * image.py (NfsInstallMethod.__init__): Likewise.
+ * image.py (NfsISOInstallMethod.__init__): Likewise.
+ * installmethod.py (InstallMethod.__init__): Likewise.
+ * urlinstall.py (UrlInstallMethod.__init__): Likewise.
+
+ * anaconda: Make method __init__'s all basically act the same
+
* hdrlist.py (EverythingExclude): Add kernel-smp-devel and
kernel-hugemem-devel to the exclude too
diff --git a/anaconda b/anaconda
index 39743e9e6..73c999948 100755
--- a/anaconda
+++ b/anaconda
@@ -1019,45 +1019,19 @@ intf = InstallInterface ()
if method:
if method.startswith('cdrom://'):
from image import CdromInstallMethod
- methodobj = CdromInstallMethod(method[8:], intf.messageWindow,
- intf.progressWindow, rootPath)
+ methodobj = CdromInstallMethod(method[8:], rootPath, intf)
elif method.startswith('nfs:/'):
from image import NfsInstallMethod
- methodobj = NfsInstallMethod(method[5:], rootPath)
+ methodobj = NfsInstallMethod(method[5:], rootPath, intf)
elif method.startswith('nfsiso:/'):
from image import NfsIsoInstallMethod
- methodobj = NfsIsoInstallMethod(method[8:], intf.messageWindow, rootPath)
+ methodobj = NfsIsoInstallMethod(method[8:], rootPath, intf)
elif method.startswith('ftp://') or method.startswith('http://'):
from urlinstall import UrlInstallMethod
- methodobj = UrlInstallMethod(method, rootPath)
- methodobj.setIntf(intf)
+ methodobj = UrlInstallMethod(method, rootPath, intf)
elif method.startswith('hd://'):
- tmpmethod = method[5:]
-
- i = string.index(tmpmethod, ":")
- drive = tmpmethod[0:i]
- tmpmethod = tmpmethod[i+1:]
-
- i = string.index(tmpmethod, "/")
- type = tmpmethod[0:i]
- dir = tmpmethod[i+1:]
-
from harddrive import HardDriveInstallMethod
- methodobj = HardDriveInstallMethod(drive, type, dir, intf.messageWindow,
- rootPath)
- elif method.startswith('oldhd://'):
- tmpmethod = method[8:]
-
- i = string.index(tmpmethod, ":")
- drive = tmpmethod[0:i]
- tmpmethod = tmpmethod[i+1:]
-
- i = string.index(tmpmethod, "/")
- type = tmpmethod[0:i]
- dir = tmpmethod[i+1:]
-
- from harddrive import OldHardDriveInstallMethod
- methodobj = OldHardDriveInstallMethod(drive, type, dir, rootPath)
+ methodobj = HardDriveInstallMethod(method[5:], rootPath, intf)
else:
print "unknown install method:", method
sys.exit(1)
diff --git a/harddrive.py b/harddrive.py
index dfa020d8e..4f344a989 100644
--- a/harddrive.py
+++ b/harddrive.py
@@ -194,15 +194,21 @@ class HardDriveInstallMethod(InstallMethod):
def protectedPartitions(self):
return [self.device]
- def __init__(self, device, type, path, messageWindow, rootPath):
- InstallMethod.__init__(self, rootPath)
+ def __init__(self, method, rootPath, intf):
+ InstallMethod.__init__(self, method, rootPath, intf)
+
+ device = method[0:method.index(":")]
+ tmpmethod = method[method.index(":") + 1:]
+ fstype = tmpmethod[0:tmpmethod.index("/")]
+ path = tmpmethod[tmpmethod.index("/") + 1:]
+
self.device = device
self.path = path
- self.fstype = type
+ self.fstype = fstype
self.fnames = {}
self.isoDirIsMounted = 0
self.mediaIsMounted = 0
- self.messageWindow = messageWindow
+ self.messageWindow = intf.messageWindow
# Go ahead and poke through the directory looking for interesting
# iso images
diff --git a/image.py b/image.py
index 798c01563..0117f51b6 100644
--- a/image.py
+++ b/image.py
@@ -135,8 +135,8 @@ class ImageInstallMethod(InstallMethod):
return path
- def __init__(self, tree, rootPath):
- InstallMethod.__init__(self, rootPath)
+ def __init__(self, tree, rootPath, intf):
+ InstallMethod.__init__(self, tree, rootPath, intf)
self.tree = tree
self.currentIso = None
@@ -283,6 +283,8 @@ class CdromInstallMethod(ImageInstallMethod):
self.messageWindow(_("Change CDROM"),
_("Please insert %s disc %d to continue.") % (productName,
needed))
+ if self.intf is not None:
+ self.intf.beep()
try:
if isys.mount(self.device, "/mnt/source",
@@ -379,12 +381,12 @@ class CdromInstallMethod(ImageInstallMethod):
pass
- def __init__(self, url, messageWindow, progressWindow, rootPath):
+ def __init__(self, url, rootPath, intf):
(self.device, tree) = string.split(url, ":", 1)
if not tree.startswith("/"):
tree = "/%s" %(tree,)
- self.messageWindow = messageWindow
- self.progressWindow = progressWindow
+ self.messageWindow = intf.messageWindow
+ self.progressWindow = intf.progressWindow
self.loopbackFile = None
# figure out which disc is in. if we fail for any reason,
@@ -403,12 +405,12 @@ class CdromInstallMethod(ImageInstallMethod):
else:
self.currentDisc = [ 1 ]
- ImageInstallMethod.__init__(self, tree, rootPath)
+ ImageInstallMethod.__init__(self, tree, rootPath, intf)
class NfsInstallMethod(ImageInstallMethod):
- def __init__(self, tree, rootPath):
- ImageInstallMethod.__init__(self, tree, rootPath)
+ def __init__(self, tree, rootPath, intf):
+ ImageInstallMethod.__init__(self, tree, rootPath, intf)
def getDiscNums(line):
# get the disc numbers for this disc
@@ -567,8 +569,8 @@ class NfsIsoInstallMethod(NfsInstallMethod):
log("unable to unmount image in filesDone: %s" %(e,))
pass
- def __init__(self, tree, messageWindow, rootPath):
- self.messageWindow = messageWindow
+ def __init__(self, tree, rootPath, intf):
+ self.messageWindow = intf.messageWindow
self.imageMounted = None
self.isoPath = tree
@@ -580,5 +582,5 @@ class NfsIsoInstallMethod(NfsInstallMethod):
self.discImages = findIsoImages(tree, messageWindow)
self.mountImage(1)
- ImageInstallMethod.__init__(self, self.mntPoint, rootPath)
+ ImageInstallMethod.__init__(self, self.mntPoint, rootPath, intf)
diff --git a/installmethod.py b/installmethod.py
index 5b923e3d9..92e6e29f4 100644
--- a/installmethod.py
+++ b/installmethod.py
@@ -102,9 +102,9 @@ class InstallMethod:
def unlinkFilename(self, fullName):
pass
- def __init__(self, rootpath):
+ def __init__(self, method, rootpath, intf):
self.rootPath = rootpath
- pass
+ self.intf = intf
def getSourcePath(self):
pass
diff --git a/urlinstall.py b/urlinstall.py
index 1366e21ad..07dd02e7b 100644
--- a/urlinstall.py
+++ b/urlinstall.py
@@ -202,8 +202,8 @@ class UrlInstallMethod(InstallMethod):
def setIntf(self, intf):
self.intf = intf
- def __init__(self, url, rootPath):
- InstallMethod.__init__(self, rootPath)
+ def __init__(self, url, rootPath, intf):
+ InstallMethod.__init__(self, url, rootPath, intf)
if url.startswith("ftp"):
isFtp = 1
@@ -238,6 +238,4 @@ class UrlInstallMethod(InstallMethod):
else:
self.multiDiscs = 0
self.pkgUrl = self.baseUrl
-
- self.intf = None