Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Sep 2012 22:12:15 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r240291 - stable/8/usr.sbin/pkg
Message-ID:  <201209092212.q89MCFu3045792@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bapt
Date: Sun Sep  9 22:12:15 2012
New Revision: 240291
URL: http://svn.freebsd.org/changeset/base/240291

Log:
  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

Modified:
  stable/8/usr.sbin/pkg/pkg.c
Directory Properties:
  stable/8/usr.sbin/pkg/   (props changed)

Modified: stable/8/usr.sbin/pkg/pkg.c
==============================================================================
--- stable/8/usr.sbin/pkg/pkg.c	Sun Sep  9 22:09:30 2012	(r240290)
+++ stable/8/usr.sbin/pkg/pkg.c	Sun Sep  9 22:12:15 2012	(r240291)
@@ -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);
 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201209092212.q89MCFu3045792>