xbps_dictionary_from_metadata_plist: if pkgname not found try from a

virtual pkg.
This commit is contained in:
Juan RP 2011-10-16 10:27:02 +02:00
parent a59f48585f
commit 0f0c66fafb

View File

@ -195,17 +195,24 @@ xbps_dictionary_from_metadata_plist(const char *pkgname,
assert(plist != NULL); assert(plist != NULL);
xhp = xbps_handle_get(); xhp = xbps_handle_get();
plistf = xbps_xasprintf("%s/%s/metadata/%s/%s",
xhp->rootdir, XBPS_META_PATH, pkgname, plist);
if (plistf == NULL)
return NULL;
if (access(plistf, R_OK) == -1) {
pkgd = xbps_find_virtualpkg_dict_installed(pkgname, false); pkgd = xbps_find_virtualpkg_dict_installed(pkgname, false);
if (pkgd) { if (pkgd) {
prop_dictionary_get_cstring_nocopy(pkgd, "pkgname", &rpkgname); prop_dictionary_get_cstring_nocopy(pkgd, "pkgname", &rpkgname);
prop_object_release(pkgd); prop_object_release(pkgd);
pkgname = rpkgname; pkgname = rpkgname;
} }
free(plistf);
plistf = xbps_xasprintf("%s/%s/metadata/%s/%s", plistf = xbps_xasprintf("%s/%s/metadata/%s/%s",
xhp->rootdir, XBPS_META_PATH, pkgname, plist); xhp->rootdir, XBPS_META_PATH, pkgname, plist);
if (plistf == NULL) if (plistf == NULL)
return NULL; return NULL;
}
plistd = prop_dictionary_internalize_from_zfile(plistf); plistd = prop_dictionary_internalize_from_zfile(plistf);
free(plistf); free(plistf);