xbps_dictionary_from_metadata_plist: fix this with empty regpkgdb.plist.
If regpkgdb wasn't initialized it failed to properly internalize the dictionary from the plist file.
This commit is contained in:
parent
6b02c28bd7
commit
ce0b21a062
10
lib/plist.c
10
lib/plist.c
@ -196,14 +196,14 @@ xbps_dictionary_from_metadata_plist(const char *pkgname,
|
|||||||
xhp = xbps_handle_get();
|
xhp = xbps_handle_get();
|
||||||
|
|
||||||
pkgd = xbps_find_virtualpkg_dict_installed(pkgname, false);
|
pkgd = xbps_find_virtualpkg_dict_installed(pkgname, false);
|
||||||
if (pkgd == NULL)
|
if (pkgd) {
|
||||||
return NULL;
|
|
||||||
|
|
||||||
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;
|
||||||
|
}
|
||||||
|
|
||||||
plistf = xbps_xasprintf("%s/%s/metadata/%s/%s",
|
plistf = xbps_xasprintf("%s/%s/metadata/%s/%s",
|
||||||
xhp->rootdir, XBPS_META_PATH, rpkgname, plist);
|
xhp->rootdir, XBPS_META_PATH, pkgname, plist);
|
||||||
if (plistf == NULL)
|
if (plistf == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
@ -211,7 +211,7 @@ xbps_dictionary_from_metadata_plist(const char *pkgname,
|
|||||||
free(plistf);
|
free(plistf);
|
||||||
if (plistd == NULL) {
|
if (plistd == NULL) {
|
||||||
xbps_dbg_printf("cannot read from plist file %s for %s: %s\n",
|
xbps_dbg_printf("cannot read from plist file %s for %s: %s\n",
|
||||||
plist, rpkgname, strerror(errno));
|
plist, pkgname, strerror(errno));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user