summaryrefslogtreecommitdiffstats
path: root/urpme
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-04-14 13:47:02 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-04-14 13:47:02 +0000
commit0c8f651988b155d12deb3aea26c2f206648c61e5 (patch)
tree9bebdb61d92b19c9db9b98a15efdf8e8d3cf7fae /urpme
parentfadf35a458884372e139c97282a333f4a0d84f25 (diff)
downloadurpmi-0c8f651988b155d12deb3aea26c2f206648c61e5.tar
urpmi-0c8f651988b155d12deb3aea26c2f206648c61e5.tar.gz
urpmi-0c8f651988b155d12deb3aea26c2f206648c61e5.tar.bz2
urpmi-0c8f651988b155d12deb3aea26c2f206648c61e5.tar.xz
urpmi-0c8f651988b155d12deb3aea26c2f206648c61e5.zip
Factorize the message/prompt/I18N code of urpm* in a separate module
Diffstat (limited to 'urpme')
-rw-r--r--urpme30
1 files changed, 2 insertions, 28 deletions
diff --git a/urpme b/urpme
index 3e1a1070..1d5686d1 100644
--- a/urpme
+++ b/urpme
@@ -23,8 +23,9 @@
use strict;
use urpm;
use urpm::args;
+use urpm::msg;
-our ($root, $test, $parallel, $auto, $matches, $verbose, $maymatch, $usedistrib, $force, $bug, @l);
+our ($root, $test, $parallel, $auto, $matches, $verbose, $maymatch, $usedistrib, $force, @l);
my $askok = N("Is this OK?");
# Translator: Add here the keys which might be pressed in the "No"-case.
my $noexpr = N("Nn");
@@ -112,30 +113,3 @@ sub toMb {
my $nb = $_[0] / 1024 / 1024;
int $nb + 0.5;
}
-
-sub message_input {
- my ($msg, $default_input, %options) = @_;
- my $input;
- my $noexpr = N("Nn");
- my $yesexpr = N("Yy");
-
- while (1) {
- print STDOUT $msg;
- if ($default_input) {
- $bug and log_it($input);
- return $default_input;
- }
- $input = <STDIN>;
- defined $input or return undef;
- $bug and log_it($input);
- if ($options{boolean}) {
- $input =~ /^[$noexpr$yesexpr]*$/ and last;
- } elsif ($options{range}) {
- 1 <= $input && $input <= $options{range} and last;
- } else {
- last;
- }
- print STDOUT N("Sorry, bad choice, try again\n")."\n";
- }
- return $input;
-}