diff options
author | Erik Troan <ewt@redhat.com> | 1999-04-30 21:50:52 +0000 |
---|---|---|
committer | Erik Troan <ewt@redhat.com> | 1999-04-30 21:50:52 +0000 |
commit | ca15edceb8597ba2343bfc81d44df0a433af9578 (patch) | |
tree | 1aef95efa3c9ec222ac7aaba3ab0dcde8d26b6cd | |
parent | 6bc3dfe1a1a4ec88e052a4649fee923017763aa5 (diff) | |
download | anaconda-ca15edceb8597ba2343bfc81d44df0a433af9578.tar.gz anaconda-ca15edceb8597ba2343bfc81d44df0a433af9578.tar.xz anaconda-ca15edceb8597ba2343bfc81d44df0a433af9578.zip |
move filename generation to method
-rwxr-xr-x | anaconda | 7 | ||||
-rw-r--r-- | image.py | 3 |
2 files changed, 7 insertions, 3 deletions
@@ -53,9 +53,10 @@ import rpm def cb(what, amount, total, key, data): if (what == rpm.RPMCALLBACK_INST_OPEN_FILE): - (h, key) = key + (h, method) = key data.setPackage(h[rpm.RPMTAG_NAME]) - d = os.open("/mnt/redhat/test/6.0/i386/RedHat/RPMS/" + key, os.O_RDONLY) + fn = method.getFilename(h) + d = os.open(fn, os.O_RDONLY) return d if (mode == 'g' and not os.environ.has_key('DISPLAY')): @@ -93,7 +94,7 @@ db = rpm.opendb(1, rootPath) ts = rpm.TransactionSet(rootPath, db) for p in comps.selected(): - ts.add(p.h, (p.h, p.h[1000000])) + ts.add(p.h, (p.h, method)) ts.order() p = intf.packageProgessWindow() @@ -4,6 +4,9 @@ import rpm class InstallMethod: + def getFilename(self, h): + return self.tree + "/" + "RedHat/RPMS/" + h[1000000] + def readHeaders(self): return rpm.readHeaderList(self.tree + "/RedHat/base/hdlist") |