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

Bryan Drewery bdrewery at FreeBSD.org
Wed Oct 30 10:17:17 UTC 2013


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);


More information about the svn-src-all mailing list