Added support to specify multiple repositories via cmdline (close #17).
This commit is contained in:
@@ -52,7 +52,8 @@ usage(bool fail)
|
||||
" overwritten.\n"
|
||||
" -h --help Print help usage\n"
|
||||
" -n --dry-run Dry-run mode\n"
|
||||
" -R --repository <uri> Default repository to be used if config not set\n"
|
||||
" -R --repository <uri> Repository to be used. Can be specified\n"
|
||||
" multiple times.\n"
|
||||
" -r --rootdir <dir> Full path to rootdir\n"
|
||||
" -S --sync Sync remote repository index\n"
|
||||
" -u --update Update target package(s)\n"
|
||||
@@ -97,15 +98,17 @@ main(int argc, char **argv)
|
||||
};
|
||||
struct xbps_handle xh;
|
||||
struct xferstat xfer;
|
||||
const char *rootdir, *cachedir, *conffile, *defrepo;
|
||||
const char *rootdir, *cachedir, *conffile;
|
||||
int i, c, flags, rv, fflag = 0;
|
||||
bool sync, yes, reinstall, drun, update;
|
||||
int maxcols;
|
||||
|
||||
rootdir = cachedir = conffile = defrepo = NULL;
|
||||
rootdir = cachedir = conffile = NULL;
|
||||
flags = rv = 0;
|
||||
sync = yes = reinstall = drun = update = false;
|
||||
|
||||
memset(&xh, 0, sizeof(xh));
|
||||
|
||||
while ((c = getopt_long(argc, argv, shortopts, longopts, NULL)) != -1) {
|
||||
switch (c) {
|
||||
case 'A':
|
||||
@@ -133,7 +136,10 @@ main(int argc, char **argv)
|
||||
drun = true;
|
||||
break;
|
||||
case 'R':
|
||||
defrepo = optarg;
|
||||
if (xh.repositories == NULL)
|
||||
xh.repositories = xbps_array_create();
|
||||
|
||||
xbps_array_add_cstring_nocopy(xh.repositories, optarg);
|
||||
break;
|
||||
case 'r':
|
||||
rootdir = optarg;
|
||||
@@ -165,7 +171,6 @@ main(int argc, char **argv)
|
||||
/*
|
||||
* Initialize libxbps.
|
||||
*/
|
||||
memset(&xh, 0, sizeof(xh));
|
||||
xh.state_cb = state_cb;
|
||||
xh.fetch_cb = fetch_file_progress_cb;
|
||||
xh.fetch_cb_data = &xfer;
|
||||
@@ -173,7 +178,6 @@ main(int argc, char **argv)
|
||||
xh.cachedir = cachedir;
|
||||
xh.conffile = conffile;
|
||||
xh.flags = flags;
|
||||
xh.repository = defrepo;
|
||||
if (flags & XBPS_FLAG_VERBOSE)
|
||||
xh.unpack_cb = unpack_progress_cb;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.Dd August 18, 2013
|
||||
.Dd September 18, 2013
|
||||
.Os Void Linux
|
||||
.Dt xbps-install 8
|
||||
.Sh NAME
|
||||
@@ -70,8 +70,8 @@ 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 overriding repository list in configuration file.
|
||||
Only a single repository can be specified.
|
||||
Default repository to be used. 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.
|
||||
.It Fl S, Fl -sync
|
||||
|
||||
Reference in New Issue
Block a user