summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2012-07-06 12:02:51 +0000
committerMarc Espie <espie@cvs.openbsd.org>2012-07-06 12:02:51 +0000
commite721a86e66cd503bece4902f13e35794a7a6e13f (patch)
tree024657e4d698af75cebf51dc967a0d0bf03def0d /usr.sbin/pkg_add
parentf2aa7c9f7e760d1b9b5191128e160720dcce7cae (diff)
have -i be automatically on for ttys.
use -i/-I to force interactive/non interactive mode (-I for not running scripts has been dead for years)
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/AddDelete.pm14
-rw-r--r--usr.sbin/pkg_add/pkg_add.114
-rw-r--r--usr.sbin/pkg_add/pkg_delete.111
3 files changed, 28 insertions, 11 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/AddDelete.pm b/usr.sbin/pkg_add/OpenBSD/AddDelete.pm
index bdc78d9f23b..e8fcb0393b0 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.53 2011/10/09 16:43:50 espie Exp $
+# $OpenBSD: AddDelete.pm,v 1.54 2012/07/06 12:02:50 espie Exp $
#
# Copyright (c) 2007-2010 Marc Espie <espie@openbsd.org>
#
@@ -171,12 +171,20 @@ sub handle_options
}
# XXX RequiredBy
$main::not = $state->{not};
- $state->{interactive} = $state->opt('i');
+ if ($state->opt('i') && $state->opt('I')) {
+ $state->usage("-i and -I are reverse options, make up your mind");
+ }
+ if ($state->opt('i')) {
+ $state->{interactive} = 1;
+ } elsif ($state->opt('I')) {
+ $state->{interactive} = 0;
+ } else {
+ $state->{interactive} = -t STDIN;
+ }
$state->{localbase} = $state->opt('L') // OpenBSD::Paths->localbase;
$state->{size_only} = $state->opt('s');
$state->{quick} = $state->opt('q') || $state->config->istrue("nochecksum");
$state->{extra} = $state->opt('c');
- $state->{dont_run_scripts} = $state->opt('I');
$state->{automatic} = $state->opt('a') // 0;
$ENV{'PKG_DELETE_EXTRA'} = $state->{extra} ? "Yes" : "No";
if ($state->{not}) {
diff --git a/usr.sbin/pkg_add/pkg_add.1 b/usr.sbin/pkg_add/pkg_add.1
index 76caaa04868..1612534efd3 100644
--- a/usr.sbin/pkg_add/pkg_add.1
+++ b/usr.sbin/pkg_add/pkg_add.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: pkg_add.1,v 1.112 2012/06/08 15:15:58 espie Exp $
+.\" $OpenBSD: pkg_add.1,v 1.113 2012/07/06 12:02:50 espie Exp $
.\"
.\" Documentation and design originally from FreeBSD. All the code has
.\" been rewritten since. We keep the documentation's notice:
@@ -15,7 +15,7 @@
.\" Jordan K. Hubbard
.\"
.\"
-.Dd $Mdocdate: June 8 2012 $
+.Dd $Mdocdate: July 6 2012 $
.Dt PKG_ADD 1
.Os
.Sh NAME
@@ -24,7 +24,7 @@
.Sh SYNOPSIS
.Nm pkg_add
.Bk -words
-.Op Fl acimnqrsUuvxz
+.Op Fl acIimnqrsUuvxz
.Op Fl A Ar arch
.Op Fl B Ar pkg-destdir
.Op Fl D Ar name Ns Op = Ns Ar value
@@ -153,7 +153,10 @@ In case of ambiguities, for instance:
.Nm
will error out, unless it is invoked in interactive mode
.Po
+default when invoked on a tty, see
option
+.Fl I
+and
.Fl i
.Pc .
.Pp
@@ -282,8 +285,11 @@ external scripts may fail.
.It Ar updatedepends
force update even if forward dependencies no longer match.
.El
+.It Fl I
+Force non-interactive mode.
+Default is to be interactive when run from a tty.
.It Fl i
-Switch on interactive mode.
+Force interactive mode, even if not run from a tty.
.Nm
may ask questions to the user if faced with difficult decisions.
.It Fl L Ar localbase
diff --git a/usr.sbin/pkg_add/pkg_delete.1 b/usr.sbin/pkg_add/pkg_delete.1
index 61c21f0e30a..91b19552b37 100644
--- a/usr.sbin/pkg_add/pkg_delete.1
+++ b/usr.sbin/pkg_add/pkg_delete.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: pkg_delete.1,v 1.45 2011/12/02 16:01:17 jmc Exp $
+.\" $OpenBSD: pkg_delete.1,v 1.46 2012/07/06 12:02:50 espie Exp $
.\"
.\" Documentation and design originally from FreeBSD. All the code has
.\" been rewritten since. We keep the documentation's notice:
@@ -15,7 +15,7 @@
.\" Jordan K. Hubbard
.\"
.\"
-.Dd $Mdocdate: December 2 2011 $
+.Dd $Mdocdate: July 6 2012 $
.Dt PKG_DELETE 1
.Os
.Sh NAME
@@ -23,7 +23,7 @@
.Nd delete software package distributions
.Sh SYNOPSIS
.Nm pkg_delete
-.Op Fl acimnqsvXx
+.Op Fl acIimnqsvXx
.Op Fl B Ar pkg-destdir
.Op Fl D Ar name Ns Op = Ns Ar value
.Ar pkg-name Op Ar ...
@@ -95,8 +95,11 @@ uninstall even if not running as root.
.It Ar scripts
external scripts may fail.
.El
+.It Fl I
+Force non-interactive mode.
+Default is to be interactive when run from a tty.
.It Fl i
-Switch on interactive mode.
+Force interactive mode, even if not run from a tty.
.Nm
may ask questions to the user if faced with difficult decisions.
.It Fl m