diff options
author | bdrewery <bdrewery@FreeBSD.org> | 2013-10-30 10:17:16 +0000 |
---|---|---|
committer | bdrewery <bdrewery@FreeBSD.org> | 2013-10-30 10:17:16 +0000 |
commit | e863fdbd6f2194999f163198b7fdca6085aaaaaf (patch) | |
tree | 5372dba08eb5352a2595b69516550357e8c77ba5 /usr.sbin/pkg | |
parent | 1d2893644527b6ab53a615ec4bb8d5004bd9a6bf (diff) | |
download | FreeBSD-src-e863fdbd6f2194999f163198b7fdca6085aaaaaf.zip FreeBSD-src-e863fdbd6f2194999f163198b7fdca6085aaaaaf.tar.gz |
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
Diffstat (limited to 'usr.sbin/pkg')
-rw-r--r-- | usr.sbin/pkg/pkg.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/usr.sbin/pkg/pkg.c b/usr.sbin/pkg/pkg.c index 4e9bb94..ac0c7f1 100644 --- a/usr.sbin/pkg/pkg.c +++ b/usr.sbin/pkg/pkg.c @@ -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); |