summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-01-24 18:38:56 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-01-24 18:38:56 +0000
commit5172e1a46444f54abcced42478bf5af17e48215b (patch)
tree2d5176c9f4f9c92b07d34d90dfed35dc6f0f0fa4
parentc90ed08c8cc82eccd61470df90341e2c03dec469 (diff)
downloadurpmi-5172e1a46444f54abcced42478bf5af17e48215b.tar
urpmi-5172e1a46444f54abcced42478bf5af17e48215b.tar.gz
urpmi-5172e1a46444f54abcced42478bf5af17e48215b.tar.bz2
urpmi-5172e1a46444f54abcced42478bf5af17e48215b.tar.xz
urpmi-5172e1a46444f54abcced42478bf5af17e48215b.zip
urpmi --gui will now ask with a GUI popup to change media. Intended
to be used with --auto (so other annoying dialogs are not shown)
-rw-r--r--urpm/args.pm1
-rwxr-xr-xurpmi11
2 files changed, 11 insertions, 1 deletions
diff --git a/urpm/args.pm b/urpm/args.pm
index 74e93a4a..f953ce88 100644
--- a/urpm/args.pm
+++ b/urpm/args.pm
@@ -58,6 +58,7 @@ my %options_spec = (
'synthesis=s' => \$::synthesis,
auto => sub { $urpm->{options}{auto} = 1 },
'allow-medium-change' => \$::allow_medium_change,
+ 'gui' => \$::gui,
'auto-select' => \$::auto_select,
'no-remove|no-uninstall' => \$::no_remove,
keep => sub { $urpm->{options}{keep} = 1 },
diff --git a/urpmi b/urpmi
index 4b767ffc..d10a49c2 100755
--- a/urpmi
+++ b/urpmi
@@ -487,7 +487,16 @@ $urpm->copy_packages_of_removable_media(
ask_for_medium => (!$urpm->{options}{auto} || $allow_medium_change) && sub {
my $msg = N("Please insert the medium named \"%s\" on device [%s]", $_[0], $_[1]);
my $msg2 = N("Press Enter when ready...");
- defined message_input("$msg\n$msg2 ");
+ if (our $gui) {
+ #- probably run from a drak tool
+ my $gmessage = find { -x $_ } '/usr/X11R6/bin/gmessage', '/usr/bin/gmessage';
+ if ($gmessage) {
+ my $m = to_utf8("\n$msg\n\n$msg2");
+ system($gmessage, $m);
+ return 1;
+ }
+ }
+ return defined message_input("$msg\n$msg2 ");
},
);