aboutsummaryrefslogtreecommitdiffstats
path: root/Rpmdrake/pkg.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2007-03-23 06:14:59 +0000
committerThierry Vignaud <tv@mandriva.org>2007-03-23 06:14:59 +0000
commitbcb9a5ddf3ea81ef41c9c45cceacb23407679ea1 (patch)
tree0f25d63bd2504abe3d82b6df6fc067ff785ff3e8 /Rpmdrake/pkg.pm
parent10dd6a21953dd40dc48d4aa36e6435785f909912 (diff)
downloadrpmdrake-bcb9a5ddf3ea81ef41c9c45cceacb23407679ea1.tar
rpmdrake-bcb9a5ddf3ea81ef41c9c45cceacb23407679ea1.tar.gz
rpmdrake-bcb9a5ddf3ea81ef41c9c45cceacb23407679ea1.tar.bz2
rpmdrake-bcb9a5ddf3ea81ef41c9c45cceacb23407679ea1.tar.xz
rpmdrake-bcb9a5ddf3ea81ef41c9c45cceacb23407679ea1.zip
(warn_about_media) split it out of get_pkgs()
Diffstat (limited to 'Rpmdrake/pkg.pm')
-rwxr-xr-xRpmdrake/pkg.pm75
1 files changed, 40 insertions, 35 deletions
diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm
index d1833ef7..f303bad1 100755
--- a/Rpmdrake/pkg.pm
+++ b/Rpmdrake/pkg.pm
@@ -171,43 +171,11 @@ sub formatlistpkg { join("\n", sort { uc($a) cmp uc($b) } @_) }
# -=-=-=---=-=-=---=-=-=-- install packages -=-=-=---=-=-=---=-=-=-
+my (@update_medias, $is_update_media_already_asked);
-our $probe_only_for_updates;
-sub get_pkgs {
- my ($urpm, $opts) = @_;
+sub warn_about_media {
+ my ($urpm, $w, $opts) = @_;
my $update_name = 'update_source';
- my %update_descr;
- my @update_medias;
- my $w = $::main_window;
- my $is_update_media_already_asked if 0;
-
- my $error_happened;
- my $fatal_handler = sub {
- $error_happened = 1;
- interactive_msg(N("Fatal error"),
- N("A fatal error occurred: %s.", $_[1]));
- myexit(-1) if 0; #FIXME
- };
-
- Rpmdrake::gurpm::init(1 ? N("Please wait") : N("Package installation..."), N("Initializing..."), transient => $::main_window);
- my $_guard = before_leaving { Rpmdrake::gurpm::end() };
- my $_flush_guard = Gtk2::GUI_Update_Guard->new;
-
- $urpm = urpm->new;
- $urpm->{fatal} = $fatal_handler;
- my $media = ref $::options{media} ? join(',', @{$::options{media}}) : '';
- urpm::media::configure($urpm, media => $media);
- if ($error_happened) {
- touch('/etc/urpmi/urpmi.cfg');
- exec('edit-urpm-sources.pl');
- }
-
- my $_lock = urpm::lock::urpmi_db($urpm);
- my $statedir = $urpm->{statedir};
- @update_medias = grep { !$_->{ignore} && $_->{update} } @{$urpm->{media}};
-
-
- $urpm->{fatal} = $fatal_handler;
if (member($::default_list_mode, qw(all_updates security bugfix normal))) {
unless ($::options{'no-media-update'}) {
if (@update_medias > 0) {
@@ -249,6 +217,43 @@ Then, restart %s.", $rpmdrake::myname_update)), myexit(-1);
}
}
}
+}
+
+our $probe_only_for_updates;
+sub get_pkgs {
+ my ($urpm, $opts) = @_;
+ my %update_descr;
+ @update_medias = ();
+ my $w = $::main_window;
+
+ my $error_happened;
+ my $fatal_handler = sub {
+ $error_happened = 1;
+ interactive_msg(N("Fatal error"),
+ N("A fatal error occurred: %s.", $_[1]));
+ myexit(-1) if 0; #FIXME
+ };
+
+ Rpmdrake::gurpm::init(1 ? N("Please wait") : N("Package installation..."), N("Initializing..."), transient => $::main_window);
+ my $_guard = before_leaving { Rpmdrake::gurpm::end() };
+ my $_flush_guard = Gtk2::GUI_Update_Guard->new;
+
+ $urpm = urpm->new;
+ $urpm->{fatal} = $fatal_handler;
+ my $media = ref $::options{media} ? join(',', @{$::options{media}}) : '';
+ urpm::media::configure($urpm, media => $media);
+ if ($error_happened) {
+ touch('/etc/urpmi/urpmi.cfg');
+ exec('edit-urpm-sources.pl');
+ }
+
+ my $_lock = urpm::lock::urpmi_db($urpm);
+ my $statedir = $urpm->{statedir};
+ @update_medias = grep { !$_->{ignore} && $_->{update} } @{$urpm->{media}};
+
+ $urpm->{fatal} = $fatal_handler;
+
+ warn_about_media($urpm, $w, $opts);
Rpmdrake::gurpm::label(N("Reading updates description"));
Rpmdrake::gurpm::progress(0.05);