kalev pushed to libhif (f22). "context: Fix rpmdb file monitor with / installs (..more)"

notifications at fedoraproject.org notifications at fedoraproject.org
Wed May 13 12:06:59 UTC 2015


From b169b96ec9a625ce0be17f119dc28eac30daf1db Mon Sep 17 00:00:00 2001
From: Kalev Lember <kalevlember at gmail.com>
Date: Wed, 13 May 2015 14:06:15 +0200
Subject: context: Fix rpmdb file monitor with / installs

https://bugzilla.redhat.com/show_bug.cgi?id=1221158

diff --git a/0001-context-Fix-rpmdb-file-monitor-with-installs.patch b/0001-context-Fix-rpmdb-file-monitor-with-installs.patch
new file mode 100644
index 0000000..a6fdc14
--- /dev/null
+++ b/0001-context-Fix-rpmdb-file-monitor-with-installs.patch
@@ -0,0 +1,32 @@
+From efc37d3a9e52ebb83e4d686c81610277a4fb5ef7 Mon Sep 17 00:00:00 2001
+From: Kalev Lember <kalevlember at gmail.com>
+Date: Wed, 13 May 2015 13:42:55 +0200
+Subject: [PATCH] context: Fix rpmdb file monitor with / installs
+
+Commit c50214d43a20941b2a950dd04d822fdc33a137d0 added a guard that was
+supposed to avoid firing the rpmdb monitor signals when using a
+non-default install root, but got the guard condition backwards which
+prevented it working with regular / installs.
+
+Fixing this makes PackageKit properly invalidate its internal caches
+when an external program, such as dnf, touches the rpmdb.
+---
+ libhif/hif-context.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libhif/hif-context.c b/libhif/hif-context.c
+index 59fe113..57bda46 100644
+--- a/libhif/hif-context.c
++++ b/libhif/hif-context.c
+@@ -1354,7 +1354,7 @@ hif_context_setup (HifContext *context,
+ 		return FALSE;
+ 
+ 	/* setup a file monitor on the rpmdb, if we're operating on the native / */
+-	if (g_strcmp0 (priv->install_root, "/") != 0) {
++	if (g_strcmp0 (priv->install_root, "/") == 0) {
+ 		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,
+-- 
+2.4.0
+
diff --git a/libhif.spec b/libhif.spec
index f2de8d5..aef80cb 100644
--- a/libhif.spec
+++ b/libhif.spec
@@ -1,12 +1,14 @@
 Summary:   Simple package library built on top of hawkey and librepo
 Name:      libhif
 Version:   0.2.0
-Release:   2%{?dist}
+Release:   3%{?dist}
 License:   LGPLv2+
 URL:       https://github.com/hughsie/libhif
 Source0:   http://people.freedesktop.org/~hughsient/releases/libhif-%{version}.tar.xz
 # https://bugzilla.redhat.com/show_bug.cgi?id=1211991
 Patch0:    0001-transaction-Remove-obsoleted-packages-when-committin.patch
+# https://bugzilla.redhat.com/show_bug.cgi?id=1221158
+Patch1:    0001-context-Fix-rpmdb-file-monitor-with-installs.patch
 
 BuildRequires: glib2-devel >= 2.16.1
 BuildRequires: libtool
@@ -35,6 +37,7 @@ GLib headers and libraries for libhif.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 %build
 # Support builds of both git snapshots and tarballs
@@ -70,6 +73,9 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/libhif*.la
 %{_datadir}/gir-1.0/*.gir
 
 %changelog
+* Wed May 13 2015 Kalev Lember <kalevlember at gmail.com> 0.2.0-3
+- context: Fix rpmdb file monitor with / installs (#1221158)
+
 * Wed Apr 15 2015 Kalev Lember <kalevlember at gmail.com> 0.2.0-2
 - Remove obsoleted packages when committing transaction (#1211991)
 
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/libhif.git/commit/?h=f22&id=b169b96ec9a625ce0be17f119dc28eac30daf1db


More information about the scm-commits mailing list