diff --git a/NEWS b/NEWS index 87bd36fc..9643b7e3 100644 --- a/NEWS +++ b/NEWS @@ -1,10 +1,19 @@ xbps-0.26 (???): - * xbps-install(8): added support to specify multiple repositories with `-R'. + * xbps-query(8): the `-D --defrepo' argument has been superseded by + `-R --repository=' argument. + + * xbps-install(8): added support to specify multiple repositories with + `--repository=`. For consistency with `xbps-query(8)' use the same + syntax as it were an optional argument. + This overrides the list of a configuration file. - * xbps-query(8: added support to specify multiple repositories with `-D'. - This overrides the list of a configuration file. + * xbps-query(8: added support to specify multiple repositories with + `--repository=`. This also enables repository mode; the argument is + optional and can be used to specify desired repositories. + + This overrides the repository list of a configuration file. * Re-added all metadata package objects to the repository index, this avoids remote connections when querying packages from remote repositories. This also diff --git a/bin/xbps-install/main.c b/bin/xbps-install/main.c index e5ee5bf2..8179d11b 100644 --- a/bin/xbps-install/main.c +++ b/bin/xbps-install/main.c @@ -52,8 +52,9 @@ usage(bool fail) " overwritten.\n" " -h --help Print help usage\n" " -n --dry-run Dry-run mode\n" - " -R --repository Repository to be used. Can be specified\n" - " multiple times.\n" + " -R --repository= Repository to be used. Can be specified\n" + " multiple times. This overrides the repositories\n" + " list of a configuration file.\n" " -r --rootdir Full path to rootdir\n" " -S --sync Sync remote repository index\n" " -u --update Update target package(s)\n" diff --git a/bin/xbps-install/xbps-install.8 b/bin/xbps-install/xbps-install.8 index 057c2a50..ad3208d7 100644 --- a/bin/xbps-install/xbps-install.8 +++ b/bin/xbps-install/xbps-install.8 @@ -69,8 +69,8 @@ is specified twice, Show the help usage. .It Fl n, Fl -dry-run Dry-run mode. Show what actions would be done but don't do anything. -.It Fl R, Fl -repository Ar uri -Default repository to be used. Multiple repositories can be specified. This repository +.It Fl R, Fl -repository=uri +Repository to be added to the list. Multiple repositories can be specified. This repository list overrides the list in a configuration file. .It Fl r, Fl -rootdir Ar dir Specifies a full path for the target root directory. diff --git a/bin/xbps-query/main.c b/bin/xbps-query/main.c index 0f6c61aa..69fc7617 100644 --- a/bin/xbps-query/main.c +++ b/bin/xbps-query/main.c @@ -40,11 +40,14 @@ usage(bool fail) "\nOPTIONS\n" " -C --config Full path to configuration file\n" " -c --cachedir Full path to cachedir\n" - " -D --defrepo Repository to be used. Can be specified\n" - " multiple times.\n" " -d --debug Debug mode shown to stderr\n" " -h --help Print help usage\n" - " -R --repoisotyr Enable repository mode\n" + " -R --repository Enable repository mode. This mode explicitly\n" + " looks for packages in repositories.\n" + " --repository= Enable repository mode and explicitly add the\n" + " repository to the list; can be specified\n" + " multiple times. This overrides the repositories\n" + " list of a configuration file.\n" " -r --rootdir Full path to rootdir\n" " -V --version Show XBPS version\n" " -v --verbose Verbose messages\n" @@ -71,7 +74,6 @@ main(int argc, char **argv) const struct option longopts[] = { { "config", required_argument, NULL, 'C' }, { "cachedir", required_argument, NULL, 'c' }, - { "defrepo", required_argument, NULL, 'D' }, { "debug", no_argument, NULL, 'd' }, { "help", no_argument, NULL, 'h' }, { "list-repos", no_argument, NULL, 'L' }, @@ -81,7 +83,7 @@ main(int argc, char **argv) { "list-orphans", no_argument, NULL, 'O' }, { "ownedby", no_argument, NULL, 'o' }, { "property", required_argument, NULL, 'p' }, - { "repository-mode", no_argument, NULL, 'R' }, + { "repository", optional_argument, NULL, 'R' }, { "rootdir", required_argument, NULL, 'r' }, { "search", no_argument, NULL, 's' }, { "version", no_argument, NULL, 'V' }, @@ -92,13 +94,13 @@ main(int argc, char **argv) { NULL, 0, NULL, 0 }, }; struct xbps_handle xh; - const char *rootdir, *cachedir, *conffile, *props, *defrepo; + const char *rootdir, *cachedir, *conffile, *props; int c, flags, rv, show_deps = 0; bool list_pkgs, list_repos, orphans, own; bool list_manual, list_hold, show_prop, show_files, show_rdeps; bool show, search, repo_mode, opmode, fulldeptree; - rootdir = cachedir = conffile = defrepo = props = NULL; + rootdir = cachedir = conffile = props = NULL; flags = rv = c = 0; list_pkgs = list_repos = list_hold = orphans = search = own = false; list_manual = show_prop = show_files = false; @@ -116,10 +118,6 @@ main(int argc, char **argv) cachedir = optarg; break; case 'D': - if (xh.repositories == NULL) - xh.repositories = xbps_array_create(); - - xbps_array_add_cstring_nocopy(xh.repositories, optarg); break; case 'd': flags |= XBPS_FLAG_DEBUG; @@ -153,6 +151,12 @@ main(int argc, char **argv) show_prop = opmode = true; break; case 'R': + if (optarg != NULL) { + if (xh.repositories == NULL) + xh.repositories = xbps_array_create(); + + xbps_array_add_cstring_nocopy(xh.repositories, optarg); + } repo_mode = true; break; case 'r': diff --git a/bin/xbps-query/xbps-query.8 b/bin/xbps-query/xbps-query.8 index 08cc6162..c38aa790 100644 --- a/bin/xbps-query/xbps-query.8 +++ b/bin/xbps-query/xbps-query.8 @@ -54,16 +54,17 @@ Example: Specifies a full path to the XBPS configuration file. .It Fl c, Fl -cachedir Ar dir Specifies a full path to the cache directory, where binary packages are stored. -.It Fl D, Fl -defrepo Ar uri -Default repository to be used. Multiple repositories can be specified. This repository -list overrides the list in a configuration file. .It Fl d, Fl -debug Enables extra debugging shown to stderr. .It Fl h, Fl -help Show the help usage. -.It Fl R, Fl -repository +.It Fl R, Fl -repository=url Enable repository mode. This mode explicitly looks in repositories, rather -than looking in the target root directory. +than looking in the target root directory. The +.Ar url +argument is optional and can be used to add the repository to the list, +overriding the repository list of a configuration file. Multiple repositories +can be specified. .It Fl r, Fl -rootdir Ar dir Specifies a full path for the target root directory. .It Fl v, Fl -verbose