Skip to content

Commit 39803ba

Browse files
committed
bin/xbps-remove: work around multi threading issue in --clean-cache
Fixes: #660
1 parent e2a9b5b commit 39803ba

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

bin/xbps-remove/clean-cache.c

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

155161
if (chdir(xhp->cachedir) == -1) {
156162
if (errno == ENOENT)

0 commit comments

Comments
 (0)