summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perl-install/NEWS2
-rw-r--r--perl-install/do_pkgs.pm18
2 files changed, 13 insertions, 7 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS
index 9fa51ab76..e5568d3b5 100644
--- a/perl-install/NEWS
+++ b/perl-install/NEWS
@@ -1,3 +1,5 @@
+- do_pkgs: do not reload urpmi media at every check for package availability
+
Version 11.10.2 - 18 August 2008
- reakky fix another focus bug (#42750)
diff --git a/perl-install/do_pkgs.pm b/perl-install/do_pkgs.pm
index bc2196c3a..37d92c9a8 100644
--- a/perl-install/do_pkgs.pm
+++ b/perl-install/do_pkgs.pm
@@ -189,6 +189,7 @@ package do_pkgs_standalone;
use run_program;
use common;
use log;
+use feature qw(state);
our @ISA = qw(do_pkgs_common);
@@ -231,14 +232,17 @@ sub are_available {
my ($_do, @pkgs) = @_;
my %pkgs = map { $_ => 1 } @pkgs;
+ require urpm::media;
+ state $urpm;
eval {
- require urpm::media;
- my $urpm = urpm->new;
- $urpm->{log} = \&log::l;
- urpm::media::configure($urpm,
- nocheck_access => 1,
- no_skiplist => 1,
- no_second_pass => 1);
+ if (!$urpm) {
+ $urpm = urpm->new;
+ $urpm->{log} = \&log::l;
+ urpm::media::configure($urpm,
+ nocheck_access => 1,
+ no_skiplist => 1,
+ no_second_pass => 1);
+ }
map { $_->name } grep { $pkgs{$_->name} } @{$urpm->{depslist} || []};
};
}