Author: bapt
Date: Mon Sep 10 08:14:58 2012
New Revision: 240300
URL: http://svn.freebsd.org/changeset/base/240300

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
  
  Approved by:  re (kib)

Modified:
  releng/9.1/usr.sbin/pkg/pkg.c
Directory Properties:
  releng/9.1/usr.sbin/pkg/   (props changed)

Modified: releng/9.1/usr.sbin/pkg/pkg.c
==============================================================================
--- releng/9.1/usr.sbin/pkg/pkg.c       Mon Sep 10 07:56:59 2012        
(r240299)
+++ releng/9.1/usr.sbin/pkg/pkg.c       Mon Sep 10 08:14:58 2012        
(r240300)
@@ -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);
                }
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to