xbps-repo: search target: also report exact matches by pkgname.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100114000654-tnrtvi1ymy2iveyx
This commit is contained in:
Juan RP 2010-01-14 01:06:54 +01:00
parent 15be7b43a4
commit 6c29fe7514

View File

@ -179,7 +179,7 @@ show_pkg_files(prop_dictionary_t filesd)
int
show_pkg_namedesc(prop_object_t obj, void *arg, bool *loop_done)
{
const char *pkgver, *desc;
const char *pkgver, *pkgname, *desc;
char *pattern = arg;
(void)loop_done;
@ -187,11 +187,14 @@ show_pkg_namedesc(prop_object_t obj, void *arg, bool *loop_done)
assert(prop_object_type(obj) == PROP_TYPE_DICTIONARY);
assert(pattern != NULL);
prop_dictionary_get_cstring_nocopy(obj, "pkgname", &pkgname);
prop_dictionary_get_cstring_nocopy(obj, "pkgver", &pkgver);
prop_dictionary_get_cstring_nocopy(obj, "short_desc", &desc);
if (xbps_pkgdep_match(pkgver, pattern) == 1)
printf(" %s - %s\n", pkgver, desc);
else if (strcmp(pkgname, pattern) == 0)
printf(" %s - %s\n", pkgver, desc);
return 0;
}