xbps-pkgdb: unfix previous, pkg metafile must be internalized.

This commit is contained in:
Juan RP 2014-09-11 08:04:51 +02:00
parent bd2bb98fa7
commit e32f7f4909

View File

@ -94,6 +94,7 @@ check_pkg_integrity(struct xbps_handle *xhp,
if (xbps_dictionary_get_cstring_nocopy(opkgd, "metafile-sha256", &sha256)) { if (xbps_dictionary_get_cstring_nocopy(opkgd, "metafile-sha256", &sha256)) {
buf = xbps_xasprintf("%s/.%s-files.plist", buf = xbps_xasprintf("%s/.%s-files.plist",
xhp->metadir, pkgname); xhp->metadir, pkgname);
filesd = xbps_dictionary_internalize_from_file(buf);
rv = xbps_file_hash_check(buf, sha256); rv = xbps_file_hash_check(buf, sha256);
free(buf); free(buf);
if (rv == ENOENT) { if (rv == ENOENT) {
@ -104,6 +105,7 @@ check_pkg_integrity(struct xbps_handle *xhp,
xbps_object_release(filesd); xbps_object_release(filesd);
fprintf(stderr, "%s: metadata file has been " fprintf(stderr, "%s: metadata file has been "
"modified!\n", pkgname); "modified!\n", pkgname);
xbps_object_release(filesd);
return 1; return 1;
} }
} }