xbps-reconfigure(8): new option -i, --ignore to ignore pkgs with -a, --all.
-i, --ignore can be specified multiple times and can be used to ignore configuration of those packages while configuration of all packages is being performed. Close #67
This commit is contained in:
@ -91,13 +91,14 @@ state_cb(const struct xbps_state_cb_data *xscd, void *cbd _unused)
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
const char *shortopts = "aC:dfhr:Vv";
|
||||
const char *shortopts = "aC:dfhi:r:Vv";
|
||||
const struct option longopts[] = {
|
||||
{ "all", no_argument, NULL, 'a' },
|
||||
{ "config", required_argument, NULL, 'C' },
|
||||
{ "debug", no_argument, NULL, 'd' },
|
||||
{ "force", no_argument, NULL, 'f' },
|
||||
{ "help", no_argument, NULL, 'h' },
|
||||
{ "ignore", required_argument, NULL, 'i' },
|
||||
{ "rootdir", required_argument, NULL, 'r' },
|
||||
{ "verbose", no_argument, NULL, 'v' },
|
||||
{ "version", no_argument, NULL, 'V' },
|
||||
@ -107,6 +108,7 @@ main(int argc, char **argv)
|
||||
const char *confdir = NULL, *rootdir = NULL;
|
||||
int c, i, rv, flags = 0;
|
||||
bool all = false;
|
||||
xbps_array_t ignpkgs = NULL;
|
||||
|
||||
while ((c = getopt_long(argc, argv, shortopts, longopts, NULL)) != -1) {
|
||||
switch (c) {
|
||||
@ -125,6 +127,12 @@ main(int argc, char **argv)
|
||||
case 'h':
|
||||
usage(false);
|
||||
/* NOTREACHED */
|
||||
case 'i':
|
||||
if (ignpkgs == NULL)
|
||||
ignpkgs = xbps_array_create();
|
||||
|
||||
xbps_array_add_cstring_nocopy(ignpkgs, optarg);
|
||||
break;
|
||||
case 'r':
|
||||
rootdir = optarg;
|
||||
break;
|
||||
@ -164,7 +172,7 @@ main(int argc, char **argv)
|
||||
}
|
||||
|
||||
if (all) {
|
||||
rv = xbps_configure_packages(&xh);
|
||||
rv = xbps_configure_packages(&xh, ignpkgs);
|
||||
} else {
|
||||
for (i = optind; i < argc; i++) {
|
||||
rv = xbps_configure_pkg(&xh, argv[i], true, false);
|
||||
|
@ -45,6 +45,15 @@ Enables extra debugging shown to stderr.
|
||||
Forcefully reconfigure package even if it was configured previously.
|
||||
.It Fl h, Fl -help
|
||||
Show the help usage.
|
||||
.It Fl i, Fl -ignore Ar PKG
|
||||
Ignore
|
||||
.Ar PKG
|
||||
when configuring all packages with
|
||||
.Fl a, Fl -all .
|
||||
The
|
||||
.Ar PKG
|
||||
argument can be a package name or a package name with version.
|
||||
This option can be specified multiple times.
|
||||
.It Fl r, Fl -rootdir Ar dir
|
||||
Specifies a path for the target root directory.
|
||||
.It Fl v, Fl -verbose
|
||||
|
Reference in New Issue
Block a user