summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorLandry Breuil <landry@cvs.openbsd.org>2010-06-05 07:35:22 +0000
committerLandry Breuil <landry@cvs.openbsd.org>2010-06-05 07:35:22 +0000
commit7c13fd24dc96ef7c6e39c867ba601a1d9b1cb3cf (patch)
tree87993ee662cf402b806f0683153487b5a5aa235e /usr.sbin
parentcd1fedad8d745b7c54dc654f9a9cb92dc643af21 (diff)
Move ask_list() method to $state object like it's done for confirm(), so
that it can be overriden. Change callers accordingly. ok espie@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/AddDelete.pm12
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Dependencies.pm4
2 files changed, 12 insertions, 4 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/AddDelete.pm b/usr.sbin/pkg_add/OpenBSD/AddDelete.pm
index ecf151b91be..284a5824a4f 100644
--- a/usr.sbin/pkg_add/OpenBSD/AddDelete.pm
+++ b/usr.sbin/pkg_add/OpenBSD/AddDelete.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: AddDelete.pm,v 1.21 2010/06/04 13:19:39 espie Exp $
+# $OpenBSD: AddDelete.pm,v 1.22 2010/06/05 07:35:21 landry Exp $
#
# Copyright (c) 2007-2010 Marc Espie <espie@openbsd.org>
#
@@ -272,7 +272,7 @@ sub choose_location
$h{'<None>'} = undef;
$state->progress->clear;
- my $result = OpenBSD::Interactive::ask_list("Ambiguous: choose package for $name", 1, sort keys %h);
+ my $result = $state->ask_list("Ambiguous: choose package for $name", 1, sort keys %h);
return $h{$result};
} else {
$state->errsay("Ambiguous: $name could be ", join(' ', keys %h));
@@ -289,6 +289,14 @@ sub confirm
return OpenBSD::Interactive::confirm($prompt, $default);
}
+sub ask_list
+{
+ my ($state, $prompt, $interactive, @values) = @_;
+
+ require OpenBSD::Interactive;
+ return OpenBSD::Interactive::ask_list($prompt, $interactive, @values);
+}
+
sub status
{
my $self = shift;
diff --git a/usr.sbin/pkg_add/OpenBSD/Dependencies.pm b/usr.sbin/pkg_add/OpenBSD/Dependencies.pm
index 29c1ea51faa..80c793f16cd 100644
--- a/usr.sbin/pkg_add/OpenBSD/Dependencies.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Dependencies.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Dependencies.pm,v 1.127 2010/06/04 13:19:39 espie Exp $
+# $OpenBSD: Dependencies.pm,v 1.128 2010/06/05 07:35:21 landry Exp $
#
# Copyright (c) 2005-2010 Marc Espie <espie@openbsd.org>
#
@@ -421,7 +421,7 @@ sub find_dep_in_repositories
# put default first if available
@pkgs = ((grep {$_ eq $dep->{def}} @pkgs),
(sort (grep {$_ ne $dep->{def}} @pkgs)));
- my $good = OpenBSD::Interactive::ask_list(
+ my $good = $state->ask_list(
'Ambiguous: choose dependency for '.$self->{set}->print.': ',
$state->{interactive}, @pkgs);
return $c{$good};