[Yum-devel] [PATCH] Include installs in 'data still to download'. BZ 739092.

Nils Philippsen nils at redhat.com
Mon Sep 19 11:57:16 UTC 2011


On Mon, 2011-09-19 at 13:54 +0200, Nils Philippsen wrote:
> On Mon, 2011-09-19 at 09:26 +0200, Zdeněk Pavlas wrote:
> > All 'presto' cares about are updates, the other message
> > (Presto reduced the update size) is explicit in this.
> > 
> > So maybe just change the message?
> > ---
> >  yum-presto/presto.py |    5 ++++-
> >  1 files changed, 4 insertions(+), 1 deletions(-)
> > 
> > diff --git a/yum-presto/presto.py b/yum-presto/presto.py
> > index 169e938..fe81143 100644
> > --- a/yum-presto/presto.py
> > +++ b/yum-presto/presto.py
> > @@ -588,8 +588,11 @@ def predownload_hook(conduit):
> >      repos = set()
> >      reposize = {}
> >      download_pkgs = []
> > +    install_size = 0
> >      for po in pkglist:
> >          if po.state != TS_UPDATE and po.name not in installonlypkgs:
> > +            if po.state == TS_INSTALL:
> 
> Not sure where that leaves/should leave TS_TRUEINSTALL -- but I'm not
> 100% sure about the meanings of all transaction states, so not sure if
> that needs to be honored here. If so, it should perhaps look like this:
> 
> +             if po.state in (TS_INSTALL, TS_TRUEINSTALL):

or even rather this:

+              if po.state in TS_INSTALL_STATES:

> 
> > +                install_size += po.size
> >              continue
> >          local = po.localPkg()
> >          if os.path.exists(local):
> > @@ -639,7 +642,7 @@ def predownload_hook(conduit):
> >      xpostdownload_hook(conduit)
> >      if more:
> >          conduit.info(2, "Package(s) data still to download: %s" %
> > -                     format_number(more))
> > +                     format_number(more + install_size))
> >  
> >  #  Output stats. about delta downloads ... if we don't have deltas for
> >  # everything (pretty common), we want to output these before we start
> 

-- 
Nils Philippsen      "Those who would give up Essential Liberty to purchase 
Red Hat               a little Temporary Safety, deserve neither Liberty
nils at redhat.com       nor Safety."  --  Benjamin Franklin, 1759
PGP fingerprint:      C4A8 9474 5C4C ADE3 2B8F  656D 47D8 9B65 6951 3011



More information about the Yum-devel mailing list