Skip to content

Commit

Permalink
Fix rpm-software-management#362 : try to detect data.mdb for lmdb also
Browse files Browse the repository at this point in the history
  • Loading branch information
云祁 committed Mar 22, 2018
1 parent 3b4db85 commit 76518a0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
14 changes: 11 additions & 3 deletions libdnf/dnf-context.cpp
Expand Up @@ -1570,14 +1570,22 @@ dnf_context_setup(DnfContext *context,

/* setup a file monitor on the rpmdb, if we're operating on the native / */
if (g_strcmp0(priv->install_root, "/") == 0) {
rpmdb_path = g_build_filename(priv->install_root, "var/lib/rpm/Packages", NULL);
rpmdb_path = g_build_filename(priv->install_root, "var/lib/rpm/data.mdb", NULL);
file_rpmdb = g_file_new_for_path(rpmdb_path);
priv->monitor_rpmdb = g_file_monitor_file(file_rpmdb,
G_FILE_MONITOR_NONE,
NULL,
error);
if (priv->monitor_rpmdb == NULL)
return FALSE;
if (priv->monitor_rpmdb == NULL) {
rpmdb_path = g_build_filename(priv->install_root, "var/lib/rpm/Packages", NULL);
file_rpmdb = g_file_new_for_path(rpmdb_path);
priv->monitor_rpmdb = g_file_monitor_file(file_rpmdb,
G_FILE_MONITOR_NONE,
NULL,
error);
if (priv->monitor_rpmdb == NULL)
return FALSE;
}
g_signal_connect(priv->monitor_rpmdb, "changed",
G_CALLBACK(dnf_context_rpmdb_changed_cb), context);
}
Expand Down
3 changes: 2 additions & 1 deletion libdnf/dnf-sack.cpp
Expand Up @@ -200,7 +200,8 @@ dnf_sack_new(void)
static int
current_rpmdb_checksum(Pool *pool, unsigned char csout[CHKSUM_BYTES])
{
const char *rpmdb_prefix_paths[] = { "/var/lib/rpm/Packages",
const char *rpmdb_prefix_paths[] = { "/var/lib/rpm/data.mdb",
"/var/lib/rpm/Packages",
"/usr/share/rpm/Packages" };
unsigned int i;
const char *fn;
Expand Down

0 comments on commit 76518a0

Please sign in to comment.