xbps_remove_pkg: force pkgdb flush after unregister.

This commit is contained in:
Juan RP 2012-11-19 14:40:41 +01:00
parent e861cb5331
commit 34ae90f1c3

View File

@ -352,19 +352,21 @@ purge:
*/ */
buf = xbps_xasprintf("%s/.%s.plist", xhp->metadir, pkgname); buf = xbps_xasprintf("%s/.%s.plist", xhp->metadir, pkgname);
if (remove(buf) == -1) { if (remove(buf) == -1) {
xbps_set_cb_state(xhp, XBPS_STATE_REMOVE_FAIL, if (errno != ENOENT) {
rv, pkgname, version, xbps_set_cb_state(xhp, XBPS_STATE_REMOVE_FAIL,
"%s: failed to remove metadata file: %s", rv, pkgname, version,
pkgver, strerror(errno)); "%s: failed to remove metadata file: %s",
if (errno != ENOENT) pkgver, strerror(errno));
goto out; }
} }
/* /*
* Unregister package from pkgdb. * Unregister package from pkgdb.
*/ */
if ((rv = xbps_unregister_pkg(xhp, pkgname, version, false)) != 0) if ((rv = xbps_unregister_pkg(xhp, pkgname, version, true)) != 0)
goto out; goto out;
xbps_dbg_printf(xhp, "[remove] unregister %s returned %d\n", pkgver);
tmpname = xbps_pkg_name(pkgver); tmpname = xbps_pkg_name(pkgver);
assert(tmpname); assert(tmpname);
tmpver = xbps_pkg_version(pkgver); tmpver = xbps_pkg_version(pkgver);