From: Michael Schroeder Date: Tue, 3 Feb 2026 12:06:29 +0000 (+0100) Subject: detect_dbpath: also check for /usr/lib/sysimage/rpm X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d5e10ee870594c1772e587d3f8ffbdf906bdc2b;p=thirdparty%2Flibsolv.git detect_dbpath: also check for /usr/lib/sysimage/rpm Because it's the right location nowadays. (Should not matter much, as %_dbpath should be set in most cases.) --- diff --git a/ext/repo_rpmdb_librpm.h b/ext/repo_rpmdb_librpm.h index 3f9798c2..695025ca 100644 --- a/ext/repo_rpmdb_librpm.h +++ b/ext/repo_rpmdb_librpm.h @@ -54,9 +54,20 @@ detect_dbpath(struct rpmdbstate *state) return; } solv_free((char *)state->dbpath); - 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/rpmdb.sqlite", R_OK) == 0) - ? "/usr/share/rpm" : "/var/lib/rpm"; + if (access_rootdir(state, "/var/lib/rpm", W_OK) == -1) + { + if (access_rootdir(state, "/usr/share/rpm/Packages", R_OK) == 0 || access_rootdir(state, "/usr/share/rpm/rpmdb.sqlite", R_OK)) + { + state->dbpath = "/usr/share/rpm"; + return; + } + if (access_rootdir(state, "/usr/lib/sysimage/rpm/Packages.db", R_OK) == 0 || access_rootdir(state, "/usr/lib/sysimage/rpm/rpmdb.sqlite", R_OK) || access_rootdir(state, "/usr/lib/sysimage/rpm/Packages", R_OK)) + { + state->dbpath = "/usr/lib/sysimage/rpm"; + return; + } + } + state->dbpath = "/var/lib/rpm"; } static int