diff options
author | Paul Nasrat <pnasrat@redhat.com> | 2006-04-12 19:06:12 +0000 |
---|---|---|
committer | Paul Nasrat <pnasrat@redhat.com> | 2006-04-12 19:06:12 +0000 |
commit | 3c045951556d45e82528af6fd246a3fb857b7d54 (patch) | |
tree | 35b0a9833136d0b90178390bcc4c85d54f431f09 | |
parent | 0540f923a9c4881ec5d883c0f37e298fef49f7ac (diff) | |
download | anaconda-3c045951556d45e82528af6fd246a3fb857b7d54.tar.gz anaconda-3c045951556d45e82528af6fd246a3fb857b7d54.tar.xz anaconda-3c045951556d45e82528af6fd246a3fb857b7d54.zip |
Don't donwload things twice 183654
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | yuminstall.py | 16 |
2 files changed, 12 insertions, 8 deletions
@@ -1,3 +1,7 @@ +2006-04-12 Paul Nasrat <pnasrat@redhat.com> + + * yuminstall.py: Don't download things twice (183654) + 2006-04-11 Chris Lumens <clumens@redhat.com> * anaconda: Make some symlinks earlier. diff --git a/yuminstall.py b/yuminstall.py index 22387a3b6..7ae11f19d 100644 --- a/yuminstall.py +++ b/yuminstall.py @@ -80,7 +80,7 @@ class simpleCallback: self.beenCalled = 0 self.initWindow = None self.ts = ts - self.fdnos = {} + self.files = {} def callback(self, what, amount, total, h, user): # first time here means we should pop the window telling @@ -126,11 +126,11 @@ class simpleCallback: self.instLog.flush() nvra = po.returnNevraPrintable() - self.fdnos[nvra] = -1 + self.files[nvra] = None self.size = po.returnSimple('installedsize') - while self.fdnos[nvra] < 0: + while self.files[nvra] == None: try: fn = self.method.getRPMFilename(os.path.basename(path), getcd(po), self.pkgTimer) except FileCopyException, e: @@ -171,10 +171,10 @@ class simpleCallback: else: continue - fd = os.open(fn, os.O_RDONLY) - self.fdnos[nvra] = fd + f = open(fn, 'r') + self.files[nvra] = f - return self.fdnos[nvra] + return self.files[nvra].fileno() elif what == rpm.RPMCALLBACK_INST_PROGRESS: if amount > total: @@ -188,10 +188,10 @@ class simpleCallback: hdr = po.returnLocalHeader() path = po.returnSimple('relativepath') - fn = self.method.getRPMFilename(os.path.basename(path), getcd(po), self.pkgTimer) nvra = po.returnNevraPrintable() - os.close(self.fdnos[nvra]) + fn = self.files[nvra].name + self.files[nvra].close() self.method.unlinkFilename(fn) self.progress.completePackage(hdr, self.pkgTimer) self.progress.processEvents() |