API clean up (part 2), plus misc changes and improvements.

- Rename regpkgs_dictionary to regpkgdb_dictionary to better describe what is is.
- Change some funcs in plist.c to return a boolean rather than int.
- Hide more internal funcs off the API.
- Simplify xbps_repository_update_pkg() and remove its second arg.
- Hide implementation details in xbps_repository_pool, now to iterate over the
  pool you have to use xbps_repository_pool_foreach and its struct
  repository_pool_index.
- Introduce xbps_{init,end}, to initialize/destroy some stuff in the library.
- Introduce xbps_dbg_printf to printf stuff for debugging purposes.
- xbps-{bin,repo}:  added -d arg to enable debugging output.
- Before checking if a config file needs to be installed or such, check that
  package contains the "conf_files" array.
- Remove obsolete dirs as well while updating packages.
- If transaction dictionary is ready remove the "missing_deps" array.

Bump XBPS_RELVER to 20101118.

--HG--
rename : lib/regpkgs_dictionary.c => lib/regpkgdb_dictionary.c
This commit is contained in:
Juan RP
2010-11-19 13:40:13 +01:00
parent ffc255b715
commit fdec663855
33 changed files with 1426 additions and 943 deletions

View File

@@ -29,6 +29,7 @@
#include <string.h>
#include <errno.h>
#include <assert.h>
#include <unistd.h>
#include <xbps_api.h>
#include "defs.h"
@@ -56,7 +57,7 @@ xbps_check_pkg_integrity_all(void)
int rv = 0;
size_t npkgs = 0, nbrokenpkgs = 0;
d = xbps_regpkgs_dictionary_init();
d = xbps_regpkgdb_dictionary_get();
if (d == NULL)
return ENODEV;
@@ -82,7 +83,7 @@ out:
if (iter)
prop_object_iterator_release(iter);
xbps_regpkgs_dictionary_release();
xbps_regpkgdb_dictionary_release();
return rv;
}

View File

@@ -30,6 +30,7 @@
#include <errno.h>
#include <ctype.h>
#include <assert.h>
#include <unistd.h>
#include <xbps_api.h>
#include "defs.h"
@@ -102,9 +103,6 @@ download_package_list(prop_object_iterator_t iter)
if (cachedir == NULL)
return EINVAL;
/* Set default limit of global and per-host cached connections */
xbps_fetch_set_cache_connection(0, 0);
while ((obj = prop_object_iterator_next(iter)) != NULL) {
prop_dictionary_get_cstring_nocopy(obj, "repository", &repoloc);
prop_dictionary_get_cstring_nocopy(obj, "pkgver", &pkgver);
@@ -293,11 +291,14 @@ xbps_autoupdate_pkgs(bool yes)
if (rv == ENOENT) {
printf("No packages currently registered.\n");
return 0;
} else if (rv == ENOPKG) {
} else if (rv == ENXIO) {
printf("All packages are up-to-date.\n");
return 0;
} else {
fprintf(stderr, "xbps-bin: unexpected error %s\n",
strerror(rv));
return -1;
}
return rv;
}
return xbps_exec_transaction(yes);
@@ -337,15 +338,16 @@ xbps_install_new_pkg(const char *pkg)
free(pkgname);
return 0;
}
rv = xbps_repository_install_pkg(pkgpatt, true);
if (rv == EAGAIN) {
fprintf(stderr, "xbps-bin: unable to locate '%s' in "
"repository pool.\n", pkg);
rv = 1;
} else if (rv != 0 && rv != ENOENT) {
fprintf(stderr, "xbps-bin: unexpected error: %s",
strerror(errno));
rv = -1;
if ((rv = xbps_repository_install_pkg(pkgpatt)) != 0) {
if (rv == EAGAIN) {
fprintf(stderr, "xbps-bin: unable to locate '%s' in "
"repository pool.\n", pkg);
rv = -1;
} else {
fprintf(stderr, "xbps-bin: unexpected error: %s\n",
strerror(rv));
rv = -1;
}
}
if (pkgmatch)
@@ -358,28 +360,22 @@ xbps_install_new_pkg(const char *pkg)
int
xbps_update_pkg(const char *pkgname)
{
prop_dictionary_t pkgd;
int rv = 0;
pkgd = xbps_find_pkg_dict_installed(pkgname, false);
printf("Finding new '%s' package...\n", pkgname);
if (pkgd) {
rv = xbps_repository_update_pkg(pkgname, pkgd);
if (rv == EEXIST) {
printf("Package '%s' is up to date.\n", pkgname);
rv = 0;
} else if (rv == ENOENT) {
fprintf(stderr, "Package '%s' not found in "
"repository pool.\n", pkgname);
rv = 0;
}
prop_object_release(pkgd);
} else {
rv = xbps_repository_update_pkg(pkgname);
if (rv == EEXIST)
printf("Package '%s' is up to date.\n", pkgname);
else if (rv == ENOENT)
fprintf(stderr, "Package '%s' not found in "
"repository pool.\n", pkgname);
else if (rv == ENODEV)
printf("Package '%s' not installed.\n", pkgname);
return 0;
else if (rv != 0) {
fprintf(stderr, "xbps-bin: unexpected error %s\n",
strerror(rv));
return -1;
}
return rv;
return 0;
}
static int
@@ -435,11 +431,10 @@ replace_packages(prop_dictionary_t trans_dict, prop_dictionary_t pkgd,
prop_object_release(instd);
version = xbps_get_pkg_version(pkgver);
rv = xbps_remove_pkg(reppkgn, version, false);
if (rv != 0) {
if ((rv = xbps_remove_pkg(reppkgn, version, false)) != 0) {
fprintf(stderr, "xbps-bin: couldn't remove %s (%s)\n",
reppkgn, strerror(rv));
return rv;
return -1;
}
}
prop_object_iterator_release(replaces_iter);
@@ -552,8 +547,7 @@ exec_transaction(struct transaction *trans)
printf("Replacing %s files (%s -> %s) ...\n",
pkgname, instver, version);
rv = xbps_remove_pkg(pkgname, version, true);
if (rv != 0) {
if ((rv = xbps_remove_pkg(pkgname, version, true)) != 0) {
fprintf(stderr, "xbps-bin: error "
"replacing %s-%s (%s)\n", pkgname,
instver, strerror(rv));
@@ -617,14 +611,15 @@ xbps_exec_transaction(bool yes)
return rv;
trans->dict = xbps_repository_get_transaction_dict();
if (trans->dict == NULL)
if (trans->dict == NULL) {
rv = errno;
goto out;
/*
* Bail out if there are unresolved deps.
*/
array = prop_dictionary_get(trans->dict, "missing_deps");
if (prop_array_count(array) > 0) {
}
if (rv == ENOENT) {
/*
* Bail out if there are unresolved deps.
*/
array = prop_dictionary_get(trans->dict, "missing_deps");
show_missing_deps(trans->dict);
goto out;
}
@@ -644,9 +639,6 @@ xbps_exec_transaction(bool yes)
trans->yes = yes;
rv = exec_transaction(trans);
DPRINTF(("Dictionary AFTER transaction happened:\n"));
DPRINTF(("%s", prop_dictionary_externalize(trans->dict)));
out:
if (trans->iter)
prop_object_iterator_release(trans->iter);

View File

@@ -30,6 +30,7 @@
#include <errno.h>
#include <signal.h>
#include <assert.h>
#include <unistd.h>
#include <xbps_api.h>
#include "defs.h"
@@ -44,7 +45,7 @@ usage(void)
" autoremove\n"
" autoupdate\n"
" check\t\t[<pkgname>|<all>]\n"
" find-files\t<pattern>\n"
" find-files\t\t<pattern>\n"
" install\t\t[<pkgname(s)>|<pkgpattern(s)>]\n"
" list\t\t[state]\n"
" list-manual\n"
@@ -59,6 +60,7 @@ usage(void)
" update\t\t<pkgname(s)>\n"
" Options shared by all targets:\n"
" -c\t\t<cachedir>\n"
" -d\t\tDebug output\n"
" -r\t\t<rootdir>\n"
" -v\t\tShows verbose messages\n"
" -V\t\tPrints the xbps release version\n"
@@ -120,8 +122,7 @@ list_manual_packages(prop_object_t obj, void *arg, bool *loop_done)
static void
cleanup(int signum)
{
xbps_regpkgs_dictionary_release();
xbps_fetch_unset_cache_connection();
xbps_end();
exit(signum);
}
@@ -132,15 +133,18 @@ main(int argc, char **argv)
pkg_state_t pkgstate = 0;
struct sigaction sa;
int i = 0, c, flags = 0, rv = 0;
bool yes, purge;
bool yes, purge, with_debug;
yes = purge = false;
yes = purge = with_debug = false;
while ((c = getopt(argc, argv, "Vcfpr:vy")) != -1) {
while ((c = getopt(argc, argv, "Vcdfpr:vy")) != -1) {
switch (c) {
case 'c':
xbps_set_cachedir(optarg);
break;
case 'd':
with_debug = true;
break;
case 'f':
flags |= XBPS_FLAG_FORCE;
break;
@@ -184,9 +188,13 @@ main(int argc, char **argv)
sigaction(SIGTERM, &sa, NULL);
sigaction(SIGQUIT, &sa, NULL);
if ((dict = xbps_regpkgs_dictionary_init()) == NULL) {
if (errno != ENOENT) {
rv = errno;
/*
* Initialize stuff for libxbps.
*/
xbps_init(with_debug);
if ((dict = xbps_regpkgdb_dictionary_get()) == NULL) {
if (errno && errno != ENOENT) {
fprintf(stderr,
"E: couldn't initialize regpkgdb dict: %s\n",
strerror(errno));
@@ -194,6 +202,15 @@ main(int argc, char **argv)
}
}
if ((rv = xbps_repository_pool_init()) != 0) {
if (rv != ENOENT) {
fprintf(stderr,
"E: couldn't initialize repository pool: %s\n",
strerror(rv));
goto out;
}
}
if (strcasecmp(argv[0], "list") == 0) {
/* Lists packages currently registered in database. */
if (argc < 1 || argc > 2)
@@ -221,11 +238,8 @@ main(int argc, char **argv)
}
}
if (!xbps_callback_array_iter_in_dict(dict, "packages",
list_pkgs_in_dict, &pkgstate)) {
rv = errno;
goto out;
}
rv = xbps_callback_array_iter_in_dict(dict, "packages",
list_pkgs_in_dict, &pkgstate);
} else if (strcasecmp(argv[0], "install") == 0) {
/* Installs a binary package and required deps. */
@@ -361,7 +375,7 @@ main(int argc, char **argv)
rv = xbps_callback_array_iter_in_dict(dict, "packages",
list_manual_packages, NULL);
} else if (strcasecmp(argv[0], "show-revdeps") == 0) {
/*
* Show reverse dependencies for a package.

View File

@@ -2,12 +2,12 @@
.\" Title: xbps-bin
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\" Date: 31/10/2010
.\" Date: 18/11/2010
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
.TH "XBPS\-BIN" "8" "31/10/2010" "\ \&" "\ \&"
.TH "XBPS\-BIN" "8" "18/11/2010" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -43,6 +43,11 @@ of
\fI/blah/cachedir\fR\&.
.RE
.PP
\fB\-d\fR
.RS 4
Enables extra debugging output to be shown to stderr.
.RE
.PP
\fB\-f\fR
.RS 4
Used currently in the

View File

@@ -29,6 +29,7 @@
#include <string.h>
#include <errno.h>
#include <stdarg.h>
#include <unistd.h>
#include <xbps_api.h>

View File

@@ -1,5 +1,5 @@
/*-
* Copyright (c) 2008-2009 Juan Romero Pardines.
* Copyright (c) 2008-2010 Juan Romero Pardines.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -30,6 +30,7 @@
#include <errno.h>
#include <limits.h>
#include <libgen.h>
#include <unistd.h>
#include <xbps_api.h>
#include "defs.h"
@@ -66,19 +67,44 @@ usage(void)
exit(EXIT_FAILURE);
}
static int
repo_list_uri_cb(struct repository_pool_index *rpi, void *arg, bool *done)
{
(void)arg;
(void)done;
printf("%s\n", rpi->rpi_uri);
return 0;
}
static int
repo_search_pkgs_cb(struct repository_pool_index *rpi, void *arg, bool *done)
{
char *pattern = arg;
(void)done;
printf("From %s repository ...\n", rpi->rpi_uri);
(void)xbps_callback_array_iter_in_dict(rpi->rpi_repod,
"packages", show_pkg_namedesc, pattern);
return 0;
}
int
main(int argc, char **argv)
{
prop_dictionary_t pkgd;
struct repository_pool *rpool;
char *root;
int c, rv = 0;
bool with_debug = false;
while ((c = getopt(argc, argv, "Vcr:")) != -1) {
while ((c = getopt(argc, argv, "Vcdr:")) != -1) {
switch (c) {
case 'c':
xbps_set_cachedir(optarg);
break;
case 'd':
with_debug = true;
break;
case 'r':
/* To specify the root directory */
root = optarg;
@@ -99,11 +125,14 @@ main(int argc, char **argv)
if (argc < 1)
usage();
rv = xbps_repository_pool_init();
if (rv != 0 && rv != ENOENT) {
fprintf(stderr, "E: cannot get repository list pool! %s\n",
strerror(rv));
exit(EXIT_FAILURE);
xbps_init(with_debug);
if ((rv = xbps_repository_pool_init()) != 0) {
if (rv != ENOENT) {
fprintf(stderr, "E: cannot get repository list pool! %s\n",
strerror(rv));
exit(EXIT_FAILURE);
}
}
if (strcasecmp(argv[0], "add") == 0) {
@@ -118,8 +147,7 @@ main(int argc, char **argv)
if (argc != 1)
usage();
SIMPLEQ_FOREACH(rpool, &rp_queue, rp_entries)
printf("%s\n", rpool->rp_uri);
xbps_repository_pool_foreach(repo_list_uri_cb, NULL);
} else if ((strcasecmp(argv[0], "rm") == 0) ||
(strcasecmp(argv[0], "remove") == 0)) {
@@ -137,11 +165,7 @@ main(int argc, char **argv)
if (argc != 2)
usage();
SIMPLEQ_FOREACH(rpool, &rp_queue, rp_entries) {
printf("From %s repository ...\n", rpool->rp_uri);
(void)xbps_callback_array_iter_in_dict(rpool->rp_repod,
"packages", show_pkg_namedesc, argv[1]);
}
xbps_repository_pool_foreach(repo_search_pkgs_cb, argv[1]);
} else if (strcasecmp(argv[0], "show") == 0) {
/* Shows info about a binary package. */
@@ -179,9 +203,15 @@ main(int argc, char **argv)
pkgd = xbps_repository_get_pkg_plist_dict(argv[1],
XBPS_PKGFILES);
if (pkgd == NULL) {
fprintf(stderr,
"E: couldn't read %s: %s.\n", XBPS_PKGFILES,
strerror(errno));
if (errno != ENOENT) {
fprintf(stderr, "xbps-repo: unexpected "
"error '%s' searching for '%s'\n",
strerror(errno), argv[1]);
} else {
fprintf(stderr,
"Package '%s' not found in repository "
"pool.\n", argv[1]);
}
rv = errno;
goto out;
}
@@ -207,6 +237,6 @@ main(int argc, char **argv)
}
out:
xbps_repository_pool_release();
xbps_end();
exit(rv ? EXIT_FAILURE : EXIT_SUCCESS);
}

View File

@@ -33,6 +33,7 @@
#include <assert.h>
#include <xbps_api.h>
#include "../xbps-bin/defs.h"
#include "defs.h"
#include "config.h"
@@ -147,13 +148,15 @@ unregister_repository(const char *uri)
if ((idxstr = sanitize_url(uri)) == NULL)
return errno;
if ((rv = xbps_repository_unregister(idxstr)) != 0) {
if (rv == ENOENT)
fprintf(stderr, "Repository '%s' not actually "
"registered.\n", idxstr);
else
fprintf(stderr, "E: couldn't unregister "
"repository (%s)\n", strerror(rv));
if ((rv = xbps_repository_unregister(idxstr)) == 0)
return 0;
if (rv == ENOENT) {
fprintf(stderr, "Repository '%s' not actually "
"registered.\n", idxstr);
} else {
fprintf(stderr, "E: couldn't unregister "
"repository (%s)\n", strerror(rv));
}
return rv;
@@ -211,14 +214,13 @@ register_repository(const char *uri)
if ((rpi = pkgindex_verify(plist, idxstr)) == NULL)
goto out;
rv = xbps_repository_register(idxstr);
if (rv != 0 && rv != EEXIST) {
fprintf(stderr, "E: couldn't register repository (%s)\n",
strerror(rv));
goto out;
} else if (rv == EEXIST) {
fprintf(stderr, "W: repository already registered.\n");
rv = 0;
if ((rv = xbps_repository_register(idxstr)) != 0) {
if (rv == EEXIST) {
fprintf(stderr, "W: repository already registered.\n");
} else {
fprintf(stderr, "E: couldn't register repository "
"(%s)\n", strerror(errno));
}
goto out;
}
@@ -234,110 +236,111 @@ out:
return rv;
}
static int
repo_show_pkg_info_cb(struct repository_pool_index *rpi, void *arg, bool *done)
{
prop_dictionary_t repo_pkgd, pkg_propsd;
const char *pkgname = arg;
char *url = NULL;
repo_pkgd = xbps_find_pkg_in_dict_by_name(rpi->rpi_repod,
"packages", pkgname);
if (repo_pkgd == NULL)
return errno;
url = xbps_repository_get_path_from_pkg_dict(repo_pkgd, rpi->rpi_uri);
if (url == NULL)
return errno;
printf("Fetching info from: %s\n", rpi->rpi_uri);
pkg_propsd =
xbps_repository_get_pkg_plist_dict_from_url(url, XBPS_PKGPROPS);
if (pkg_propsd == NULL) {
free(url);
return errno;
}
show_pkg_info_only_repo(repo_pkgd);
show_pkg_info(pkg_propsd);
prop_object_release(pkg_propsd);
*done = true;
return 0;
}
int
show_pkg_info_from_repolist(const char *pkgname)
{
struct repository_pool *rp;
prop_dictionary_t repo_pkgd, pkg_propsd;
int rv = 0;
return xbps_repository_pool_foreach(repo_show_pkg_info_cb,
__UNCONST(pkgname));
}
SIMPLEQ_FOREACH(rp, &rp_queue, rp_entries) {
char *url = NULL;
repo_pkgd = xbps_find_pkg_in_dict_by_name(rp->rp_repod,
"packages", pkgname);
if (repo_pkgd == NULL) {
if (errno && errno != ENOENT) {
rv = errno;
break;
}
continue;
}
url = xbps_repository_get_path_from_pkg_dict(repo_pkgd,
rp->rp_uri);
if (url == NULL) {
rv = errno;
break;
}
printf("Fetching info from: %s\n", rp->rp_uri);
pkg_propsd = xbps_repository_get_pkg_plist_dict_from_url(url,
XBPS_PKGPROPS);
if (pkg_propsd == NULL) {
free(url);
rv = errno;
break;
}
show_pkg_info_only_repo(repo_pkgd);
show_pkg_info(pkg_propsd);
prop_object_release(pkg_propsd);
break;
static int
repo_show_pkg_deps_cb(struct repository_pool_index *rpi, void *arg, bool *done)
{
prop_dictionary_t pkgd;
const char *ver, *pkgname = arg;
pkgd = xbps_find_pkg_in_dict_by_name(rpi->rpi_repod,
"packages", pkgname);
if (pkgd == NULL) {
if (errno && errno != ENOENT)
return errno;
return 0;
}
prop_dictionary_get_cstring_nocopy(pkgd, "version", &ver);
printf("Repository %s [pkgver: %s]\n", rpi->rpi_uri, ver);
(void)xbps_callback_array_iter_in_dict(pkgd,
"run_depends", list_strings_sep_in_array, NULL);
*done = true;
return rv;
return 0;
}
int
show_pkg_deps_from_repolist(const char *pkgname)
{
struct repository_pool *rd;
prop_dictionary_t pkgd;
const char *ver;
return xbps_repository_pool_foreach(repo_show_pkg_deps_cb,
__UNCONST(pkgname));
}
static int
repo_sync_pkg_index_cb(struct repository_pool_index *rpi, void *arg, bool *done)
{
struct repoinfo *rp;
char *plist;
int rv = 0;
SIMPLEQ_FOREACH(rd, &rp_queue, rp_entries) {
pkgd = xbps_find_pkg_in_dict_by_name(rd->rp_repod,
"packages", pkgname);
if (pkgd == NULL) {
if (errno != ENOENT) {
rv = errno;
break;
}
continue;
}
prop_dictionary_get_cstring_nocopy(pkgd, "version", &ver);
printf("Repository %s [pkgver: %s]\n", rd->rp_uri, ver);
(void)xbps_callback_array_iter_in_dict(pkgd,
"run_depends", list_strings_sep_in_array, NULL);
}
(void)arg;
(void)done;
return rv;
if (!xbps_check_is_repo_string_remote(rpi->rpi_uri))
return 0;
printf("Syncing package index from: %s\n", rpi->rpi_uri);
rv = xbps_repository_sync_pkg_index(rpi->rpi_uri);
if (rv == -1) {
fprintf(stderr, "E: returned: %s\n", xbps_fetch_error_string());
return rv;
} else if (rv == 0) {
printf("Package index file is already up to date.\n");
return 0;
}
if ((plist = xbps_get_pkg_index_plist(rpi->rpi_uri)) == NULL)
return EINVAL;
if ((rp = pkgindex_verify(plist, rpi->rpi_uri)) == NULL)
return errno;
printf("Updated package index at %s (v%s) with %ju packages.\n",
rpi->rpi_uri, rp->pkgidxver, rp->totalpkgs);
free(rp);
free(plist);
return 0;
}
int
repository_sync(void)
{
struct repository_pool *rp;
char *plist;
int rv = 0;
SIMPLEQ_FOREACH(rp, &rp_queue, rp_entries) {
struct repoinfo *rpi = NULL;
if (!xbps_check_is_repo_string_remote(rp->rp_uri))
continue;
printf("Syncing package index from: %s\n", rp->rp_uri);
rv = xbps_repository_sync_pkg_index(rp->rp_uri);
if (rv == -1) {
fprintf(stderr, "E: returned: %s\n",
xbps_fetch_error_string());
break;
} else if (rv == 0) {
printf("Package index file is already up to date.\n");
continue;
}
if ((plist = xbps_get_pkg_index_plist(rp->rp_uri)) == NULL) {
rv = EINVAL;
break;
}
if ((rpi = pkgindex_verify(plist, rp->rp_uri)) == NULL) {
rv = errno;
break;
}
printf("Updated package index at %s (v%s) with %ju packages.\n",
rp->rp_uri, rpi->pkgidxver, rpi->totalpkgs);
free(rpi);
free(plist);
}
return rv;
return xbps_repository_pool_foreach(repo_sync_pkg_index_cb, NULL);
}

View File

@@ -2,12 +2,12 @@
.\" Title: xbps-repo
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\" Date: 05/03/2010
.\" Date: 18/11/2010
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
.TH "XBPS\-REPO" "8" "05/03/2010" "\ \&" "\ \&"
.TH "XBPS\-REPO" "8" "18/11/2010" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -43,6 +43,11 @@ of
\fI/blah/cachedir\fR\&.
.RE
.PP
\fB\-d\fR
.RS 4
Enables extra debugging output to be shown to stderr.
.RE
.PP
\fB\-r\fR \fIrootdir\fR
.RS 4
Sets the

View File

@@ -30,6 +30,7 @@
#include <errno.h>
#include <ctype.h>
#include <assert.h>
#include <unistd.h>
#include <xbps_api.h>
@@ -131,6 +132,8 @@ main(int argc, char **argv)
if (argc < 1)
usage();
xbps_init(false);
plist = xbps_xasprintf("%s/%s/%s", root, XBPS_META_PATH, XBPS_REGPKGDB);
if (plist == NULL) {
fprintf(stderr,
@@ -314,8 +317,6 @@ main(int argc, char **argv)
if (argc != 2)
usage();
xbps_fetch_set_cache_connection(0, 0);
for (i = 1; i < argc; i++) {
rv = xbps_fetch_file(argv[i], ".", false, "v");
if (rv == -1) {
@@ -332,5 +333,7 @@ main(int argc, char **argv)
usage();
}
xbps_end();
exit(EXIT_SUCCESS);
}