aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2008-01-25 18:57:58 +0000
committerThierry Vignaud <tv@mandriva.org>2008-01-25 18:57:58 +0000
commite1974cbb326052dd3ed48a3d1fb26fc6fadec385 (patch)
treed42f030144f9ce2eaff11a2677effde8ac17f59f
parent03f7fd52394f3c172c9035ae507de7355150374c (diff)
downloadrpmdrake-e1974cbb326052dd3ed48a3d1fb26fc6fadec385.tar
rpmdrake-e1974cbb326052dd3ed48a3d1fb26fc6fadec385.tar.gz
rpmdrake-e1974cbb326052dd3ed48a3d1fb26fc6fadec385.tar.bz2
rpmdrake-e1974cbb326052dd3ed48a3d1fb26fc6fadec385.tar.xz
rpmdrake-e1974cbb326052dd3ed48a3d1fb26fc6fadec385.zip
(get_inactive_backport_media) split it out of open_urpmi_db() (needed
for next commit)
-rw-r--r--Rpmdrake/open_db.pm9
1 files changed, 7 insertions, 2 deletions
diff --git a/Rpmdrake/open_db.pm b/Rpmdrake/open_db.pm
index 78ad25cd..ecffd7c0 100644
--- a/Rpmdrake/open_db.pm
+++ b/Rpmdrake/open_db.pm
@@ -31,7 +31,7 @@ use urpm;
use Exporter;
our @ISA = qw(Exporter);
-our @EXPORT = qw(fast_open_urpmi_db open_rpm_db open_urpmi_db);
+our @EXPORT = qw(fast_open_urpmi_db get_inactive_backport_media open_rpm_db open_urpmi_db);
# because rpm blocks some signals when rpm DB is opened, we don't keep open around:
@@ -84,12 +84,17 @@ sub fast_open_urpmi_db() {
$urpm;
}
+sub get_inactive_backport_media {
+ my ($urpm) = @_;
+ map { $_->{name} } grep { $_->{ignore} && $_->{name} =~ /backport/i } @{$urpm->{media}}
+}
+
sub open_urpmi_db {
my (%urpmi_options) = @_;
my $urpm = fast_open_urpmi_db();
my $media = ref $::rpmdrake_options{media} ? join(',', @{$::rpmdrake_options{media}}) : '';
- my $searchmedia = join(',', map { $_->{name} } grep { $_->{ignore} && $_->{name} =~ /backport/i } @{$urpm->{media}});
+ my $searchmedia = join(',', get_inactive_backport_media($urpm));
$urpm->{lock} = urpm::lock::urpmi_db($urpm, undef, wait => $urpm->{options}{wait_lock});
urpm::media::configure($urpm, media => $media, if_($searchmedia, searchmedia => $searchmedia), %urpmi_options);
$urpm;