Index: usr.sbin/pkg/pkg.7 =================================================================== --- usr.sbin/pkg/pkg.7 +++ usr.sbin/pkg/pkg.7 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 30, 2022 +.Dd July 8, 2022 .Dt PKG 7 .Os .Sh NAME @@ -32,16 +32,17 @@ .Nd a utility for manipulating packages .Sh SYNOPSIS .Nm +.Op Fl d .Ar command ... .Nm .Cm add -.Op Fl fy +.Op Fl dfy .Op Fl r Ar reponame .Ar pkg.txz .Nm .Fl N .Nm -.Op Fl 46 +.Op Fl 46d .Cm bootstrap .Op Fl fy .Op Fl r Ar reponame @@ -121,6 +122,14 @@ .Ar reponame has been specified, then the configuration for that repository will be used. .El +.Sh OPTIONS +The following options are supported by +.Nm : +.Bl -tag -width indent +.It Fl d, Cm --debug +Show debug information. +Make be specified more than once. +.El .Sh CONFIGURATION Configuration varies in whether it is in a repository configuration file or the global configuration file. Index: usr.sbin/pkg/pkg.c =================================================================== --- usr.sbin/pkg/pkg.c +++ usr.sbin/pkg/pkg.c @@ -91,6 +91,8 @@ STAILQ_HEAD(fingerprint_list, fingerprint); +static int debug; + static int extract_pkg_static(int fd, char *p, int sz) { @@ -1115,6 +1117,7 @@ yes = false; struct option longopts[] = { + { "debug", no_argument, NULL, 'd' }, { "force", no_argument, NULL, 'f' }, { "only-ipv4", no_argument, NULL, '4' }, { "only-ipv6", no_argument, NULL, '6' }, @@ -1124,8 +1127,11 @@ snprintf(pkgpath, MAXPATHLEN, "%s/sbin/pkg", getlocalbase()); - while ((ch = getopt_long(argc, argv, "-:fr::yN46", longopts, NULL)) != -1) { + while ((ch = getopt_long(argc, argv, "-:dfr::yN46", longopts, NULL)) != -1) { switch (ch) { + case 'd': + debug++; + break; case 'f': force = true; break; @@ -1222,6 +1228,8 @@ break; } } + if (debug > 1) + fetchDebug = 1; if ((bootstrap_only && force) || access(pkgpath, X_OK) == -1) { /*