diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2002-10-14 09:03:34 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2002-10-14 09:03:34 +0000 |
commit | fcf04b54434c7d4e433759a654479bdc77edef09 (patch) | |
tree | 18cb3740b87610fa091ad7a0070e4da92f4bb6e5 /perl-install | |
parent | 8b907b38986cb9dfb56d6f282352b5b3bc67bbc7 (diff) | |
download | drakx-fcf04b54434c7d4e433759a654479bdc77edef09.tar drakx-fcf04b54434c7d4e433759a654479bdc77edef09.tar.gz drakx-fcf04b54434c7d4e433759a654479bdc77edef09.tar.bz2 drakx-fcf04b54434c7d4e433759a654479bdc77edef09.tar.xz drakx-fcf04b54434c7d4e433759a654479bdc77edef09.zip |
- fix typos
- when something is eating io bandwith, drakbug is very slow to scroll
the menu, since on each item selection, it does rpm db
access. solution :
o cache rpm result in %packages
o only call rpm & which if nothing is cached
- if there's the selected package isn't installed, just print "package
not installed" (and translate that)
Diffstat (limited to 'perl-install')
-rwxr-xr-x | perl-install/standalone/drakbug | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/perl-install/standalone/drakbug b/perl-install/standalone/drakbug index a6715bfbd..5957a07b3 100755 --- a/perl-install/standalone/drakbug +++ b/perl-install/standalone/drakbug @@ -1,7 +1,7 @@ #!/usr/bin/perl # Drak Bug Report -# C$opyright (C) 2002 MandrakeSoft (daouda@mandrakesoft.com) +# Copyright (C) 2002 MandrakeSoft (daouda@mandrakesoft.com) # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -171,11 +171,18 @@ sub update_app { $app_choice ne '' ? $package->set_text("$app_choice") : $package->set_text(_("Not installed")); } +my %packages; + sub get_package { my ($executable) = @_; my ($rpm_package, $which_app); - $which_app = chomp_(`which '$executable' 2> /dev/null`); - $rpm_package = chomp_(`rpm -qf '$which_app' 2>&1`); + $rpm_package = $packages{$executable}; + if (!defined $rpm_package) { + $which_app = chomp_(`which '$executable' 2> /dev/null`); + # deush, rpm can takes some time aka it'll sleeps if something has opened rpm db ! + $rpm_package = $which_app eq "" ? _("Package not installed") : chomp_(`rpm -qf '$which_app' 2>&1`); + $packages{$executable} = $rpm_package; + } $rpm_package; } |