Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Oct 2013 10:17:16 +0000 (UTC)
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r257377 - head/usr.sbin/pkg
Message-ID:  <201310301017.r9UAHGiF019606@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



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