svn commit: r239663 - head/usr.sbin/pkg

Baptiste Daroussin bapt at FreeBSD.org
Fri Aug 24 21:08:57 UTC 2012


Author: bapt
Date: Fri Aug 24 21:08:56 2012
New Revision: 239663
URL: http://svn.freebsd.org/changeset/base/239663

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

Modified:
  head/usr.sbin/pkg/pkg.c

Modified: head/usr.sbin/pkg/pkg.c
==============================================================================
--- head/usr.sbin/pkg/pkg.c	Fri Aug 24 20:41:31 2012	(r239662)
+++ head/usr.sbin/pkg/pkg.c	Fri Aug 24 21:08:56 2012	(r239663)
@@ -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)


More information about the svn-src-head mailing list