Replaced config/system {repo,preserve,virtualpkg}.d with a single directory.

See the NEWS file for more information.
This commit is contained in:
Juan RP
2014-11-06 09:58:04 +01:00
parent 578c3add0c
commit 5b522109f7
38 changed files with 278 additions and 277 deletions

View File

@@ -77,7 +77,7 @@ list_pkgs_in_dict(struct xbps_handle *xhp _unused,
assert(out);
snprintf(out, lpc->maxcols - 3,
"%s %s", tmp, short_desc);
strncat(out, "...\n", lpc->maxcols);
xbps_strlcat(out, "...\n", sizeof(*out));
printf("%s", out);
free(out);
} else {

View File

@@ -38,8 +38,8 @@ usage(bool fail)
fprintf(stdout,
"Usage: xbps-query [OPTIONS] MODE [ARGUMENTS]\n"
"\nOPTIONS\n"
" -C --config <file> Full path to configuration file\n"
" -c --cachedir <dir> Full path to cachedir\n"
" -C --config <dir> Path to confdir (xbps.d)\n"
" -c --cachedir <dir> Path to cachedir\n"
" -d --debug Debug mode shown to stderr\n"
" -h --help Print help usage\n"
" -p --property PROP[,...] Show properties for PKGNAME\n"
@@ -99,13 +99,13 @@ main(int argc, char **argv)
{ NULL, 0, NULL, 0 },
};
struct xbps_handle xh;
const char *pkg, *rootdir, *cachedir, *conffile, *props;
const char *pkg, *rootdir, *cachedir, *confdir, *props;
int c, flags, rv;
bool list_pkgs, list_repos, orphans, own;
bool list_manual, list_hold, show_prop, show_files, show_deps, show_rdeps;
bool show, pkg_search, regex, repo_mode, opmode, fulldeptree;
rootdir = cachedir = conffile = props = pkg = NULL;
rootdir = cachedir = confdir = props = pkg = NULL;
flags = rv = c = 0;
list_pkgs = list_repos = list_hold = orphans = pkg_search = own = false;
list_manual = show_prop = show_files = false;
@@ -117,7 +117,7 @@ main(int argc, char **argv)
while ((c = getopt_long(argc, argv, shortopts, longopts, NULL)) != -1) {
switch (c) {
case 'C':
conffile = optarg;
confdir = optarg;
break;
case 'c':
cachedir = optarg;
@@ -214,11 +214,11 @@ main(int argc, char **argv)
* Initialize libxbps.
*/
if (rootdir)
strncpy(xh.rootdir, rootdir, sizeof(xh.rootdir));
xbps_strlcpy(xh.rootdir, rootdir, sizeof(xh.rootdir));
if (cachedir)
strncpy(xh.cachedir, cachedir, sizeof(xh.cachedir));
if (conffile)
strncpy(xh.conffile, conffile, sizeof(xh.conffile));
xbps_strlcpy(xh.cachedir, cachedir, sizeof(xh.cachedir));
if (confdir)
xbps_strlcpy(xh.confdir, confdir, sizeof(xh.confdir));
xh.flags = flags;

View File

@@ -68,7 +68,7 @@ print_results(struct xbps_handle *xhp, struct search_data *sd)
for (unsigned int i = 0; i < xbps_array_count(sd->results); i++) {
xbps_array_get_cstring_nocopy(sd->results, i, &pkgver);
xbps_array_get_cstring_nocopy(sd->results, i+1, &desc);
strncpy(tmp, pkgver, sizeof(tmp));
xbps_strlcpy(tmp, pkgver, sizeof(tmp));
for (j = strlen(tmp); j < tlen; j++)
tmp[j] = ' ';
@@ -84,7 +84,7 @@ print_results(struct xbps_handle *xhp, struct search_data *sd)
assert(out);
snprintf(out, sd->maxcols-3, "%s %s %s",
inststr, tmp, desc);
strncat(out, "...\n", sd->maxcols);
xbps_strlcat(out, "...\n", sizeof(*out));
printf("%s", out);
free(out);
} else {

View File

@@ -1,4 +1,4 @@
.Dd September 30, 2014
.Dd November 5, 2014
.Dt XBPS-QUERY 8
.Sh NAME
.Nm xbps-query
@@ -53,10 +53,14 @@ Example:
The first repository matching the package expression wins.
.Sh OPTIONS
.Bl -tag -width -x
.It Fl C, Fl -config Ar file
Specifies a full path to the XBPS configuration file.
.It Fl C, Fl -config Ar dir
Specifies a path to the XBPS configuration directory.
If the first character is not '\/' then it's a relative path of
.Ar rootdir .
.It Fl c, Fl -cachedir Ar dir
Specifies a full path to the cache directory, where binary packages are stored.
Specifies a path to the cache directory, where binary packages are stored.
If the first character is not '\/' then it's a relative path of
.Ar rootdir .
.It Fl d, Fl -debug
Enables extra debugging shown to stderr.
.It Fl h, Fl -help
@@ -224,8 +228,8 @@ the native architecture).
.El
.Sh FILES
.Bl -tag -width /var/db/xbps/.<pkgname>-files.plist
.It Ar /etc/xbps/xbps.conf
Default configuration file.
.It Ar /etc/xbps.d
Default configuration directory.
.It Ar /var/db/xbps/.<pkgname>-files.plist
Package files metadata.
.It Ar /var/db/xbps/pkgdb-0.38.plist