xbps_{configure,remove}_pkg: do not use meta cache when executing scripts.

This fixes executing INSTALL/REMOVE scripts with the right version currently
installed, i.e kernel post-install failed to execute correctly its kernel
hooks due to passing a wrong version.
This commit is contained in:
Juan RP 2012-11-26 23:25:41 +01:00
parent 25612870f0
commit 85c0641cc8
2 changed files with 10 additions and 2 deletions

View File

@ -79,6 +79,7 @@ xbps_configure_pkg(struct xbps_handle *xhp,
{
prop_dictionary_t pkgd, pkgmetad;
const char *version, *pkgver;
char *plist;
int rv = 0;
pkg_state_t state = 0;
@ -110,7 +111,10 @@ xbps_configure_pkg(struct xbps_handle *xhp,
xbps_set_cb_state(xhp, XBPS_STATE_CONFIGURE, 0, pkgname, version, NULL);
pkgmetad = xbps_metadir_get_pkgd(xhp, pkgname);
/* internalize pkg dictionary from metadir */
plist = xbps_xasprintf("%s/.%s.plist", xhp->metadir, pkgname);
pkgmetad = prop_dictionary_internalize_from_file(plist);
free(plist);
assert(pkgmetad);
rv = xbps_pkg_exec_script(xhp, pkgmetad, "install-script", "post", update);

View File

@ -241,7 +241,11 @@ xbps_remove_pkg(struct xbps_handle *xhp,
pkgver, xhp->rootdir, strerror(rv));
goto out;
}
pkgd = xbps_metadir_get_pkgd(xhp, pkgname);
/* internalize pkg dictionary from metadir */
buf = xbps_xasprintf("%s/.%s.plist", xhp->metadir, pkgname);
pkgd = prop_dictionary_internalize_from_file(buf);
free(buf);
if (pkgd == NULL)
xbps_dbg_printf(xhp, "WARNING: metaplist for %s "
"doesn't exist!\n", pkgname);