From 00f2815a6cceb04fdf3cf4ee12c76d9806af06f2 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mon, 25 May 2020 20:43:37 +0000 Subject: [PATCH] rpmdb: Also detect rpmdb.sqlite in /usr/share/rpm See: https://bugzilla.redhat.com/show_bug.cgi?id=1838691 This is obviously adding to a tower of hacks; what we really want is for this logic to live in librpm and be standardized. But in order to fix the immediate issue of detecting the rpmdb on rpm-ostree based systems (and any others that use `/usr/share/rpm`), add the sqlite path to detection. See also http://lists.rpm.org/pipermail/rpm-maint/2017-October/006681.html --- ext/repo_rpmdb_librpm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/repo_rpmdb_librpm.h b/ext/repo_rpmdb_librpm.h index 34e66989..35a46fac 100644 --- a/ext/repo_rpmdb_librpm.h +++ b/ext/repo_rpmdb_librpm.h @@ -46,7 +46,7 @@ static void detect_dbpath(struct rpmdbstate *state) { state->dbpath = access_rootdir(state, "/var/lib/rpm", W_OK) == -1 - && access_rootdir(state, "/usr/share/rpm/Packages", R_OK) == 0 + && (access_rootdir(state, "/usr/share/rpm/Packages", R_OK) == 0 || access_rootdir(state, "/usr/share/rpm/rpmdb.sqlite", R_OK) == 0) ? "/usr/share/rpm" : "/var/lib/rpm"; } -- 2.47.2