]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
rpmdb: Also detect rpmdb.sqlite in /usr/share/rpm 386/head
authorColin Walters <walters@verbum.org>
Mon, 25 May 2020 20:43:37 +0000 (20:43 +0000)
committerColin Walters <walters@verbum.org>
Mon, 25 May 2020 20:45:32 +0000 (20:45 +0000)
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

index 34e66989d0f28a37c66ebe67824f8ac857c46c06..35a46face86ba26e154788e1b43e5b0401973d0f 100644 (file)
@@ -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";
 }