summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD/Replace.pm
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2009-11-17 10:17:22 +0000
committerMarc Espie <espie@cvs.openbsd.org>2009-11-17 10:17:22 +0000
commit4f7b53e4d01762600ddb128163bee581409a6376 (patch)
tree18ec1531f509bee1cf4febd9e83eafd4b4f3e2cb /usr.sbin/pkg_add/OpenBSD/Replace.pm
parentbdc4f7bbc858fd387ca9ad4f569e46dfe7322acc (diff)
revamp interactive stuff: simplify (just one always for everything, per
theo suggestion. Also go through the "state" object which simplifies code a great deal)
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/Replace.pm')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Replace.pm10
1 files changed, 4 insertions, 6 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Replace.pm b/usr.sbin/pkg_add/OpenBSD/Replace.pm
index b87f9c52192..f22b5c73957 100644
--- a/usr.sbin/pkg_add/OpenBSD/Replace.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Replace.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Replace.pm,v 1.54 2009/11/11 12:32:03 espie Exp $
+# $OpenBSD: Replace.pm,v 1.55 2009/11/17 10:17:21 espie Exp $
#
# Copyright (c) 2004-2006 Marc Espie <espie@openbsd.org>
#
@@ -18,7 +18,6 @@ use strict;
use warnings;
use OpenBSD::Delete;
-use OpenBSD::Interactive;
package OpenBSD::PackingElement;
sub can_update
@@ -239,7 +238,7 @@ sub validate_depend
$state->{forcedupdates}->{$wanting} = 1;
} elsif ($state->{interactive}) {
- if (OpenBSD::Interactive::confirm("Forward dependency of $wanting on $toreplace doesn't match $replacement, proceed with update anyways", 1, 0, 'updatedepends')) {
+ if ($state->confirm("Forward dependency of $wanting on $toreplace doesn't match $replacement, proceed with update anyways", 0)) {
$state->{forcedupdates} = {} unless defined $state->{forcedupdates};
$state->{forcedupdates}->{$wanting} = 1;
} else {
@@ -293,7 +292,6 @@ use OpenBSD::RequiredBy;
use OpenBSD::PackingList;
use OpenBSD::PackageInfo;
use OpenBSD::Error;
-use OpenBSD::Interactive;
sub perform_extraction
{
@@ -326,7 +324,7 @@ sub can_old_package_be_replaced
$state->{okay} = 1;
} elsif ($state->{interactive}) {
- if (OpenBSD::Interactive::confirm("proceed with update anyways", 1, 0, 'update')) {
+ if ($state->confirm("proceed with update anyways", 0)) {
$state->{okay} = 1;
}
}
@@ -369,7 +367,7 @@ sub is_new_package_safe
$state->errsay("(forcing update)");
$state->{okay} = 1;
} elsif ($state->{interactive}) {
- if (OpenBSD::Interactive::confirm("proceed with update anyways", 1, 0, 'update')) {
+ if ($state->confirm("proceed with update anyways", 0)) {
$state->{okay} = 1;
}
}