xbps-query(8): -L now prints all repos, including non working repos (close #11).
This commit is contained in:
parent
e0643acbb0
commit
20f2d10527
10
NEWS
10
NEWS
@ -1,5 +1,15 @@
|
|||||||
xbps-0.26 (???):
|
xbps-0.26 (???):
|
||||||
|
|
||||||
|
* xbps-query(8): make -L list all repositories in the configuration file, even
|
||||||
|
the non working ones and print -1 in them. Closes issue #11 from github.
|
||||||
|
|
||||||
|
$ xbps-query -L
|
||||||
|
-1 /mnt/foo
|
||||||
|
-1 /blah/foo
|
||||||
|
2619 /mnt/xbps_builder/host/binpkgs
|
||||||
|
16 /mnt/xbps_builder/host/binpkgs/nonfree
|
||||||
|
$
|
||||||
|
|
||||||
* xbps-query(8): fixed some memleaks in local and repository owned mode.
|
* xbps-query(8): fixed some memleaks in local and repository owned mode.
|
||||||
|
|
||||||
* xbps-query(8): fix regression in -R, also print repository string object.
|
* xbps-query(8): fix regression in -R, also print repository string object.
|
||||||
|
@ -156,8 +156,7 @@ repo_list_uri_cb(struct xbps_repo *repo, void *arg, bool *done)
|
|||||||
(void)arg;
|
(void)arg;
|
||||||
(void)done;
|
(void)done;
|
||||||
|
|
||||||
printf("%s (%u packages)\n", repo->uri,
|
printf("%5zd %s\n", repo->idx ? (ssize_t)xbps_dictionary_count(repo->idx) : -1, repo->uri);
|
||||||
xbps_dictionary_count(repo->idx));
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
.Dd March 4, 2013
|
.Dd July 26, 2013
|
||||||
.Os Void Linux
|
.Os Void Linux
|
||||||
.Dt xbps-query 8
|
.Dt xbps-query 8
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
@ -101,7 +101,9 @@ and can be fully removed with
|
|||||||
Package state is unknown.
|
Package state is unknown.
|
||||||
.El
|
.El
|
||||||
.It Fl L, Fl -list-repos
|
.It Fl L, Fl -list-repos
|
||||||
Lists registered and working repositories.
|
Lists repositories and the number of packages contained on them. If a repository is not
|
||||||
|
available the number of packages will be
|
||||||
|
.Sy -1 .
|
||||||
.It Fl m, Fl -list-manual-pkgs
|
.It Fl m, Fl -list-manual-pkgs
|
||||||
Lists registered packages in the package database (pkgdb) that were installed
|
Lists registered packages in the package database (pkgdb) that were installed
|
||||||
manually by the user (i.e not as dependency of any package).
|
manually by the user (i.e not as dependency of any package).
|
||||||
|
23
lib/repo.c
23
lib/repo.c
@ -84,7 +84,7 @@ xbps_repo_open(struct xbps_handle *xhp, const char *url)
|
|||||||
archive_read_support_format_tar(repo->ar);
|
archive_read_support_format_tar(repo->ar);
|
||||||
|
|
||||||
if (archive_read_open_filename(repo->ar, repofile, ARCHIVE_READ_BLOCKSIZE)) {
|
if (archive_read_open_filename(repo->ar, repofile, ARCHIVE_READ_BLOCKSIZE)) {
|
||||||
xbps_dbg_printf(xhp, "cannot open repository file %s: %s\n",
|
xbps_dbg_printf(xhp, "[repo] cannot open repository file %s: %s\n",
|
||||||
repofile, strerror(archive_errno(repo->ar)));
|
repofile, strerror(archive_errno(repo->ar)));
|
||||||
archive_read_free(repo->ar);
|
archive_read_free(repo->ar);
|
||||||
free(repo);
|
free(repo);
|
||||||
@ -105,9 +105,11 @@ xbps_repo_get_plist(struct xbps_repo *repo, const char *file)
|
|||||||
int rv;
|
int rv;
|
||||||
|
|
||||||
assert(repo);
|
assert(repo);
|
||||||
assert(repo->ar);
|
|
||||||
assert(file);
|
assert(file);
|
||||||
|
|
||||||
|
if (repo->ar == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
rv = archive_read_next_header(repo->ar, &entry);
|
rv = archive_read_next_header(repo->ar, &entry);
|
||||||
if (rv == ARCHIVE_EOF || rv == ARCHIVE_FATAL)
|
if (rv == ARCHIVE_EOF || rv == ARCHIVE_FATAL)
|
||||||
@ -137,6 +139,9 @@ xbps_repo_close(struct xbps_repo *repo)
|
|||||||
{
|
{
|
||||||
assert(repo);
|
assert(repo);
|
||||||
|
|
||||||
|
if (repo->ar == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
archive_read_free(repo->ar);
|
archive_read_free(repo->ar);
|
||||||
if (xbps_object_type(repo->idx) == XBPS_TYPE_DICTIONARY)
|
if (xbps_object_type(repo->idx) == XBPS_TYPE_DICTIONARY)
|
||||||
xbps_object_release(repo->idx);
|
xbps_object_release(repo->idx);
|
||||||
@ -151,12 +156,15 @@ xbps_repo_get_virtualpkg(struct xbps_repo *repo, const char *pkg)
|
|||||||
xbps_dictionary_t pkgd;
|
xbps_dictionary_t pkgd;
|
||||||
|
|
||||||
assert(repo);
|
assert(repo);
|
||||||
assert(repo->ar);
|
|
||||||
assert(pkg);
|
assert(pkg);
|
||||||
|
|
||||||
|
if (repo->ar == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
if (xbps_object_type(repo->idx) != XBPS_TYPE_DICTIONARY) {
|
if (xbps_object_type(repo->idx) != XBPS_TYPE_DICTIONARY) {
|
||||||
repo->idx = xbps_repo_get_plist(repo, XBPS_PKGINDEX);
|
repo->idx = xbps_repo_get_plist(repo, XBPS_PKGINDEX);
|
||||||
assert(repo->idx);
|
if (repo->idx == NULL)
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
pkgd = xbps_find_virtualpkg_in_dict(repo->xhp, repo->idx, pkg);
|
pkgd = xbps_find_virtualpkg_in_dict(repo->xhp, repo->idx, pkg);
|
||||||
if (pkgd) {
|
if (pkgd) {
|
||||||
@ -173,12 +181,15 @@ xbps_repo_get_pkg(struct xbps_repo *repo, const char *pkg)
|
|||||||
xbps_dictionary_t pkgd;
|
xbps_dictionary_t pkgd;
|
||||||
|
|
||||||
assert(repo);
|
assert(repo);
|
||||||
assert(repo->ar);
|
|
||||||
assert(pkg);
|
assert(pkg);
|
||||||
|
|
||||||
|
if (repo->ar == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
if (xbps_object_type(repo->idx) != XBPS_TYPE_DICTIONARY) {
|
if (xbps_object_type(repo->idx) != XBPS_TYPE_DICTIONARY) {
|
||||||
repo->idx = xbps_repo_get_plist(repo, XBPS_PKGINDEX);
|
repo->idx = xbps_repo_get_plist(repo, XBPS_PKGINDEX);
|
||||||
assert(repo->idx);
|
if (repo->idx == NULL)
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
pkgd = xbps_find_pkg_in_dict(repo->idx, pkg);
|
pkgd = xbps_find_pkg_in_dict(repo->idx, pkg);
|
||||||
if (pkgd) {
|
if (pkgd) {
|
||||||
|
@ -68,15 +68,10 @@ xbps_rpool_init(struct xbps_handle *xhp)
|
|||||||
assert(rp);
|
assert(rp);
|
||||||
repouri = cfg_getnstr(xhp->cfg, "repositories", i);
|
repouri = cfg_getnstr(xhp->cfg, "repositories", i);
|
||||||
if ((rp->repo = xbps_repo_open(xhp, repouri)) == NULL) {
|
if ((rp->repo = xbps_repo_open(xhp, repouri)) == NULL) {
|
||||||
free(rp);
|
rp->repo = calloc(1, sizeof(struct xbps_repo));
|
||||||
continue;
|
assert(rp->repo);
|
||||||
}
|
}
|
||||||
rp->repo->idx = xbps_repo_get_plist(rp->repo, XBPS_PKGINDEX);
|
rp->repo->idx = xbps_repo_get_plist(rp->repo, XBPS_PKGINDEX);
|
||||||
if (rp->repo->idx == NULL) {
|
|
||||||
xbps_repo_close(rp->repo);
|
|
||||||
free(rp);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
rp->repo->uri = repouri;
|
rp->repo->uri = repouri;
|
||||||
rp->repo->xhp = xhp;
|
rp->repo->xhp = xhp;
|
||||||
SIMPLEQ_INSERT_TAIL(&rpool_queue, rp, entries);
|
SIMPLEQ_INSERT_TAIL(&rpool_queue, rp, entries);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user