New configuration file via confuse: xbps.conf.
This commit is contained in:
@@ -73,8 +73,7 @@ check_pkg_autoinstall(prop_dictionary_t pkgd_regpkgdb,
|
||||
reqby = prop_dictionary_get(pkgd_regpkgdb, "requiredby");
|
||||
if (((prop_object_type(reqby) == PROP_TYPE_ARRAY)) &&
|
||||
((prop_array_count(reqby) > 0) && !autoinst)) {
|
||||
path = xbps_xasprintf("%s/%s/%s",
|
||||
prop_string_cstring_nocopy(xhp->rootdir),
|
||||
path = xbps_xasprintf("%s/%s/%s", xhp->rootdir,
|
||||
XBPS_META_PATH, XBPS_REGPKGDB);
|
||||
assert(path != NULL);
|
||||
|
||||
|
||||
@@ -72,8 +72,7 @@ check_pkg_files(prop_dictionary_t pkgd_regpkgdb,
|
||||
|
||||
while ((obj = prop_object_iterator_next(iter))) {
|
||||
prop_dictionary_get_cstring_nocopy(obj, "file", &file);
|
||||
path = xbps_xasprintf("%s/%s",
|
||||
prop_string_cstring_nocopy(xhp->rootdir), file);
|
||||
path = xbps_xasprintf("%s/%s", xhp->rootdir, file);
|
||||
if (path == NULL) {
|
||||
prop_object_iterator_release(iter);
|
||||
return -1;
|
||||
@@ -122,8 +121,7 @@ check_pkg_files(prop_dictionary_t pkgd_regpkgdb,
|
||||
|
||||
while ((obj = prop_object_iterator_next(iter))) {
|
||||
prop_dictionary_get_cstring_nocopy(obj, "file", &file);
|
||||
path = xbps_xasprintf("%s/%s",
|
||||
prop_string_cstring_nocopy(xhp->rootdir), file);
|
||||
path = xbps_xasprintf("%s/%s", xhp->rootdir, file);
|
||||
if (path == NULL) {
|
||||
prop_object_iterator_release(iter);
|
||||
return -1;
|
||||
|
||||
@@ -56,8 +56,7 @@ write_pkgd_to_regpkgdb(prop_dictionary_t pkgd,
|
||||
"packages array: %s", pkgn, strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
path = xbps_xasprintf("%s/%s/%s",
|
||||
prop_string_cstring_nocopy(xhp->rootdir),
|
||||
path = xbps_xasprintf("%s/%s/%s", xhp->rootdir,
|
||||
XBPS_META_PATH, XBPS_REGPKGDB);
|
||||
if (path == NULL)
|
||||
return -1;
|
||||
|
||||
@@ -76,8 +76,7 @@ check_pkg_symlinks(prop_dictionary_t pkgd_regpkgdb,
|
||||
"empty target object!\n", pkgname, file);
|
||||
continue;
|
||||
}
|
||||
path = xbps_xasprintf("%s/%s",
|
||||
prop_string_cstring_nocopy(xhp->rootdir), file);
|
||||
path = xbps_xasprintf("%s/%s", xhp->rootdir, file);
|
||||
if (path == NULL)
|
||||
return -1;
|
||||
|
||||
@@ -90,9 +89,9 @@ check_pkg_symlinks(prop_dictionary_t pkgd_regpkgdb,
|
||||
}
|
||||
|
||||
free(path);
|
||||
if (!prop_string_equals_cstring(xhp->rootdir, "/") &&
|
||||
strstr(buf, prop_string_cstring_nocopy(xhp->rootdir)))
|
||||
path = buf + prop_string_size(xhp->rootdir);
|
||||
if (strcmp(xhp->rootdir, "/") &&
|
||||
strstr(buf, xhp->rootdir))
|
||||
path = buf + strlen(xhp->rootdir);
|
||||
else
|
||||
path = buf;
|
||||
|
||||
|
||||
@@ -81,8 +81,7 @@ find_files_in_packages(const char *pattern)
|
||||
unsigned int i, count;
|
||||
|
||||
xhp = xbps_handle_get();
|
||||
path = xbps_xasprintf("%s/%s/metadata",
|
||||
prop_string_cstring_nocopy(xhp->rootdir), XBPS_META_PATH);
|
||||
path = xbps_xasprintf("%s/%s/metadata", xhp->rootdir, XBPS_META_PATH);
|
||||
if (path == NULL)
|
||||
return -1;
|
||||
|
||||
|
||||
@@ -66,12 +66,12 @@ main(int argc, char **argv)
|
||||
struct xferstat xfer;
|
||||
struct list_pkgver_cb lpc;
|
||||
struct sigaction sa;
|
||||
const char *rootdir, *cachedir, *confdir, *option;
|
||||
const char *rootdir, *cachedir, *conffile, *option;
|
||||
int i, c, flags, rv;
|
||||
bool yes, purge, debug, reqby_force, force_rm_with_deps, recursive_rm;
|
||||
bool install_auto, install_manual, show_download_pkglist_url;
|
||||
|
||||
rootdir = cachedir = confdir = option = NULL;
|
||||
rootdir = cachedir = conffile = option = NULL;
|
||||
flags = rv = 0;
|
||||
reqby_force = yes = purge = force_rm_with_deps = false;
|
||||
recursive_rm = debug = false;
|
||||
@@ -83,7 +83,7 @@ main(int argc, char **argv)
|
||||
install_auto = true;
|
||||
break;
|
||||
case 'C':
|
||||
confdir = optarg;
|
||||
conffile = optarg;
|
||||
break;
|
||||
case 'c':
|
||||
cachedir = optarg;
|
||||
@@ -155,7 +155,7 @@ main(int argc, char **argv)
|
||||
sigaction(SIGQUIT, &sa, NULL);
|
||||
|
||||
/*
|
||||
* Initialize stuff for libxbps.
|
||||
* Initialize libxbps.
|
||||
*/
|
||||
xhp = xbps_handle_alloc();
|
||||
if (xhp == NULL) {
|
||||
@@ -166,25 +166,20 @@ main(int argc, char **argv)
|
||||
xhp->state_cb = state_cb;
|
||||
xhp->fetch_cb = fetch_file_progress_cb;
|
||||
xhp->fetch_cb_data = &xfer;
|
||||
xhp->rootdir = rootdir;
|
||||
xhp->cachedir = cachedir;
|
||||
xhp->conffile = conffile;
|
||||
xhp->flags = flags;
|
||||
xhp->install_reason_manual = install_manual;
|
||||
xhp->install_reason_auto = install_auto;
|
||||
if (flags & XBPS_FLAG_VERBOSE)
|
||||
xhp->unpack_cb = unpack_progress_cb_verbose;
|
||||
else
|
||||
xhp->unpack_cb = unpack_progress_cb;
|
||||
|
||||
if (rootdir)
|
||||
xhp->rootdir = prop_string_create_cstring(rootdir);
|
||||
if (cachedir)
|
||||
xhp->cachedir = prop_string_create_cstring(cachedir);
|
||||
if (confdir)
|
||||
xhp->confdir = prop_string_create_cstring(confdir);
|
||||
|
||||
xhp->flags = flags;
|
||||
xhp->install_reason_manual = install_manual;
|
||||
xhp->install_reason_auto = install_auto;
|
||||
|
||||
if ((rv = xbps_init(xhp)) != 0) {
|
||||
xbps_error_printf("xbps-bin: couldn't initialize library: %s\n",
|
||||
strerror(errno));
|
||||
strerror(rv));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ state_cb(const struct xbps_state_cb_data *xscd, void *cbdata)
|
||||
if (xhp->syslog_enabled)
|
||||
syslog(LOG_NOTICE, "Installed `%s-%s' successfully "
|
||||
"(rootdir: %s).", xscd->pkgname, xscd->version,
|
||||
prop_string_cstring_nocopy(xhp->rootdir));
|
||||
xhp->rootdir);
|
||||
break;
|
||||
case XBPS_STATE_UPDATE_DONE:
|
||||
printf("Updated `%s' to `%s' successfully.\n",
|
||||
@@ -115,7 +115,7 @@ state_cb(const struct xbps_state_cb_data *xscd, void *cbdata)
|
||||
if (xhp->syslog_enabled)
|
||||
syslog(LOG_NOTICE, "Updated `%s' to `%s' successfully "
|
||||
"(rootdir: %s).", xscd->pkgname, xscd->version,
|
||||
prop_string_cstring_nocopy(xhp->rootdir));
|
||||
xhp->rootdir);
|
||||
break;
|
||||
case XBPS_STATE_REMOVE_DONE:
|
||||
printf("Removed `%s-%s' successfully.\n",
|
||||
@@ -123,7 +123,7 @@ state_cb(const struct xbps_state_cb_data *xscd, void *cbdata)
|
||||
if (xhp->syslog_enabled)
|
||||
syslog(LOG_NOTICE, "Removed `%s-%s' successfully "
|
||||
"(rootdir: %s).", xscd->pkgname, xscd->version,
|
||||
prop_string_cstring_nocopy(xhp->rootdir));
|
||||
xhp->rootdir);
|
||||
break;
|
||||
case XBPS_STATE_PURGE_DONE:
|
||||
printf("Purged `%s-%s' successfully.\n",
|
||||
@@ -131,7 +131,7 @@ state_cb(const struct xbps_state_cb_data *xscd, void *cbdata)
|
||||
if (xhp->syslog_enabled)
|
||||
syslog(LOG_NOTICE, "Purged `%s-%s' successfully "
|
||||
"(rootdir: %s).", xscd->pkgname, xscd->version,
|
||||
prop_string_cstring_nocopy(xhp->rootdir));
|
||||
xhp->rootdir);
|
||||
break;
|
||||
/* errors */
|
||||
case XBPS_STATE_UNPACK_FAIL:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.TH "XBPS\-BIN" "8" "03/12/2011" "\ \&" "\ \&"
|
||||
.TH "XBPS\-BIN" "8" "15/12/2011" "\ \&" "\ \&"
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * set default formatting
|
||||
.\" -----------------------------------------------------------------
|
||||
@@ -28,10 +28,10 @@ Use of this option takes effect in the \fIautoupdate\fR, \fIinstall\fR and
|
||||
matched.
|
||||
.RE
|
||||
.PP
|
||||
\fB\-C\fR \fIconfdir\fR
|
||||
\fB\-C\fR \fIconffile\fR
|
||||
.RS 4
|
||||
Full path to the XBPS configuration directory where the configuration files are available\&.
|
||||
By default it\(cqs set to \fIETCDIR/xbps\fR\&.
|
||||
Full path to the XBPS configuration file\&.
|
||||
By default it\(cqs set to \fIETCDIR/xbps/xbps.conf\fR\&.
|
||||
.RE
|
||||
.PP
|
||||
\fB\-c\fR \fIcachedir\fR
|
||||
|
||||
Reference in New Issue
Block a user