[packagekit] The yum percentage changed callback for refresh-cache
hughsient at gmail.com
Sun Oct 21 16:07:09 PDT 2007
At the moment we have the yum refresh cache percentage callback as big
jumps, e.g. 0, 25%, 50%, 75% and 100% - this isn't very nice when the
time between jumps can be a few minutes.
We seem to get lots of subpercentage updates, which are good, so could
we _refine_ the percentage updates with this information?
i.e. we still do the "bump" computation, but add to it the
subpercentage / len(self.yumbase.repos.listEnabled()) to get a much
Does this make sense?
The code that works out the jumps is this:
pct = 0
if len(self.yumbase.repos.listEnabled()) == 0:
#work out the slice for each one
bump = (100/len(self.yumbase.repos.listEnabled()))/2
for repo in self.yumbase.repos.listEnabled():
repo.metadata_expire = 0
self.yumbase.repos.populateSack(which=[repo.id], mdtype='metadata', cacheonly=1)
self.yumbase.repos.populateSack(which=[repo.id], mdtype='filelists', cacheonly=1)
Yum legends, take your marks, get set, go!
More information about the PackageKit