From 2d74780592aef2eb97b1feab284ffe680f6df531 Mon Sep 17 00:00:00 2001 From: bapt Date: Sun, 9 Sep 2012 22:12:15 +0000 Subject: [PATCH] MFC: r239663, r239664 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 git-svn-id: svn://svn.freebsd.org/base/stable/8@240291 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- usr.sbin/pkg/pkg.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/usr.sbin/pkg/pkg.c b/usr.sbin/pkg/pkg.c index 1849eebca..8dc7bcfd9 100644 --- a/usr.sbin/pkg/pkg.c +++ b/usr.sbin/pkg/pkg.c @@ -425,9 +425,11 @@ 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 (!isatty(fileno(stdin))) + exit(EXIT_FAILURE); + if (pkg_query_yes_no() == 0) exit(EXIT_FAILURE); } -- 2.45.0