summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-09-10 16:19:03 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-09-10 16:19:03 +0000
commitcab13c537afddd8915df0c90735c3a7b65fb22d2 (patch)
tree67d5cc3e17e0bb7492538fc5641234ab476d6853 /urpm
parentf9a92cd5222952f32dec99d5f63086eecfb2cd1b (diff)
downloadurpmi-cab13c537afddd8915df0c90735c3a7b65fb22d2.tar
urpmi-cab13c537afddd8915df0c90735c3a7b65fb22d2.tar.gz
urpmi-cab13c537afddd8915df0c90735c3a7b65fb22d2.tar.bz2
urpmi-cab13c537afddd8915df0c90735c3a7b65fb22d2.tar.xz
urpmi-cab13c537afddd8915df0c90735c3a7b65fb22d2.zip
- urpmi, urpme
o do not prompt questions if not waiting for user answer (for urpmi --force or urpme --force) create message_input_() which deprecated message_input(), $o_default_input is dumb IMO
Diffstat (limited to 'urpm')
-rw-r--r--urpm/msg.pm14
1 files changed, 11 insertions, 3 deletions
diff --git a/urpm/msg.pm b/urpm/msg.pm
index 31719dbc..daa1c55e 100644
--- a/urpm/msg.pm
+++ b/urpm/msg.pm
@@ -15,7 +15,7 @@ BEGIN {
(our $VERSION) = q($Revision$) =~ /(\d+)/;
our @ISA = 'Exporter';
-our @EXPORT = qw(N P translate bug_log message_input toMb formatXiB sys_log);
+our @EXPORT = qw(N P translate bug_log message_input message_input_ toMb formatXiB sys_log);
#- I18N.
use Locale::gettext;
@@ -88,17 +88,25 @@ sub bug_log {
}
}
-sub message_input {
+#- deprecated, use message_input_() instead
+sub message_input { &_message_input }
+
+sub message_input_ {
+ my ($msg, %o_opts) = @_;
+ _message_input($msg, undef, %o_opts);
+}
+sub _message_input {
my ($msg, $o_default_input, %o_opts) = @_;
my $input;
while (1) {
print $msg;
if ($o_default_input) {
+ #- deprecated argument. don't you want to use $o_opts{default} instead?
$urpm::args::options{bug} and bug_log($o_default_input);
return $o_default_input;
}
$input = <STDIN>;
- defined $input or return undef;
+ defined $input or return $o_opts{default};
chomp $input;
$urpm::args::options{bug} and bug_log($input);
if ($o_opts{boolean}) {