xbps-query: added support to query virtual packages in repository mode.

This commit is contained in:
Juan RP 2013-03-02 19:10:13 +01:00
parent 7e171b67cf
commit c50cbf03c7
3 changed files with 15 additions and 7 deletions

7
NEWS
View File

@ -1,5 +1,12 @@
xbps-0.21 (???): xbps-0.21 (???):
* xbps-query(8): packages can be matched by using virtual package
names in repository mode, i.e:
$ xbps-query -Rp pkgver ntp-daemon
ntp-4.2.6p5_7
$
* xbps-pkgdb(8): new option -m --mode to change package installation * xbps-pkgdb(8): new option -m --mode to change package installation
mode to auto (might be detected as orphan) or manual mode to auto (might be detected as orphan) or manual
(explicitly installed). (explicitly installed).

View File

@ -73,8 +73,8 @@ repo_show_pkg_deps(struct xbps_handle *xhp, const char *pattern)
{ {
prop_dictionary_t pkgd; prop_dictionary_t pkgd;
pkgd = xbps_rpool_get_pkg(xhp, pattern); if (((pkgd = xbps_rpool_get_pkg(xhp, pattern)) == NULL) &&
if (pkgd == NULL) ((pkgd = xbps_rpool_get_virtualpkg(xhp, pattern)) == NULL))
return errno; return errno;
(void)xbps_callback_array_iter_in_dict(xhp, pkgd, (void)xbps_callback_array_iter_in_dict(xhp, pkgd,
@ -126,9 +126,10 @@ repo_show_pkg_revdeps(struct xbps_handle *xhp, const char *pkg)
if (xbps_pkg_version(pkg)) if (xbps_pkg_version(pkg))
pkgver = pkg; pkgver = pkg;
else { else {
pkgd = xbps_rpool_get_pkg(xhp, pkg); if (((pkgd = xbps_rpool_get_pkg(xhp, pkg)) == NULL) &&
if (pkgd == NULL) ((pkgd = xbps_rpool_get_virtualpkg(xhp, pkg)) == NULL))
return ENOENT; return ENOENT;
prop_dictionary_get_cstring_nocopy(pkgd, "pkgver", &pkgver); prop_dictionary_get_cstring_nocopy(pkgd, "pkgver", &pkgver);
} }

View File

@ -1,5 +1,5 @@
/*- /*-
* Copyright (c) 2008-2012 Juan Romero Pardines. * Copyright (c) 2008-2013 Juan Romero Pardines.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -295,8 +295,8 @@ repo_show_pkg_info(struct xbps_handle *xhp,
{ {
prop_dictionary_t pkgd; prop_dictionary_t pkgd;
pkgd = xbps_rpool_get_pkg(xhp, pattern); if (((pkgd = xbps_rpool_get_pkg(xhp, pattern)) == NULL) &&
if (pkgd == NULL) ((pkgd = xbps_rpool_get_virtualpkg(xhp, pattern)) == NULL))
return errno; return errno;
if (option) if (option)