aboutsummaryrefslogtreecommitdiffstats
path: root/Rpmdrake
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2007-08-24 21:09:21 +0000
committerThierry Vignaud <tv@mandriva.org>2007-08-24 21:09:21 +0000
commit05ce90f24bfbdbf868d2f0aba50e1b88e862d7c0 (patch)
tree9be0d5226f09aeb0468bd8fe126f486adcd68493 /Rpmdrake
parent9e37cd702e2158510935a48552ab1a3a958986cc (diff)
downloadrpmdrake-05ce90f24bfbdbf868d2f0aba50e1b88e862d7c0.tar
rpmdrake-05ce90f24bfbdbf868d2f0aba50e1b88e862d7c0.tar.gz
rpmdrake-05ce90f24bfbdbf868d2f0aba50e1b88e862d7c0.tar.bz2
rpmdrake-05ce90f24bfbdbf868d2f0aba50e1b88e862d7c0.tar.xz
rpmdrake-05ce90f24bfbdbf868d2f0aba50e1b88e862d7c0.zip
(open_urpmi_db) fix crash if no backport medium is configured (aka no
std configuration, #32815)
Diffstat (limited to 'Rpmdrake')
-rwxr-xr-xRpmdrake/pkg.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm
index eed64ba0..087c200e 100755
--- a/Rpmdrake/pkg.pm
+++ b/Rpmdrake/pkg.pm
@@ -245,8 +245,8 @@ sub open_urpmi_db() {
my $media = ref $::options{media} ? join(',', @{$::options{media}}) : '';
urpm::media::configure($urpm, media => $media);
# urpmi only support one search media, hance we'll only support "Main backport":
- my $searchmedia = (grep { $_->{ignore} && $_->{name} =~ /backport/i } @{$urpm->{media}})[0]->{name};
- urpm::media::configure($urpm, media => $media, searchmedia => $searchmedia);
+ my ($searchmedia) = grep { $_->{ignore} && $_->{name} =~ /backport/i } @{$urpm->{media}};
+ urpm::media::configure($urpm, media => $media, if_($searchmedia, searchmedia => $searchmedia->{name}));
if ($error_happened) {
touch('/etc/urpmi/urpmi.cfg');
exec('edit-urpm-sources.pl');