On Mon, 2011-06-27 at 18:01 +0200, Zdeněk Pavlas wrote:
> ---
>  yum/__init__.py |   11 -----------
>  1 files changed, 0 insertions(+), 11 deletions(-)
> 
> diff --git a/yum/__init__.py b/yum/__init__.py
> index f094f3b..5b49dbe 100644
> --- a/yum/__init__.py
> +++ b/yum/__init__.py
> @@ -1982,19 +1982,8 @@ class YumBase(depsolve.Depsolve):
>          local_size = 0
>          done_repos = set()
>          for po in remote_pkgs:
> -            #  Recheck if the file is there, works around a couple of weird
> -            # edge cases.
>              local = po.localPkg()
>              i += 1
> -            if os.path.exists(local):
> -                if self.verifyPkg(local, po, False):
> -                    self.verbose_logger.debug(_("using local copy of %s") 
> %(po,))
> -                    remote_size -= po.size
> -                    if hasattr(urlgrabber.progress, 'text_meter_total_size'):
> -                        
> urlgrabber.progress.text_meter_total_size(remote_size,
> -                                                                  local_size)
> -                    continue
> -
>              checkfunc = (self.verifyPkg, (po, 1), {})
>              dirstat = os.statvfs(po.repo.pkgdir)
>              if (dirstat.f_bavail * dirstat.f_bsize) <= long(po.size):

On Mon, 2011-06-27 at 18:01 +0200, Zdeněk Pavlas wrote:
> ---
>  yum/__init__.py |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/yum/__init__.py b/yum/__init__.py
> index 5b49dbe..cbb9055 100644
> --- a/yum/__init__.py
> +++ b/yum/__init__.py
> @@ -1996,7 +1996,7 @@ class YumBase(depsolve.Depsolve):
>                  continue
>              
>              try:
> -                if i == 1 and not local_size and remote_size == po.size:
> +                if len(remote_pkgs) == 1:
>                      text = os.path.basename(po.relativepath)
>                  else:
>                      text = '(%s/%s): %s' % (i, len(remote_pkgs),
> 

 Ignoring the threading code: NAK.

 So a good idea in cases like this is to read the comment, and then if
that doesn't help ... use "git blame" to get more explanations. Which
gives:

cfe3b834 (James Antill       2008-10-27 00:09:58 -0400 1983)             #  
Recheck if the file is there, works around a couple of weird


...and you can then lookup that commit with "git show", which gives:


commit cfe3b8342976ba05e140d776ba67660c893cabd5
Author: James Antill <[email protected]>
Date:   Mon Oct 27 00:09:58 2008 -0400

    Check if the package has appeared before we try and download it, bug 468401

...and you can then look at
https://bugzilla.redhat.com/show_bug.cgi?id=468401 for the full details.
At which point, if you think that bug has been fixed some other/better
way or if you have an other/better fix ... include that fix, or point to
the fix, before you remove/simplify the code by removing the bugfixes.

_______________________________________________
Yum-devel mailing list
[email protected]
http://lists.baseurl.org/mailman/listinfo/yum-devel

Reply via email to