From 90fbfc3859b00b890a46175f1f294dfcf00f9b50 Mon Sep 17 00:00:00 2001 From: bapt Date: Mon, 10 Sep 2012 08:14:58 +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 Approved by: re (kib) git-svn-id: svn://svn.freebsd.org/base/releng/9.1@240300 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 1849eebc..8dc7bcfd 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.42.0