rpms/yum-presto/devel cleanup.patch, NONE, 1.1 yum-presto.spec, 1.11, 1.12
James Antill
james at fedoraproject.org
Sun Apr 26 17:07:18 UTC 2009
Author: james
Update of /cvs/pkgs/rpms/yum-presto/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv10770
Modified Files:
yum-presto.spec
Added Files:
cleanup.patch
Log Message:
* Sun Apr 26 2009 James Antill <james at fedoraproject.org> - 0.4.5-5
- Added cleanup patch from upstream.
- Adds progress for rebuilding.
cleanup.patch:
--- NEW FILE cleanup.patch ---
commit 07aa63c211c76738b9b98e75831f8bd041feb2f7
Author: Seth Vidal <skvidal at fedoraproject.org>
Date: Fri Apr 17 10:49:53 2009 -0400
Cleanup, add doclines, add verbose messages
diff --git a/yum-presto/presto.py b/yum-presto/presto.py
index b545b9e..8f769ae 100644
--- a/yum-presto/presto.py
+++ b/yum-presto/presto.py
@@ -21,7 +21,6 @@
# Copyright 2007 Red Hat, Inc. -- Jeremy Katz <katzj at redhat.com>
import os
-import sys
import subprocess
import gzip
import thread
@@ -36,6 +35,7 @@ from yum.plugins import TYPE_CORE, PluginYumExit
import yum.Errors
import yum.misc
from urlgrabber.grabber import URLGrabError
+from urlgrabber.progress import format_number
complete_download_size = 0
actual_download_size = 0
@@ -47,26 +47,30 @@ plugin_type = (TYPE_CORE,)
pinfo = {}
def verifyDelta(sequence, arch):
+ """checks that the deltarpm can be applied"""
if subprocess.call(["/usr/bin/applydeltarpm", "-a", arch,
"-C", "-s", sequence], close_fds=True):
return False
return True
def applyDelta(deltarpmfile, newrpmfile, arch):
+ """applies the deltarpm to create the new rpm"""
if subprocess.call(["/usr/bin/applydeltarpm", "-a", arch,
deltarpmfile, newrpmfile], close_fds=True):
return False
return True
def reconstruct(conduit, rpmlocal, rpmarch, deltalocal):
+ """logic around applyDelta"""
retlist = ""
global actual_download_size
if not applyDelta(deltalocal, rpmlocal, rpmarch):
- retlist += "Error rebuilding rpm from %s! Will download full package.\n" % os.path.basename(deltalocal)
+ retlist += "Error rebuilding rpm from %s! Will " \
+ "download full package.\n" % os.path.basename(deltalocal)
try:
os.unlink(rpmlocal)
- except:
+ except (OSError, IOError), e:
pass
else:
# Calculate new download size
@@ -76,24 +80,19 @@ def reconstruct(conduit, rpmlocal, rpmarch, deltalocal):
actual_download_size = actual_download_size - rpm_size + drpm_size
# Check to see whether or not we should keep the drpms
- # FIXME: Is there any way to see whether or not a Boolean option was not set?
- if conduit.confBool('main', 'neverkeepdeltas'):
- delete = True
- elif conduit.confBool('main', 'keepdeltas'):
+ delete = not conduit.getConf().keepcache
+ if conduit.confBool('main', 'keepdeltas'):
delete = False
- elif conduit.getConf().keepcache != 0:
- delete = False
- else:
- delete = True
if delete:
try:
os.unlink(deltalocal)
- except:
+ except (OSError, IOError), e:
pass
return retlist
class ReconstructionThread(threading.Thread):
+ """Threaded process to create rpms from deltarpms"""
def __init__(self, queue, lock, run_function):
threading.Thread.__init__(self)
self.run_function = run_function
@@ -128,28 +127,36 @@ class ReconstructionThread(threading.Thread):
self.lock.release()
-def getDelta(po, presto, rpmdb):
+def getDelta(po, presto, conduit):
"""Does the package have a reasonable delta for us to use?"""
global complete_download_size
global actual_download_size
+ rpmdb = conduit.getRpmDB()
# local packages don't make sense to use a delta for...
if hasattr(po, 'pkgtype') and po.pkgtype == 'local':
+ conduit.info(5, "Package %s.%s is local, not using a delta"
+ % (po.name, po.arch))
return None
if po.remote_url.startswith("file:/"):
# kind of a hack, but file:/ repos are basically local
+ conduit.info(5, "Package %s.%s is in a file:// repo, not using a delta"
+ % (po.name, po.arch))
return None
# if there's not presto info for the repo, we don't have a delta for
# the package
if not presto.has_key(po.repo.id):
+ conduit.info(5, "No delta information for repository %s." % po.repo.id)
return None
deltainfo = presto[po.repo.id]
# any deltas for the new package in the repo?
- nevra = "%s-%s:%s-%s.%s" %(po.name, po.epoch, po.version,
- po.release, po.arch)
+ nevra = "%s-%s:%s-%s.%s" % (po.name, po.epoch, po.version,
+ po.release, po.arch)
if not deltainfo.has_key(nevra):
+ conduit.info(5, "Could not find delta rpm for package %s.%s."
+ % (po.name, po.arch))
return None
deltas = deltainfo[nevra]
@@ -161,21 +168,27 @@ def getDelta(po, presto, rpmdb):
if po.verifyLocalPkg(): # we've got it.
actual_download_size -= cursize
complete_download_size -= cursize
+ conduit.info(5, "Already have package for %s.%s."
+ % (po.name, po.arch))
return None
if cursize < totsize: # we have part of the file; do a reget
+ conduit.info(5, "Already have part of package for %s.%s."
+ % (po.name, po.arch))
return None
os.unlink(local)
# did we have a previous package of the same arch installed?
installed = rpmdb.searchNevra(po.name, None, None, None, po.arch)
if len(installed) == 0:
+ conduit.info(5, "Package for %s.%s of the same arch not installed."
+ % (po.name, po.arch))
return None
# now, let's see if there's a delta for us...
bestdelta = None
for oldpo in installed:
- evr = "%s:%s-%s" %(oldpo.epoch, oldpo.version, oldpo.release)
+ evr = "%s:%s-%s" % (oldpo.epoch, oldpo.version, oldpo.release)
if not deltas.has_key(evr):
continue
delta = deltas[evr]
@@ -188,7 +201,8 @@ def getDelta(po, presto, rpmdb):
continue
bestdelta = delta
-
+ if not bestdelta:
+ conduit.info(5, "No delta rpm for %s.%s." % (po.name, po.arch))
return bestdelta
@@ -212,7 +226,7 @@ def downloadPkgs(conduit, presto, download_pkgs=None):
# see which deltas we need to download; if the delta is already
# downloaded, we can start it reconstructing in the background
for po in download_pkgs:
- delta = getDelta(po, presto, conduit.getRpmDB())
+ delta = getDelta(po, presto, conduit)
if delta is None:
continue
@@ -231,7 +245,9 @@ def downloadPkgs(conduit, presto, download_pkgs=None):
delta['checksum'])
except URLGrabError, e:
if po.repo.cache:
- raise yum.Errors.RepoError, "Caching enabled and local cache for %s doesn't match checksum" %(deltapath,)
+ msg = "Caching enabled and local cache for " \
+ "%sdoesn't match checksum" % deltapath
+ raise yum.Errors.RepoError, msg
else:
cursize = os.stat(deltapath)[6]
totsize = long(delta['size'])
@@ -268,7 +284,7 @@ def downloadPkgs(conduit, presto, download_pkgs=None):
'to download' % (deltadir,))
continue
try:
- text = "(%s/%s): %s" %(i, len(remote_pkgs),
+ text = "(%s/%s): %s" % (i, len(remote_pkgs),
os.path.basename(delta['filename']))
deltafile = po.repo._getFile(url=po.basepath,
relative=delta['filename'],
@@ -305,12 +321,16 @@ def downloadPkgs(conduit, presto, download_pkgs=None):
return errors
class DeltaInfo(object):
+ """Base Delta rpm info object"""
def __init__(self, elem):
self.epoch = elem.get("oldepoch")
self.version = elem.get("oldversion")
self.release = elem.get("oldrelease")
-
- self.filename = self.sequence = self.size = self.checksum = self.checksum_type = None
+ self.filename = None
+ self.sequence = None
+ self.size = None
+ self.checksum = None
+ self.checksum_type = None
for x in elem.getchildren():
if x.tag == "checksum":
@@ -318,10 +338,12 @@ class DeltaInfo(object):
setattr(self, x.tag, x.text)
def evr(self):
- return "%s:%s-%s" %(self.epoch, self.version, self.release)
+ return "%s:%s-%s" % (self.epoch, self.version, self.release)
def __str__(self):
- return "filename: %s, sequence: %s, size: %s, checksum (%s) = %s" % (self.filename, self.sequence, self.size, self.checksum_type, self.checksum)
+ return "filename: %s, sequence: %s, size: %s, checksum (%s) = %s" \
+ % (self.filename, self.sequence, self.size,
+ self.checksum_type, self.checksum)
def __getitem__(self, key):
return getattr(self, key)
@@ -339,7 +361,7 @@ class NewPackage(object):
self.deltas[d.evr()] = d
def nevra(self):
- return "%s-%s:%s-%s.%s" %(self.name, self.epoch, self.version,
+ return "%s-%s:%s-%s.%s" % (self.name, self.epoch, self.version,
self.release, self.arch)
def __str__(self):
@@ -366,46 +388,6 @@ class PrestoParser(object):
def getDeltas(self):
return self.deltainfo
-def format_number(number, SI=False, space=''):
- """Turn numbers into human-readable metric-like numbers"""
- symbols = ['', # (none)
- 'K', # kilo
- 'M', # mega
- 'G', # giga
- 'T', # tera
- 'P', # peta
- 'E', # exa
- 'Z', # zetta
- 'Y'] # yotta
-
- if SI: step = 1000.0
- else: step = 1024.0
-
- thresh = 999
- depth = 0
-
- # we want numbers between
- while number > thresh:
- depth = depth + 1
- number = number / step
-
- # just in case someone needs more than 1000 yottabytes!
- diff = depth - len(symbols) + 1
- if diff > 0:
- depth = depth - diff
- number = number * thresh**depth
-
- if type(number) == type(1) or type(number) == type(1L):
- format = '%i%s%s'
- elif number < 9.95:
- # must use 9.95 for proper sizing. For example, 9.99 will be
- # rounded to 10.0 with the .1f format string (which is too long)
- format = '%.1f%s%s'
- else:
- format = '%.0f%s%s'
-
- return(format % (number, space, symbols[depth]))
-
# Configuration stuff
def config_hook(conduit):
# Add --disable-presto option
@@ -431,8 +413,8 @@ def xpostreposetup_hook(conduit, repos=None):
for active_repo in repos:
try:
deltamd = active_repo.retrieveMD("prestodelta")
- except:
- conduit.info(2, "No Presto metadata available for %s" %(active_repo,))
+ except yum.Errors.RepoError, e:
+ conduit.info(2, "No Presto metadata available for %s" % active_repo)
continue
pinfo[active_repo.id] = PrestoParser(deltamd).getDeltas()
@@ -490,6 +472,9 @@ def posttrans_hook(conduit):
drpm_string = format_number(actual_download_size)
rpm_string = format_number(complete_download_size)
- conduit.info(2, "Size of all updates downloaded from Presto-enabled repositories: %s" % drpm_string)
- conduit.info(2, "Size of updates that would have been downloaded if Presto wasn't enabled: %s" % rpm_string)
- conduit.info(2, "This is a savings of %i percent" % (100 - ((actual_download_size * 100) / complete_download_size)))
+ conduit.info(2, "Size of all updates downloaded from Presto-enabled " \
+ "repositories: %s" % drpm_string)
+ conduit.info(2, "Size of updates that would have been downloaded if " \
+ "Presto wasn't enabled: %s" % rpm_string)
+ saveper = 100 - ((actual_download_size * 100) / complete_download_size)
+ conduit.info(2, "This is a savings of %i percent" % saveper)
commit 427b294b95dcb1dda24638c1470c3a7f9dbbe15c
Author: James Antill <james at and.org>
Date: Fri Apr 17 10:51:48 2009 -0400
Document the config. change, and how it works
diff --git a/yum-presto/presto.conf b/yum-presto/presto.conf
index b7dc4a9..a066321 100644
--- a/yum-presto/presto.conf
+++ b/yum-presto/presto.conf
@@ -3,5 +3,6 @@
[main]
enabled=1
-neverkeepdeltas=1
+# This defaults to yum's keepcache option, if not set.
+# keepdeltas = false
commit 4355d92b82a129e922269de1efcc6f24caa9b27b
Author: James Antill <james at and.org>
Date: Fri Apr 24 01:02:13 2009 -0400
Can't trust applydeltarpm for if the pkg is good, use verifyLocalPkg()
diff --git a/yum-presto/presto.py b/yum-presto/presto.py
index 8f769ae..bb9052d 100644
--- a/yum-presto/presto.py
+++ b/yum-presto/presto.py
@@ -60,12 +60,14 @@ def applyDelta(deltarpmfile, newrpmfile, arch):
return False
return True
-def reconstruct(conduit, rpmlocal, rpmarch, deltalocal):
+def reconstruct(conduit, po, deltalocal):
"""logic around applyDelta"""
retlist = ""
global actual_download_size
- if not applyDelta(deltalocal, rpmlocal, rpmarch):
+ rpmlocal = po.localpath
+ rpmarch = po.arch
+ if not applyDelta(deltalocal, rpmlocal, rpmarch) or not po.verifyLocalPkg():
retlist += "Error rebuilding rpm from %s! Will " \
"download full package.\n" % os.path.basename(deltalocal)
try:
@@ -258,7 +260,7 @@ def downloadPkgs(conduit, presto, download_pkgs=None):
else:
# Deltarpm is local and good, put it in the rebuild thread.
conduit.info(5, "using local copy of deltarpm for %s" % po)
- queue.put((conduit, po.localpath, po.arch, deltapath))
+ queue.put((conduit, po, deltapath))
continue
else:
remote_pkgs.append( (po, delta) )
@@ -295,7 +297,7 @@ def downloadPkgs(conduit, presto, download_pkgs=None):
except yum.Errors.RepoError, e:
adderror(po, str(e))
else:
- queue.put((conduit, po.localpath, po.arch, deltafile))
+ queue.put((conduit, po, deltafile))
if errors.has_key(po):
del errors[po]
commit a5b0c51b5d2fe31182554455dc4fb108af42fc12
Author: James Antill <james at and.org>
Date: Fri Apr 24 02:00:03 2009 -0400
Add progress for drpm rebuilds, uses repo. "download" callback
diff --git a/yum-presto/presto.py b/yum-presto/presto.py
index bb9052d..e48e498 100644
--- a/yum-presto/presto.py
+++ b/yum-presto/presto.py
@@ -23,6 +23,7 @@
import os
import subprocess
import gzip
+import time
import thread
import threading
import Queue
@@ -40,6 +41,11 @@ from urlgrabber.progress import format_number
complete_download_size = 0
actual_download_size = 0
+process_lock = None # For progress, updated in thread
+processed_t_size = 0 # For progress, updated in thread
+processed_f_size = 0 # For progress, updated in thread
+processing_fname = None # For progress, updated in thread
+
requires_api_version = '2.1'
plugin_type = (TYPE_CORE,)
@@ -60,14 +66,22 @@ def applyDelta(deltarpmfile, newrpmfile, arch):
return False
return True
-def reconstruct(conduit, po, deltalocal):
+def reconstruct(conduit, po, deltalocal, deltasize):
"""logic around applyDelta"""
retlist = ""
global actual_download_size
rpmlocal = po.localpath
rpmarch = po.arch
+ process_lock.acquire()
+ processing_fname = rpmlocal
+ process_lock.release()
if not applyDelta(deltalocal, rpmlocal, rpmarch) or not po.verifyLocalPkg():
+ process_lock.acquire()
+ processing_fname = None
+ processed_f_size += po.size
+ process_lock.release()
+
retlist += "Error rebuilding rpm from %s! Will " \
"download full package.\n" % os.path.basename(deltalocal)
try:
@@ -75,11 +89,13 @@ def reconstruct(conduit, po, deltalocal):
except (OSError, IOError), e:
pass
else:
+ process_lock.acquire()
+ processing_fname = None
+ processed_t_size += po.size
+ process_lock.release()
+
# Calculate new download size
- rpm_size = os.stat(rpmlocal)[6]
- drpm_size = os.stat(deltalocal)[6]
-
- actual_download_size = actual_download_size - rpm_size + drpm_size
+ actual_download_size -= po.size - deltasize
# Check to see whether or not we should keep the drpms
delete = not conduit.getConf().keepcache
@@ -206,17 +222,37 @@ def getDelta(po, presto, conduit):
if not bestdelta:
conduit.info(5, "No delta rpm for %s.%s." % (po.name, po.arch))
return bestdelta
-
+
+def _processing_data():
+ process_lock.acquire()
+ ptsz = processed_t_size
+ pfsz = processed_f_size
+ pfnm = processing_fname
+ process_lock.release()
+ return ptsz, pfsz, pfnm
+
+def _safe_stat_size(fname):
+ if fname is None:
+ return 0
+
+ try:
+ return os.stat(fname)[6]
+ except:
+ return 0
def downloadPkgs(conduit, presto, download_pkgs=None):
"""download list of package objects handed to you, return errors"""
+ global process_lock
errors = {}
def adderror(po, msg):
errors.setdefault(po, []).append(msg)
+ rebuild_size = 0 # Size of packages we are going to rebuild.
+
# Set up thread for applying drpms
queue = Queue.Queue(0)
+ process_lock = thread.allocate_lock()
lock = thread.allocate_lock()
curthread = ReconstructionThread(queue, lock, reconstruct)
curthread.start()
@@ -225,6 +261,7 @@ def downloadPkgs(conduit, presto, download_pkgs=None):
if download_pkgs is None:
download_pkgs = conduit.getDownloadPackages()
+
# see which deltas we need to download; if the delta is already
# downloaded, we can start it reconstructing in the background
for po in download_pkgs:
@@ -260,7 +297,10 @@ def downloadPkgs(conduit, presto, download_pkgs=None):
else:
# Deltarpm is local and good, put it in the rebuild thread.
conduit.info(5, "using local copy of deltarpm for %s" % po)
- queue.put((conduit, po, deltapath))
+ # HACK: Use the download progress, at least we get something
+ cb = po.repo.callback
+ queue.put((conduit, po, deltapath, long(delta['size'])))
+ rebuild_size += po.size
continue
else:
remote_pkgs.append( (po, delta) )
@@ -281,7 +321,8 @@ def downloadPkgs(conduit, presto, download_pkgs=None):
# FIXME: this should be moved into _getFile
dirstat = os.statvfs(deltadir)
- if (dirstat.f_bavail * dirstat.f_bsize) <= long(po.size):
+ if (dirstat.f_bavail * dirstat.f_bsize) <= (long(po.size) +
+ long(delta['size'])):
adderror(po, 'Insufficient space in download directory %s '
'to download' % (deltadir,))
continue
@@ -297,7 +338,10 @@ def downloadPkgs(conduit, presto, download_pkgs=None):
except yum.Errors.RepoError, e:
adderror(po, str(e))
else:
- queue.put((conduit, po, deltafile))
+ # HACK: Use the download progress, at least we get something
+ cb = po.repo.callback
+ queue.put((conduit, po, deltafile, long(delta['size'])))
+ rebuild_size += po.size
if errors.has_key(po):
del errors[po]
@@ -309,12 +353,26 @@ def downloadPkgs(conduit, presto, download_pkgs=None):
curthread.messages = ""
lock.release()
- conduit.info(2, "Rebuilding rpms from deltarpms")
+ conduit.info(2, "Finishing rebuild of rpms, from deltarpms")
+ if cb and curthread.isAlive():
+ ptsz, pfsz, pfnm = _processing_data()
+ cb.start(text="<delta rebuild>", size=rebuild_size)
+ sofar_sz = ptsz + pfsz
+ cb.update(sofar)
+ while sofar_sz < rebuild_size and curthread.isAlive():
+ ptsz, pfsz, pfnm = _processing_data()
+ sz = ptsz + pfsz + _safe_stat_size(pfnm)
+ if sz > sofar_sz:
+ cb.update(sz - sofar_sz)
+ sofar_sz = sz
+ time.sleep(0.5)
+ cb.end(0)
# Tell build thread that there are no more drpms and wait for it to exit
curthread.can_exit = True
queue.put(None)
curthread.join()
+ process_lock = None
if curthread.messages != "":
conduit.info(2, curthread.messages[:-1])
@@ -400,7 +458,7 @@ def config_hook(conduit):
help="disable Presto plugin and don't download any deltarpms")
# Set up Presto repositories
-# Don't do this whn repos. are setup as that happens a lot, but we only
+# Don't do this when repos. are setup as that happens a lot, but we only
# care about presto when we are about to download packages. Eventaully if
# we have MD deltas we'll want to trigger then too.
def xpostreposetup_hook(conduit, repos=None):
commit 4f2a5a2f042729e4970fd185d935e0fe29aa858d
Author: James Antill <james at and.org>
Date: Fri Apr 24 02:04:51 2009 -0400
Cleanup saved message, output it in postdownload_hook
diff --git a/yum-presto/presto.py b/yum-presto/presto.py
index e48e498..530c957 100644
--- a/yum-presto/presto.py
+++ b/yum-presto/presto.py
@@ -519,7 +519,7 @@ def predownload_hook(conduit):
errstring += ' %s: %s\n' % (key, error)
raise PluginYumExit(errstring)
-def posttrans_hook(conduit):
+def postdownload_hook(conduit):
global complete_download_size
global actual_download_size
@@ -529,12 +529,11 @@ def posttrans_hook(conduit):
(complete_download_size == actual_download_size):
return
- drpm_string = format_number(actual_download_size)
- rpm_string = format_number(complete_download_size)
+ drpm_string = format_number(actual_download_size)
+ rpm_string = format_number(complete_download_size)
+ saved_string = format_number(complete_download_size - actual_download_size)
- conduit.info(2, "Size of all updates downloaded from Presto-enabled " \
- "repositories: %s" % drpm_string)
- conduit.info(2, "Size of updates that would have been downloaded if " \
- "Presto wasn't enabled: %s" % rpm_string)
+ conduit.info(2, "Size of deltarpms downloaded: %s" % drpm_string)
+ conduit.info(2, "Size of rebuilt rpms on disk: %s" % rpm_string)
saveper = 100 - ((actual_download_size * 100) / complete_download_size)
- conduit.info(2, "This is a savings of %i percent" % saveper)
+ conduit.info(2, "Saved: %s (%i%%)" % (saved_string, saveper))
commit 7e2d80a83ecf848854f0f6f6b1317cc3ae36e81b
Author: James Antill <james at and.org>
Date: Fri Apr 24 12:08:28 2009 -0400
Fix progress and verifyLocalPkg()
diff --git a/yum-presto/presto.py b/yum-presto/presto.py
index 530c957..957b87b 100644
--- a/yum-presto/presto.py
+++ b/yum-presto/presto.py
@@ -70,12 +70,16 @@ def reconstruct(conduit, po, deltalocal, deltasize):
"""logic around applyDelta"""
retlist = ""
global actual_download_size
+ global processed_t_size
+ global processed_f_size
rpmlocal = po.localpath
rpmarch = po.arch
process_lock.acquire()
processing_fname = rpmlocal
process_lock.release()
+ # applyDelta can think it's succeeded when it hasn't due to signing
+ # changes. Also have to be careful about SQL issues, see below.
if not applyDelta(deltalocal, rpmlocal, rpmarch) or not po.verifyLocalPkg():
process_lock.acquire()
processing_fname = None
@@ -249,6 +253,7 @@ def downloadPkgs(conduit, presto, download_pkgs=None):
errors.setdefault(po, []).append(msg)
rebuild_size = 0 # Size of packages we are going to rebuild.
+ cb = None
# Set up thread for applying drpms
queue = Queue.Queue(0)
@@ -299,6 +304,7 @@ def downloadPkgs(conduit, presto, download_pkgs=None):
conduit.info(5, "using local copy of deltarpm for %s" % po)
# HACK: Use the download progress, at least we get something
cb = po.repo.callback
+ po.returnChecksums() # Magic, see below
queue.put((conduit, po, deltapath, long(delta['size'])))
rebuild_size += po.size
continue
@@ -340,6 +346,10 @@ def downloadPkgs(conduit, presto, download_pkgs=None):
else:
# HACK: Use the download progress, at least we get something
cb = po.repo.callback
+ # Magic: What happens here is that the checksum data is loaded
+ # from the SQL db in this thread, so that the other thread can call
+ # .verifyLocalPkg() without having to hit sqlite.
+ po.returnChecksums()
queue.put((conduit, po, deltafile, long(delta['size'])))
rebuild_size += po.size
@@ -353,20 +363,21 @@ def downloadPkgs(conduit, presto, download_pkgs=None):
curthread.messages = ""
lock.release()
- conduit.info(2, "Finishing rebuild of rpms, from deltarpms")
- if cb and curthread.isAlive():
- ptsz, pfsz, pfnm = _processing_data()
+ ptsz, pfsz, pfnm = _processing_data()
+ if cb and rebuild_size > (ptsz + pfsz):
+ conduit.info(2, "Finishing rebuild of rpms, from deltarpms")
cb.start(text="<delta rebuild>", size=rebuild_size)
sofar_sz = ptsz + pfsz
- cb.update(sofar)
+ cb.update(sofar_sz)
while sofar_sz < rebuild_size and curthread.isAlive():
ptsz, pfsz, pfnm = _processing_data()
sz = ptsz + pfsz + _safe_stat_size(pfnm)
if sz > sofar_sz:
- cb.update(sz - sofar_sz)
+ cb.update(sz)
sofar_sz = sz
time.sleep(0.5)
- cb.end(0)
+ ptsz, pfsz, pfnm = _processing_data()
+ cb.end(ptsz + pfsz + _safe_stat_size(pfnm))
# Tell build thread that there are no more drpms and wait for it to exit
curthread.can_exit = True
commit 65b26f0107b3b19a7427d75b346b06cba22a584a
Author: James Antill <james at and.org>
Date: Fri Apr 24 12:27:26 2009 -0400
Don't die on repos. which don't have prestodelta md
diff --git a/yum-presto/presto.py b/yum-presto/presto.py
index 957b87b..1e2c4ee 100644
--- a/yum-presto/presto.py
+++ b/yum-presto/presto.py
@@ -484,8 +484,11 @@ def xpostreposetup_hook(conduit, repos=None):
for active_repo in repos:
try:
deltamd = active_repo.retrieveMD("prestodelta")
+ except yum.Errors.RepoMDError, e: # Needed pre. 3.2.23
+ conduit.info(3, "No Presto metadata available for %s" % active_repo)
+ continue
except yum.Errors.RepoError, e:
- conduit.info(2, "No Presto metadata available for %s" % active_repo)
+ conduit.info(3, "No Presto metadata available for %s" % active_repo)
continue
pinfo[active_repo.id] = PrestoParser(deltamd).getDeltas()
Index: yum-presto.spec
===================================================================
RCS file: /cvs/pkgs/rpms/yum-presto/devel/yum-presto.spec,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- yum-presto.spec 11 Mar 2009 18:18:41 -0000 1.11
+++ yum-presto.spec 26 Apr 2009 17:06:47 -0000 1.12
@@ -3,11 +3,12 @@
Summary: Presto plugin for yum
Name: yum-presto
Version: 0.4.5
-Release: 4%{?dist}
+Release: 5%{?dist}
License: GPLv2+
Group: Development/Tools
Source: http://www.lesbg.com/jdieter/presto/%{name}-%{version}.tar.bz2
Patch0: speedup.patch
+Patch1: cleanup.patch
URL: http://www.lesbg.com/jdieter/presto/
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -28,6 +29,7 @@
%setup -q
%patch0 -p2
+%patch1 -p2
%build
@@ -48,6 +50,10 @@
%config(noreplace) %{_sysconfdir}/yum/pluginconf.d/presto.conf
%changelog
+* Sun Apr 26 2009 James Antill <james at fedoraproject.org> - 0.4.5-5
+- Added cleanup patch from upstream.
+- Adds progress for rebuilding.
+
* Wed Mar 11 2009 James Antill <james at fedoraproject.org> - 0.4.5-4
- Added speedup patch from upstream.
More information about the fedora-extras-commits
mailing list