Skip to content

Commit f9cf682

Browse files
committed
bin/xbps-remove: work around multi threading issue in --clean-cache
Fixes: #660
1 parent 8cb883d commit f9cf682

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

bin/xbps-remove/clean-cache.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,12 @@ clean_cachedir(struct xbps_handle *xhp, bool uninstalled, bool drun)
148148
// XXX: there is no public api to load the pkgdb so force it before
149149
// its done potentially concurrently by threads through the
150150
// xbps_array_foreach_cb_multi call later.
151-
(void)xbps_pkgdb_get_pkg(xhp, "foo");
151+
// XXX: same for the repository pool...
152+
if (uninstalled) {
153+
(void)xbps_pkgdb_get_pkg(xhp, "foo");
154+
} else {
155+
(void)xbps_rpool_get_pkg(xhp, "package-that-wont-exist-so-it-loads-all-repos");
156+
}
152157

153158
if (chdir(xhp->cachedir) == -1) {
154159
if (errno == ENOENT)

0 commit comments

Comments
 (0)