diff options
author | Jeremy Katz <katzj@redhat.com> | 2002-07-12 03:06:57 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2002-07-12 03:06:57 +0000 |
commit | 3f7e6fbc27c88a18c32c3d7fddb1259a6e51bd89 (patch) | |
tree | 1c00c60a778731eddd1c5ac2061e1ff4e02aa9f6 /image.py | |
parent | 972088ca2cc18171942319799cf5b8e25d8706c6 (diff) | |
download | anaconda-3f7e6fbc27c88a18c32c3d7fddb1259a6e51bd89.tar.gz anaconda-3f7e6fbc27c88a18c32c3d7fddb1259a6e51bd89.tar.xz anaconda-3f7e6fbc27c88a18c32c3d7fddb1259a6e51bd89.zip |
apply pbrown's patch to change disc info files to be .discinfo and have all of the relevant information. this will allow for similar formatting for other product CDs such as the lacd
Diffstat (limited to 'image.py')
-rw-r--r-- | image.py | 63 |
1 files changed, 49 insertions, 14 deletions
@@ -91,8 +91,7 @@ class CdromInstallMethod(ImageInstallMethod): elif h[1000002] != self.currentDisc: timer.stop() - key = ".disc%d-%s" % (self.currentDisc, iutil.getArch()) - f = open("/mnt/source/" + key) + f = open("/mnt/source/.discinfo") timestamp = f.readline() f.close() @@ -100,7 +99,6 @@ class CdromInstallMethod(ImageInstallMethod): isys.umount("/mnt/source") done = 0 - key = "/mnt/source/.disc%d-%s" % (self.currentDisc, iutil.getArch()) cdlist = [] for (dev, something, descript) in \ @@ -112,11 +110,25 @@ class CdromInstallMethod(ImageInstallMethod): try: if not isys.mount(dev, "/mnt/source", fstype = "iso9660", readOnly = 1): - if os.access(key, os.O_RDONLY): - f = open(key) + if os.access("/mnt/source/.discinfo", os.O_RDONLY): + f = open("/mnt/source/.discinfo") newStamp = f.readline() + try: + descr = f.readline() + except: + descr = None + try: + arch = f.readline() + except: + arch = None + try: + discNum = string.atoi(f.readline()) + except: + discNum = 0 f.close() - if newStamp == timestamp: + if (newStamp == timestamp and + arch == iutil.getArch() and + discNum == self.currentDisc): done = 1 if not done: @@ -127,9 +139,6 @@ class CdromInstallMethod(ImageInstallMethod): if done: break - if done: - break - if not done: isys.ejectCdrom(self.device) @@ -144,11 +153,26 @@ class CdromInstallMethod(ImageInstallMethod): isys.mount(self.device, "/mnt/source", fstype = "iso9660", readOnly = 1) - if os.access(key, os.O_RDONLY): - f = open(key) + + if os.access("/mnt/source/.discinfo", os.O_RDONLY): + f = open("/mnt/source/.discinfo") newStamp = f.readline() + try: + descr = f.readline() + except: + descr = None + try: + arch = f.readline() + except: + arch = None + try: + discNum = string.atoi(f.readline()) + except: + discNum = 0 f.close() - if newStamp == timestamp: + if (newStamp == timestamp and + arch == iutil.getArch() and + discNum == self.currentDisc): done = 1 # make /tmp/cdrom again so cd gets ejected isys.makeDevInode(self.device, "/tmp/cdrom") @@ -226,8 +250,19 @@ def findIsoImages(path, messageWindow): isys.mount("loop2", "/mnt/cdimage", fstype = "iso9660", readOnly = 1) for num in range(1, 10): - discTag = "/mnt/cdimage/.disc%d-%s" % (num, arch) - if os.access(discTag, os.R_OK): + if os.access("/mnt/cdimage/.discinfo", os.R_OK): + f = open("/mnt/cdimage/.discinfo"); + try: + f.readline() # skip timestamp + f.readline() # skip release description + discArch = f.readline() # read architecture + discNum = string.atoi(f.readline()) # read disc number + except: + discArch = None + discNum = 0 + if discNum != num or discArch != arch: + continue + import stat # warn user if images appears to be wrong size |