summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pkg
diff options
context:
space:
mode:
authorbapt <bapt@FreeBSD.org>2012-08-24 21:08:56 +0000
committerbapt <bapt@FreeBSD.org>2012-08-24 21:08:56 +0000
commitc01de858204239bb94ea7de794eea9686cd88cce (patch)
tree9e0ac0a5db4c2e0dc98c39b940fff1f71dd20fa0 /usr.sbin/pkg
parentd8c02526b32ddae1df625f0f9082ee1db503a954 (diff)
downloadFreeBSD-src-c01de858204239bb94ea7de794eea9686cd88cce.zip
FreeBSD-src-c01de858204239bb94ea7de794eea9686cd88cce.tar.gz
- change ALWAYS_ASSUME_YES to ASSUME_ALWAYS_YES for consistency with pkg(8)
- if not on a tty prompt about the missing pkg(8) but default on 'no' except if ASSUME_ALWAYS_YES is set MFC after: 2 days
Diffstat (limited to 'usr.sbin/pkg')
-rw-r--r--usr.sbin/pkg/pkg.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.sbin/pkg/pkg.c b/usr.sbin/pkg/pkg.c
index 1849eeb..50e71cf 100644
--- a/usr.sbin/pkg/pkg.c
+++ b/usr.sbin/pkg/pkg.c
@@ -425,10 +425,12 @@ main(__unused int argc, char *argv[])
* not tty. Check the environment to see if user has answer
* tucked in there already.
*/
- if (getenv("ALWAYS_ASSUME_YES") == NULL &&
- isatty(fileno(stdin))) {
+ if (getenv("ASSUME_ALWAYS_YES") == NULL) {
printf("%s", confirmation_message);
- if (pkg_query_yes_no() == 0)
+ if (isatty(fileno(stdin)) &&
+ pkg_query_yes_no() == 0)
+ exit(EXIT_FAILURE);
+ else
exit(EXIT_FAILURE);
}
if (bootstrap_pkg() != 0)
OpenPOWER on IntegriCloud