aboutsummaryrefslogtreecommitdiffstats
path: root/Rpmdrake/open_db.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2007-09-26 15:38:19 +0000
committerThierry Vignaud <tv@mandriva.org>2007-09-26 15:38:19 +0000
commitda85abaf1423d93ac3934a20ba62ea7e33fda0ab (patch)
tree7b8602a2c2e06b28d11672fd3b6809843d21dfcf /Rpmdrake/open_db.pm
parenta332bb81ee939edf20fd0ae27dda57cd6ea67e9f (diff)
downloadrpmdrake-da85abaf1423d93ac3934a20ba62ea7e33fda0ab.tar
rpmdrake-da85abaf1423d93ac3934a20ba62ea7e33fda0ab.tar.gz
rpmdrake-da85abaf1423d93ac3934a20ba62ea7e33fda0ab.tar.bz2
rpmdrake-da85abaf1423d93ac3934a20ba62ea7e33fda0ab.tar.xz
rpmdrake-da85abaf1423d93ac3934a20ba62ea7e33fda0ab.zip
(fast_open_urpmi_db) localize storage of "an error happened on open"
so that further errors won't induce us in exec(edit-urpmi-sources) on next open()
Diffstat (limited to 'Rpmdrake/open_db.pm')
-rw-r--r--Rpmdrake/open_db.pm10
1 files changed, 5 insertions, 5 deletions
diff --git a/Rpmdrake/open_db.pm b/Rpmdrake/open_db.pm
index cf54952c..d724627b 100644
--- a/Rpmdrake/open_db.pm
+++ b/Rpmdrake/open_db.pm
@@ -57,9 +57,9 @@ sub open_rpm_db {
}
# do not pay the urpm::media::configure() heavy cost:
-my $error_happened;
sub fast_open_urpmi_db() {
my $urpm = urpm->new;
+ my $error_happened;
$urpm->{options}{'split-level'} ||= 20;
$urpm->{options}{'split-length'} ||= 1;
$urpm->{options}{'verify-rpm'} = !$::rpmdrake_options{'no-verify-rpm'} if defined $::rpmdrake_options{'no-verify-rpm'};
@@ -76,6 +76,10 @@ sub fast_open_urpmi_db() {
};
urpm::media::read_config($urpm);
+ if ($error_happened) {
+ touch('/etc/urpmi/urpmi.cfg');
+ exec('edit-urpm-sources.pl');
+ }
$urpm;
}
@@ -85,10 +89,6 @@ sub open_urpmi_db() {
my $searchmedia = join(',', map { $_->{name} } grep { $_->{ignore} && $_->{name} =~ /backport/i } @{$urpm->{media}});
urpm::media::configure($urpm, media => $media, if_($searchmedia, searchmedia => $searchmedia));
- if ($error_happened) {
- touch('/etc/urpmi/urpmi.cfg');
- exec('edit-urpm-sources.pl');
- }
$urpm;
}