[packagekit] packagekit: Branch 'master' - 4 commits

Richard Hughes hughsient at kemper.freedesktop.org
Fri Nov 23 10:12:16 PST 2007


 Makefile.am                                    |   10 ------
 TODO                                           |    4 ++
 configure.ac                                   |    3 +
 contrib/Makefile.am                            |    7 ++++
 contrib/yum-packagekit/Makefile.am             |    6 +++
 contrib/yum-packagekit/README                  |    6 +++
 contrib/yum-packagekit/refresh-packagekit.conf |    3 +
 contrib/yum-packagekit/refresh-packagekit.py   |   40 +++++++++++++++++++++++++
 python/packagekit/Makefile.am                  |   11 ++++++
 9 files changed, 81 insertions(+), 9 deletions(-)

New commits:
commit 950ddfd4567589537697c0372c2dcc6e2e1b204f
Author: Richard Hughes <richard at hughsie.com>
Date:   Fri Nov 23 17:47:24 2007 +0000

    add a yum-packagekit plugin to refresh the PackageKit data when a manual command is run - nothing works yet. Original is from yum-updatesd by James Bowes <jbowes at redhat.com>

diff --git a/configure.ac b/configure.ac
index e23cd95..747bfd2 100755
--- a/configure.ac
+++ b/configure.ac
@@ -118,6 +118,7 @@ dnl ---------------------------------------------------------------------------
 dnl - Make paths available for source files
 dnl ---------------------------------------------------------------------------
 AC_SUBST(SYSCONFDIR, $sysconfdir)
+AC_SUBST(LIBDIR, $libdir)
 AC_SUBST(DATADIR, $datadir)
 AC_SUBST(BINDIR, $bindir)
 AC_SUBST(SBINDIR, $sbindir)
@@ -458,6 +459,7 @@ etc/Makefile
 man/Makefile
 docs/Makefile
 contrib/Makefile
+contrib/yum-packagekit/Makefile
 html/Makefile
 html/img/Makefile
 backends/Makefile
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
index e64fd0e..8080e92 100644
--- a/contrib/Makefile.am
+++ b/contrib/Makefile.am
@@ -1,4 +1,6 @@
-#SUBDIRS = yum-packagekit
+if BACKEND_TYPE_YUM
+SUBDIRS = yum-packagekit
+endif
 
 bashcompletiondir = ${SYSCONFDIR}/bash_completion.d
 dist_bashcompletion_DATA = pk-completion.bash
diff --git a/contrib/yum-packagekit/Makefile.am b/contrib/yum-packagekit/Makefile.am
new file mode 100644
index 0000000..0119de0
--- /dev/null
+++ b/contrib/yum-packagekit/Makefile.am
@@ -0,0 +1,6 @@
+yumconfdir = ${SYSCONFDIR}/yum/pluginconf.d
+dist_yumconf_DATA = refresh-packagekit.conf
+
+yumplugindir = ${LIBDIR}/yum-plugins
+dist_yumplugin_DATA = refresh-packagekit.py
+
diff --git a/contrib/yum-packagekit/README b/contrib/yum-packagekit/README
new file mode 100644
index 0000000..5f78e73
--- /dev/null
+++ b/contrib/yum-packagekit/README
@@ -0,0 +1,6 @@
+This is refresh-packagekit, a plugin for Yum.
+
+refresh-packagekit tells PackageKit to check for updates when yum exits. This
+way, if you run 'yum update' and install all available updates, the PackageKit
+session UI will almost instantly update itself to reflect this.
+
diff --git a/contrib/yum-packagekit/refresh-packagekit.conf b/contrib/yum-packagekit/refresh-packagekit.conf
new file mode 100644
index 0000000..37d52e2
--- /dev/null
+++ b/contrib/yum-packagekit/refresh-packagekit.conf
@@ -0,0 +1,3 @@
+[main]
+enabled=1
+
diff --git a/contrib/yum-packagekit/refresh-packagekit.py b/contrib/yum-packagekit/refresh-packagekit.py
new file mode 100644
index 0000000..3f63c01
--- /dev/null
+++ b/contrib/yum-packagekit/refresh-packagekit.py
@@ -0,0 +1,40 @@
+# A plugin for yum which notifies PackageKit to refresh its data
+#
+# Written by James Bowes <jbowes at redhat.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# version 0.0.5
+
+import dbus
+from yum.plugins import TYPE_CORE
+
+requires_api_version = '2.5'
+plugin_type = TYPE_CORE
+
+def posttrans_hook(conduit):
+    """
+    Tell PackageKit to refresh its state. Run only after an rpm transaction.
+    """
+    try:
+        bus = dbus.SystemBus()
+    except dbus.DBusException, e:
+        conduit.info(2, "Unable to connect to dbus")
+        conduit.info(6, "%s" %(e,))
+        return
+    try:
+        packagekit_proxy = bus.get_object('org.freedesktop.PackageKit.yum', '/PackageKit')
+        packagekit_iface = dbus.Interface(packagekit_proxy, 'org.freedesktop.PackageKit')
+        packagekit_iface.UpdatesHaveChanged()
+    except dbus.DBusException, e:
+        conduit.info(2, "Unable to send message to PackageKit")
+        conduit.info(6, "%s" %(e,))
+
commit 43009bf34925876cd3d04441b6c60f213e584301
Author: Richard Hughes <richard at hughsie.com>
Date:   Fri Nov 23 17:31:32 2007 +0000

    install the bash completion file

diff --git a/Makefile.am b/Makefile.am
index 29d1698..ec64f07 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -8,6 +8,7 @@ SUBDIRS = 						\
 	policy						\
 	etc						\
 	man						\
+	contrib						\
 	data						\
 	libselftest					\
 	libgbus						\
diff --git a/configure.ac b/configure.ac
index e194601..e23cd95 100755
--- a/configure.ac
+++ b/configure.ac
@@ -457,6 +457,7 @@ Makefile
 etc/Makefile
 man/Makefile
 docs/Makefile
+contrib/Makefile
 html/Makefile
 html/img/Makefile
 backends/Makefile
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
new file mode 100644
index 0000000..e64fd0e
--- /dev/null
+++ b/contrib/Makefile.am
@@ -0,0 +1,5 @@
+#SUBDIRS = yum-packagekit
+
+bashcompletiondir = ${SYSCONFDIR}/bash_completion.d
+dist_bashcompletion_DATA = pk-completion.bash
+
commit 06f22295c1812d42e35f8e91640f67db10f04686
Author: Richard Hughes <richard at hughsie.com>
Date:   Fri Nov 23 16:01:23 2007 +0000

    move the python stuff to the correct Makefile.am

diff --git a/Makefile.am b/Makefile.am
index 66129e6..29d1698 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -24,15 +24,6 @@ pkgconfig_DATA = packagekit.pc
 dbusdir = ${SYSCONFDIR}/dbus-1/system.d
 dist_dbus_DATA = org.freedesktop.PackageKit.conf
 
-packagekitpythondir = ${PYTHON_PACKAGE_DIR}
-packagekitpython_PYTHON =				\
-	python/packagekit/__init__.py			\
-	python/packagekit/backend.py			\
-	python/packagekit/frontend.py			\
-	python/packagekit/enums.py				\
-	$(NULL)
-	
-
 EXTRA_DIST =						\
 	org.freedesktop.PackageKit.conf.in		\
 	packagekit.pc.in				\
diff --git a/python/packagekit/Makefile.am b/python/packagekit/Makefile.am
index f31f486..6448281 100644
--- a/python/packagekit/Makefile.am
+++ b/python/packagekit/Makefile.am
@@ -1,4 +1,15 @@
 BUILT_SOURCES = enums.py
 
+NULL =
+
 enums.py: ../enum-convertor.py ../../libpackagekit/pk-enum.c
 	(cd ..; python enum-convertor.py > packagekit/enums.py)
+
+packagekitpythondir = ${PYTHON_PACKAGE_DIR}
+packagekitpython_PYTHON =				\
+	__init__.py					\
+	backend.py					\
+	frontend.py					\
+	enums.py					\
+	$(NULL)
+
commit 28c021ccc1253bf993b2d5b2e89669a6bbcd0a11
Author: Richard Hughes <richard at hughsie.com>
Date:   Fri Nov 23 08:04:03 2007 +0000

    update TODO

diff --git a/TODO b/TODO
index 3f3628d..72e4358 100644
--- a/TODO
+++ b/TODO
@@ -3,6 +3,10 @@ Order of no particular importance:
 *** write to the database for config stuff
  - Probably should move the job number too
 
+*** Write a yum plugin that makes PackageKit reload
+ - if there has been updates
+ - if there has been a system update
+
 *** package->status ***
 Convert the backends to send more status calls.
 



More information about the PackageKit mailing list