xbps-uhelper: make the 'version' target also match virtual pkgs.

This commit is contained in:
Juan RP 2013-03-25 21:11:30 +01:00
parent 4411ff82ac
commit e25216822b

View File

@ -155,8 +155,8 @@ main(int argc, char **argv)
if (argc != 2)
usage();
dict = xbps_pkgdb_get_pkg(&xh, argv[1]);
if (dict == NULL)
if ((((dict = xbps_pkgdb_get_pkg(&xh, argv[1])) == NULL)) &&
(((dict = xbps_pkgdb_get_virtualpkg(&xh, argv[1])) == NULL)))
exit(EXIT_FAILURE);
prop_dictionary_get_cstring_nocopy(dict, "pkgver", &version);