summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--urpm/msg.pm5
-rwxr-xr-xurpmi6
2 files changed, 8 insertions, 3 deletions
diff --git a/urpm/msg.pm b/urpm/msg.pm
index c61a9187..f9cd07e1 100644
--- a/urpm/msg.pm
+++ b/urpm/msg.pm
@@ -102,6 +102,11 @@ sub bug_log {
}
}
+sub ask_yes_or_no {
+ my ($msg) = @_;
+ message_input_($msg . N(" (y/N) "), boolean => 1) =~ /[$yesexpr]/;
+}
+
#- deprecated, use message_input_() instead
sub message_input { &_message_input }
diff --git a/urpmi b/urpmi
index 45203cbc..1688e4e5 100755
--- a/urpmi
+++ b/urpmi
@@ -538,7 +538,7 @@ have to be removed for others to be upgraded:\n%s\n", $list);
print "$msg\n";
} else {
my $yesexpr = N("Yy");
- $force || message_input_($msg . N(" (y/N) "), boolean => 1) =~ /[$yesexpr]/ or exit 0;
+ $force || urpm::msg::ask_yes_or_no($msg) or exit 0;
}
}
@@ -633,13 +633,13 @@ my $exit_code = urpm::main_loop::run($urpm, $state,
0;
} else {
my $yesexpr = N("Yy");
- $force || message_input_("$msg$msg2" . N(" (y/N) "), boolean => 1) =~ /[$yesexpr]/;
+ $force || urpm::msg::ask_yes_or_no("$msg$msg2");
}
},
ask_yes_or_no => sub {
my ($_title, $msg) = @_; # graphical title
my $yesexpr = N("Yy");
- $force || message_input_($msg . N(" (y/N) "), boolean => 1) =~ /[$yesexpr]/;
+ $force || urpm::msg::ask_yes_or_no($msg);
},
need_restart => sub {
my ($need_restart_formatted) = @_;