xbps-repo: show, show-deps and show-files targets accepts pkgpatterns.

This commit is contained in:
Juan RP 2012-02-16 08:55:41 +01:00
parent 6e50919d2b
commit 7a9d47c133
3 changed files with 34 additions and 10 deletions

14
NEWS
View File

@ -1,3 +1,17 @@
xbps-0.12.1 (2012-02-14):
* xbps-repo(8): the `show', `show-deps' and `show-files' targets now accept
package patterns, i.e "xbps-repo show 'foo>=2.0'". If only a `pkgname`
has been specified, the newest package available in repositories will be
shown.
* xbps-repo(8): print meaningful help usage, added -h option.
* xbps-bin(8): print a meaningful help usage, added -h option.
* libxbps: fixed xbps_transaction_install_pkg return value if package
is already installed: this must be EEXIST not ENODEV.
xbps-0.12.0 (2012-02-06):
* xbps-bin: new dry-run mode (-n) to show the actions that would

View File

@ -55,6 +55,8 @@ usage(bool fail)
"[targets]\n"
" find-files <pattern> [patterns]\n"
" Print package name/version for any pattern matched.\n"
" genindex <directory>\n"
" Generate a local repository in `directory'.\n"
" list\n"
" List registered repositories.\n"
" pkg-list [index]\n"
@ -62,12 +64,12 @@ usage(bool fail)
" If `index' not specified, all registered repositories will be used.\n"
" search <pattern> [patterns]\n"
" Search for packages in repositories matching the patterns.\n"
" show <pkgname>\n"
" Print package information for `pkgname'.\n"
" show-deps <pkgname>\n"
" Print package's required dependencies for `pkgname'.\n"
" show-files <pkgname>\n"
" Print package's files list for `pkgname'.\n"
" show <pkgname|pkgpattern>\n"
" Print package information for `pkgname' or `pkgpattern'.\n"
" show-deps <pkgname|pkgpattern>\n"
" Print package's required dependencies for `pkgname' or `pkgpattern'.\n"
" show-files <pkgname|pkgpattern>\n"
" Print package's files list for `pkgname' or `pkgpattern'.\n"
" sync\n"
" Synchronize package index files for all registered repositories.\n\n"
"Refer to xbps-repo(8) for a more detailed description.\n");

View File

@ -44,11 +44,15 @@
#include "defs.h"
int
show_pkg_info_from_repolist(const char *pkgname, const char *option)
show_pkg_info_from_repolist(const char *pattern, const char *option)
{
prop_dictionary_t pkgd;
pkgd = xbps_repository_pool_find_pkg(pkgname, false, false);
if (xbps_pkgpattern_version(pattern))
pkgd = xbps_repository_pool_find_pkg(pattern, true, false);
else
pkgd = xbps_repository_pool_find_pkg(pattern, false, true);
if (pkgd == NULL)
return errno;
@ -63,12 +67,16 @@ show_pkg_info_from_repolist(const char *pkgname, const char *option)
}
int
show_pkg_deps_from_repolist(const char *pkgname)
show_pkg_deps_from_repolist(const char *pattern)
{
prop_dictionary_t pkgd;
const char *ver, *repoloc;
pkgd = xbps_repository_pool_find_pkg(pkgname, false, false);
if (xbps_pkgpattern_version(pattern))
pkgd = xbps_repository_pool_find_pkg(pattern, true, false);
else
pkgd = xbps_repository_pool_find_pkg(pattern, false, true);
if (pkgd == NULL)
return errno;