diff options
author | Jeremy Katz <katzj@redhat.com> | 2002-10-07 21:44:11 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2002-10-07 21:44:11 +0000 |
commit | a4aef484430a0fee4898f979ae4714e7650046c1 (patch) | |
tree | 3d7d005550a08411cc1ecd220ce142343de46495 /image.py | |
parent | 524682da3230745062f0b3e4356dcd5d254b95b8 (diff) | |
download | anaconda-a4aef484430a0fee4898f979ae4714e7650046c1.tar.gz anaconda-a4aef484430a0fee4898f979ae4714e7650046c1.tar.xz anaconda-a4aef484430a0fee4898f979ae4714e7650046c1.zip |
if we fail to read a package, then we could get into getFilename() without
a CD mounted so reading the .discinfo file can fail.
keep a copy of the first timestamp we can succeed in reading as
self.timestamp so that we have a timestamp to compare with when this happens
Diffstat (limited to 'image.py')
-rw-r--r-- | image.py | 25 |
1 files changed, 21 insertions, 4 deletions
@@ -116,9 +116,15 @@ class CdromInstallMethod(ImageInstallMethod): elif h[1000002] not in self.currentDisc: timer.stop() - f = open("/mnt/source/.discinfo") - timestamp = f.readline().strip() - f.close() + if os.access("/mnt/source/.discinfo", os.R_OK): + f = open("/mnt/source/.discinfo") + timestamp = f.readline().strip() + f.close() + else: + timestamp = self.timestamp + + if self.timestamp is None: + self.timestamp = timestamp needed = h[1000002] self.unmountCD() @@ -222,6 +228,16 @@ class CdromInstallMethod(ImageInstallMethod): timer.start() + # if we haven't read a timestamp yet, let's try to get one + if (self.timestamp is None and + os.access("/mnt/source/.discinfo", os.R_OK)): + try: + f = open("/mnt/source/.discinfo") + self.timestamp = f.readline().strip() + f.close() + except: + pass + tmppath = self.getTempPath() copied = 0 # FIXME: should retry a few times then prompt for new cd @@ -269,13 +285,14 @@ class CdromInstallMethod(ImageInstallMethod): if os.access("/mnt/source/.discinfo", os.O_RDONLY): try: f = open("/mnt/source/.discinfo") - f.readline() # stamp + self.timestamp = f.readline().strip() f.readline() # descr f.readline() # arch self.currentDisc = getDiscNums(f.readline().strip()) f.close() except: self.currentDisc = [ 1 ] + self.timestamp = None else: self.currentDisc = [ 1 ] |