diff options
Diffstat (limited to 'yum-presto/shared')
-rw-r--r-- | yum-presto/shared/prestoDownload.py | 31 | ||||
-rw-r--r-- | yum-presto/shared/prestoRepo.py | 11 | ||||
-rw-r--r-- | yum-presto/shared/prestomdparser.py | 5 |
3 files changed, 22 insertions, 25 deletions
diff --git a/yum-presto/shared/prestoDownload.py b/yum-presto/shared/prestoDownload.py index 30e7514..0b7ff55 100644 --- a/yum-presto/shared/prestoDownload.py +++ b/yum-presto/shared/prestoDownload.py @@ -35,7 +35,7 @@ def verifyDelta(fo, po, conduit, raiseError): fo = fo.filename try: - verifyChecksum(fo, po.returnSimple('deltachecksumtype'), po.returnSimple('deltachecksum')) + verifyChecksum(fo, po.deltachecksumtype, po.deltachecksum) except: if raiseError: raise URLGrabError(-1, 'Package does not match intended download') @@ -61,7 +61,7 @@ def verifyChecksum(filename, checksumType, csum): return 0 def reconstruct(conduit, po, log): - deltalocal = po.returnSimple('deltalocalpath') + deltalocal = po.deltalocalpath retlist = "" drpm = deltarpm.DeltaRpmWrapper(conduit) @@ -119,13 +119,12 @@ def downloadPkgs(conduit, pkglist, log): remote_pkgs = [] for po in conduit.getDownloadPackages(): if hasattr(po, 'has_drpm') and po.has_drpm: - po.to.pkgtup = po.to.realpkgtup - local = po.returnSimple('deltalocalpath') + local = po.deltalocalpath if os.path.exists(local): cursize = os.stat(local)[6] - totsize = long(po.returnSimple('deltasize')) + totsize = long(po.deltasize) try: - verifyChecksum(local, po.returnSimple('deltachecksumtype'), po.returnSimple('deltachecksum')) + verifyChecksum(local, po.deltachecksumtype, po.deltachecksum) except: if po.repo.p_repo.cache: repo_cached = True @@ -152,29 +151,20 @@ def downloadPkgs(conduit, pkglist, log): adderror(po, 'Insufficient space in download directory %s ' 'to download' % po.repo.deltasdir) continue - po.simple['reallocalpath'] = po.localpath - po.localpath = po.returnSimple('deltalocalpath') - po.simple['realrelativepath'] = po.returnSimple('relativepath') - po.simple['relativepath'] = po.returnSimple('deltarelativepath') try: - text = '(%s/%s): %s' % (i, len(remote_pkgs), os.path.basename(po.returnSimple('deltarelativepath'))) + text = '(%s/%s): %s' % (i, len(remote_pkgs), os.path.basename(po.deltarelativepath)) deltalocal = po.repo.p_repo.getPackage(po, checkfunc=checkfunc, text=text, cache=cache) except Errors.RepoError, e: adderror(po, str(e)) else: queue.put((conduit, po, log)) - po.simple['deltalocalpath'] = deltalocal if errors.has_key(po): del errors[po] - - po.simple['relativepath'] = po.returnSimple('realrelativepath') - po.localpath = po.returnSimple('reallocalpath') - if po.simple.has_key('realpackagesize'): - po.simple['packagesize'] = po.returnSimple('realpackagesize') - del po.simple['realpackagesize'] - del po.simple['realrelativepath'] - del po.simple['reallocalpath'] + + if hasattr(po, 'realpackagesize'): + po.packagesize = po.realpackagesize + del po.realpackagesize # Check for waiting messages from building thread lock.acquire() @@ -187,6 +177,7 @@ def downloadPkgs(conduit, pkglist, log): # Tell build thread that there are no more drpms and wait for it to exit curthread.can_exit = True + queue.put(None) curthread.join() if curthread.messages != "": diff --git a/yum-presto/shared/prestoRepo.py b/yum-presto/shared/prestoRepo.py index 582dc2f..bc1b188 100644 --- a/yum-presto/shared/prestoRepo.py +++ b/yum-presto/shared/prestoRepo.py @@ -49,7 +49,7 @@ class PrestoRepository(Repository): self.baseurl = [conduit.confString(repo.id, 'deltaurl')] is_different = True conduit.info(5, 'Manual url set from presto.conf: %s' % self.baseurl) - elif repo.deltaurl != []: + elif repo.deltaurl != [] and repo.deltaurl != None: self.baseurl = repo.deltaurl is_different = True conduit.info(5, 'Manual url set from repository conf file: %s' % self.baseurl) @@ -368,9 +368,12 @@ class PrestoRepository(Repository): return result def getPackage(self, package, checkfunc = None, text = None, cache = True): - remote = package.returnSimple('relativepath') - local = package.localPkg() - basepath = package.returnSimple('basepath') + remote = package.deltarelativepath + local = package.deltalocalpath + if hasattr(package, 'basepath'): + basepath = package.basepath + else: + basepath = package.returnSimple('basepath') return self.__get(url=basepath, relative=remote, diff --git a/yum-presto/shared/prestomdparser.py b/yum-presto/shared/prestomdparser.py index 9dbcc1d..6764f71 100644 --- a/yum-presto/shared/prestomdparser.py +++ b/yum-presto/shared/prestomdparser.py @@ -19,7 +19,10 @@ # Portions copyright 2007 Jonathan Dieter import gzip -from cElementTree import iterparse +try: + from cElementTree import iterparse +except: + from xml.etree.cElementTree import iterparse from cStringIO import StringIO |