Bug#674143: lsb-release is very slow
Didier Raboud <[email protected]>
| Newsgroups | gmane.linux.debian.devel.lsb |
|---|---|
| Organization | EPFL - GR-KA |
| Message-ID | <[email protected]> |
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
signature.asc
(application/pgp-signature, 663 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (MingW32) iQGcBAEBAgAGBQJPvOBLAAoJEIvPpx7KFjRVsCUL/36SKRKoklfUUrP/ziBEVGLQ DUlwQjSAee2zqEQAxiYobDInFh0VDqcnZ+h4aar+naycG2fSAaSvgx4+8gn5PGBD +BM3Ad6ChawM23DBg1IUlJ37ghRbtjNQWmDY3s5wOelRZrMERNSsWPQZZ5UvgooN QPqCSruMgPMpUPw6C42U39sygeOgZGzzf6gcM1URrK2jwdi3y3+H6W0Ji0zXmmvS hmOe9BcjgnnRFw8oqVKsJYRjE7vR4tE+TE3TTIyFYTnIE4ZPBymy2rGZRn0a6STi cnnD+NAsyrk74cUDC5bobGdOA2IZVnRBYzu+0yKgWH24LSLHY2/MsvR0i7qRIWzE 5YQLCRtshTlmN+ObZK59PUn9fZE+1tysFeSSL2ft1g7iQpdpA8T+UFBB5+xa3xe9 xcEW65NF029H+Vik2CLdJjCTyqsSNji2NBKDwQW0l9SJ5yQFhv1PA/0YiPvkH/zT zwnDKRAZf0g1XGLdca81hHAW9pxPLB4j/MFi1LvSUQ== =pGby -----END PGP SIGNATURE-----