[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#674143: lsb-release is very slow



tags 674143 +pending
thanks

Hi François, and thanks for your bugreport.

Le 23.05.2012 12:54, Francois Gouget a écrit :
> lsb-release is very slow
> 
> The patch below works around this issue for non-testing Debian versions by not
> calling guess_release_from_apt() if we don't need to. This gets the execution
> time down to 0.03 seconds. Unfortunately this does not help me since I'm
> running Debian Testing :-(
> 
> --- /usr/share/pyshared/lsb_release.py.orig	2012-05-23 11:59:21.909934400 +0200
> +++ /usr/share/pyshared/lsb_release.py	2012-05-23 12:12:59.281968570 +0200
> @@ -270,8 +270,10 @@ def guess_debian_release():
>      # This is slightly faster and less error prone in case the user
>      # has an entry in his /etc/apt/sources.list but has not actually
>      # upgraded the system.
> -    rinfo = guess_release_from_apt()
> -    if rinfo and not distinfo.get('CODENAME'):
> +    rinfo = None
> +    if not distinfo.get('CODENAME'):
> +        rinfo = guess_release_from_apt()
> +    if rinfo:
>          release = rinfo.get('version')
>  
>          # Special case Debian-Ports as their Release file has 'version': '1.0'

Ironically, I had spotted this enhancement 4 hours earlier [d284c9d]
during the writing of the testsuite for lsb_release. As this commit
bundled two different things, I have now divided it in two commits
[cabfb66] and [d7a416c] to grant you credits for the report.

It will definitely be part of the next release, hence +pending.

[d284c9d]
http://anonscm.debian.org/gitweb/?p=users/odyx-guest/lsb.git;a=commitdiff;h=d284c9d
[cabfb66]
http://anonscm.debian.org/gitweb/?p=users/odyx-guest/lsb.git;a=commitdiff;h=cabfb66
[d7a416c]
http://anonscm.debian.org/gitweb/?p=users/odyx-guest/lsb.git;a=commitdiff;h=d7a416c

Thanks again, cheers,

OdyX

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: