On Wed, 2013-05-15 at 13:23 +0200, Zdenek Pavlas wrote:
> Move the callback_total call out of the retry loop.
> Don't reset remote_size and remote_pkgs when retrying.

 Seems like it should solve the problem, but might be worth changing
some variable names to make it clearer (10+ yr maintenance ftw :).
 Added some comments inline you might want to look at, but ACK anyway.

> ---
>  yum/__init__.py | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/yum/__init__.py b/yum/__init__.py
> index 50e2fad..cbb20c0 100644
> --- a/yum/__init__.py
> +++ b/yum/__init__.py
> @@ -2319,6 +2319,7 @@ much more problems).
>              self.closeRpmDB()
>              self.doUnlock()
>  
> +        all_tries = remote_pkgs

 Maybe all_remote_pkgs and use remote_pkgs[:], so we don't accidentally
do anything to it?

> @@ -2409,13 +2408,15 @@ much more problems).
>  
>              # there were drpm related errors *only*
>              remote_pkgs = []
> -            remote_size = 0

 Having these with the "same" name but different scope lifetimes is kind
of annoying, but then renaming the later seems like some decent code
churn too :(.

_______________________________________________
Yum-devel mailing list
Yum-devel@lists.baseurl.org
http://lists.baseurl.org/mailman/listinfo/yum-devel

Reply via email to