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

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;