From 34ae90f1c363d6e89dd1e4ff732e1a1e1dd36d04 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Mon, 19 Nov 2012 14:40:41 +0100 Subject: [PATCH] xbps_remove_pkg: force pkgdb flush after unregister. --- lib/package_remove.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/package_remove.c b/lib/package_remove.c index 987be562..3b688fdc 100644 --- a/lib/package_remove.c +++ b/lib/package_remove.c @@ -352,19 +352,21 @@ purge: */ buf = xbps_xasprintf("%s/.%s.plist", xhp->metadir, pkgname); if (remove(buf) == -1) { - xbps_set_cb_state(xhp, XBPS_STATE_REMOVE_FAIL, - rv, pkgname, version, - "%s: failed to remove metadata file: %s", - pkgver, strerror(errno)); - if (errno != ENOENT) - goto out; + if (errno != ENOENT) { + xbps_set_cb_state(xhp, XBPS_STATE_REMOVE_FAIL, + rv, pkgname, version, + "%s: failed to remove metadata file: %s", + pkgver, strerror(errno)); + } } /* * 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; + xbps_dbg_printf(xhp, "[remove] unregister %s returned %d\n", pkgver); + tmpname = xbps_pkg_name(pkgver); assert(tmpname); tmpver = xbps_pkg_version(pkgver);