Author: bdrewery (ports committer)
Date: Wed Oct 30 10:17:16 2013
New Revision: 257377
URL: http://svnweb.freebsd.org/changeset/base/257377

Log:
  Add a 'pkg bootstrap' command which will bootstrap pkg(8) without
  forwarding any command to it after installation.
  
  This is useful if the only goal is to install pkg(8) without any extra
  output.
  
  Requested by: cperciva
  Approved by:  bapt
  MFC after:    2 days

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

Modified: head/usr.sbin/pkg/pkg.c
==============================================================================
--- head/usr.sbin/pkg/pkg.c     Wed Oct 30 08:13:42 2013        (r257376)
+++ head/usr.sbin/pkg/pkg.c     Wed Oct 30 10:17:16 2013        (r257377)
@@ -951,6 +951,15 @@ main(__unused int argc, char *argv[])
                if (bootstrap_pkg() != 0)
                        exit(EXIT_FAILURE);
                config_finish();
+
+               if (argv[1] != NULL && strcmp(argv[1], "bootstrap") == 0)
+                       exit(EXIT_SUCCESS);
+       } else {
+               if (argv[1] != NULL && strcmp(argv[1], "bootstrap") == 0) {
+                       printf("pkg already bootstrapped at %s\n",
+                           pkgpath);
+                       exit(EXIT_SUCCESS);
+               }
        }
 
        execv(pkgpath, argv);
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to