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

Richard Hughes hughsient at kemper.freedesktop.org
Wed Feb 20 10:53:02 PST 2008


 backends/alpm/Makefile.am                          |    6 -
 backends/apt/Makefile.am                           |    8 +-
 backends/apt2/Makefile.am                          |    6 -
 backends/box/Makefile.am                           |    6 -
 backends/conary/Makefile.am                        |    6 -
 backends/dummy/Makefile.am                         |    6 -
 backends/opkg/Makefile.am                          |    6 -
 backends/pisi/Makefile.am                          |    6 -
 backends/smart/Makefile.am                         |    6 -
 backends/test/Makefile.am                          |   26 +++---
 backends/yum/Makefile.am                           |    6 -
 backends/yum2/Makefile.am                          |    6 -
 backends/zypp/Makefile.am                          |    8 +-
 backends/zypp/pk-backend-zypp.cpp                  |   79 ++++++++++++++++-----
 data/org.freedesktop.PackageKit.conf.in            |    2 
 data/org.freedesktop.PackageKitAptBackend.conf.in  |    4 -
 data/org.freedesktop.PackageKitTestBackend.conf.in |    4 -
 data/org.freedesktop.PackageKitYumBackend.conf.in  |    4 -
 docs/html/pk-faq.html                              |   58 ++++++++++++++-
 libgbus/Makefile.am                                |    2 
 libpackagekit/Makefile.am                          |    3 
 libpackagekit/pk-client.c                          |   58 +++++++++++++++
 libpackagekit/pk-self-test.c                       |    2 
 libselftest/Makefile.am                            |    2 
 src/Makefile.am                                    |    3 
 25 files changed, 230 insertions(+), 93 deletions(-)

New commits:
commit 78ea759e7426a5a11bbfe74db524e40ffd791c23
Author: Richard Hughes <richard at hughsie.com>
Date:   Wed Feb 20 18:52:45 2008 +0000

    add a test to check use after g_object_unref

diff --git a/libpackagekit/pk-client.c b/libpackagekit/pk-client.c
index 7e22dce..9f2558a 100644
--- a/libpackagekit/pk-client.c
+++ b/libpackagekit/pk-client.c
@@ -3189,6 +3189,16 @@ pk_client_new (void)
 #include <libselftest.h>
 #include <glib/gstdio.h>
 
+static gboolean finished = FALSE;
+
+static void
+libst_client_finished_cb (PkClient *client, PkExitEnum exit, guint runtime, gpointer data)
+{
+	finished = TRUE;
+	/* this is actually quite common */
+	g_object_unref (client);
+}
+
 void
 libst_client (LibSelfTest *test)
 {
@@ -3207,7 +3217,24 @@ libst_client (LibSelfTest *test)
 		libst_failed (test, NULL);
 	}
 
-	g_object_unref (client);
+	/* check use after finalise */
+	g_signal_connect (client, "finished",
+			  G_CALLBACK (libst_client_finished_cb), NULL);
+
+	/************************************************************/
+	libst_title (test, "do any method");
+	/* we don't care if this fails */
+	pk_client_set_synchronous (client, TRUE);
+	pk_client_search_name (client, "none", "moooo");
+	libst_success (test, "did something");
+
+	/************************************************************/
+	libst_title (test, "we finished?");
+	if (finished == TRUE) {
+		libst_success (test, NULL);
+	} else {
+		libst_failed (test, NULL);
+	}
 
 	libst_end (test);
 }
commit e8e98a24966ef9ff7cd04913e34bf72d8ad26d74
Author: Richard Hughes <richard at hughsie.com>
Date:   Wed Feb 20 18:39:15 2008 +0000

    add make check framework for PkClient

diff --git a/libpackagekit/pk-client.c b/libpackagekit/pk-client.c
index 0d0816a..7e22dce 100644
--- a/libpackagekit/pk-client.c
+++ b/libpackagekit/pk-client.c
@@ -3182,3 +3182,34 @@ pk_client_new (void)
 	return PK_CLIENT (client);
 }
 
+/***************************************************************************
+ ***                          MAKE CHECK TESTS                           ***
+ ***************************************************************************/
+#ifdef PK_BUILD_TESTS
+#include <libselftest.h>
+#include <glib/gstdio.h>
+
+void
+libst_client (LibSelfTest *test)
+{
+	PkClient *client;
+
+	if (libst_start (test, "PkClient", CLASS_AUTO) == FALSE) {
+		return;
+	}
+
+	/************************************************************/
+	libst_title (test, "get client");
+	client = pk_client_new ();
+	if (client != NULL) {
+		libst_success (test, NULL);
+	} else {
+		libst_failed (test, NULL);
+	}
+
+	g_object_unref (client);
+
+	libst_end (test);
+}
+#endif
+
diff --git a/libpackagekit/pk-self-test.c b/libpackagekit/pk-self-test.c
index e077bcb..8ce77f5 100644
--- a/libpackagekit/pk-self-test.c
+++ b/libpackagekit/pk-self-test.c
@@ -34,6 +34,7 @@ void libst_common (LibSelfTest *test);
 void libst_enum_list (LibSelfTest *test);
 void libst_extra (LibSelfTest *test);
 void libst_extra_obj (LibSelfTest *test);
+void libst_client (LibSelfTest *test);
 
 int
 main (int argc, char **argv)
@@ -52,6 +53,7 @@ main (int argc, char **argv)
 	libst_enum_list (&test);
 	libst_extra (&test);
 	libst_extra_obj (&test);
+	libst_client (&test);
 
 	return (libst_finish (&test));
 }
commit 71eac8cb232c5226e2e98192590bd2fc0b07991e
Author: Stepan Kasal <skasal at redhat.com>
Date:   Wed Feb 20 18:16:48 2008 +0000

    Use  syntax in makefiles, not @VAR@

diff --git a/backends/alpm/Makefile.am b/backends/alpm/Makefile.am
index 48588ca..445d23c 100644
--- a/backends/alpm/Makefile.am
+++ b/backends/alpm/Makefile.am
@@ -1,7 +1,7 @@
-plugindir = @PK_PLUGIN_DIR@
+plugindir = $(PK_PLUGIN_DIR)
 plugin_LTLIBRARIES = libpk_backend_alpm.la
 libpk_backend_alpm_la_SOURCES = pk-backend-alpm.c
-libpk_backend_alpm_la_LIBADD = @PK_PLUGIN_LIBS@ -lalpm
+libpk_backend_alpm_la_LIBADD = $(PK_PLUGIN_LIBS) -lalpm
 libpk_backend_alpm_la_LDFLAGS = -module -avoid-version
-libpk_backend_alpm_la_CFLAGS = @PK_PLUGIN_CFLAGS@
+libpk_backend_alpm_la_CFLAGS = $(PK_PLUGIN_CFLAGS)
 
diff --git a/backends/apt/Makefile.am b/backends/apt/Makefile.am
index e205138..07b4131 100644
--- a/backends/apt/Makefile.am
+++ b/backends/apt/Makefile.am
@@ -1,13 +1,13 @@
 NULL =
 
 SUBDIRS = helpers
-plugindir = @PK_PLUGIN_DIR@
+plugindir = $(PK_PLUGIN_DIR)
 plugin_LTLIBRARIES = libpk_backend_apt.la
 
-libpk_backend_apt_la_LIBADD = @PK_PLUGIN_LIBS@
+libpk_backend_apt_la_LIBADD = $(PK_PLUGIN_LIBS)
 libpk_backend_apt_la_LDFLAGS = -module -avoid-version $(APT_LIBS)
-libpk_backend_apt_la_CFLAGS = @PK_PLUGIN_CFLAGS@ $(APT_CFLAGS)
-libpk_backend_apt_la_CXXFLAGS = @PK_PLUGIN_CFLAGS@ $(APT_CFLAGS) -DPK_DB_DIR=\""$(PK_DB_DIR)"\"
+libpk_backend_apt_la_CFLAGS = $(PK_PLUGIN_CFLAGS) $(APT_CFLAGS)
+libpk_backend_apt_la_CXXFLAGS = $(PK_PLUGIN_CFLAGS) $(APT_CFLAGS) -DPK_DB_DIR=\""$(PK_DB_DIR)"\"
 
 libpk_backend_apt_la_SOURCES =				\
 	pk-backend-apt.c				\
diff --git a/backends/apt2/Makefile.am b/backends/apt2/Makefile.am
index 505e5c3..9463a58 100644
--- a/backends/apt2/Makefile.am
+++ b/backends/apt2/Makefile.am
@@ -1,9 +1,9 @@
-plugindir = @PK_PLUGIN_DIR@
+plugindir = $(PK_PLUGIN_DIR)
 plugin_LTLIBRARIES = libpk_backend_apt2.la
 libpk_backend_apt2_la_SOURCES = pk-backend-apt2.c
-libpk_backend_apt2_la_LIBADD = @PK_PLUGIN_LIBS@
+libpk_backend_apt2_la_LIBADD = $(PK_PLUGIN_LIBS)
 libpk_backend_apt2_la_LDFLAGS = -module -avoid-version
-libpk_backend_apt2_la_CFLAGS = @PK_PLUGIN_CFLAGS@
+libpk_backend_apt2_la_CFLAGS = $(PK_PLUGIN_CFLAGS)
 
 dbusinstancedir = $(LIBEXECDIR)
 dbusinstance_DATA =                                     \
diff --git a/backends/box/Makefile.am b/backends/box/Makefile.am
index 7e96eb7..3096dae 100644
--- a/backends/box/Makefile.am
+++ b/backends/box/Makefile.am
@@ -1,8 +1,8 @@
-plugindir = @PK_PLUGIN_DIR@
+plugindir = $(PK_PLUGIN_DIR)
 plugin_LTLIBRARIES = libpk_backend_box.la
 libpk_backend_box_la_SOURCES = pk-backend-box.c
-libpk_backend_box_la_LIBADD = @PK_PLUGIN_LIBS@ $(BOX_LIBS)
+libpk_backend_box_la_LIBADD = $(PK_PLUGIN_LIBS) $(BOX_LIBS)
 libpk_backend_box_la_LDFLAGS = -module -avoid-version
-libpk_backend_box_la_CFLAGS = @PK_PLUGIN_CFLAGS@
+libpk_backend_box_la_CFLAGS = $(PK_PLUGIN_CFLAGS)
 libpk_backend_box_la_INCLUDES = $(BOX_CFLAGS)
 
diff --git a/backends/conary/Makefile.am b/backends/conary/Makefile.am
index 49902b2..35d8b98 100644
--- a/backends/conary/Makefile.am
+++ b/backends/conary/Makefile.am
@@ -1,8 +1,8 @@
 SUBDIRS = helpers
-plugindir = @PK_PLUGIN_DIR@
+plugindir = $(PK_PLUGIN_DIR)
 plugin_LTLIBRARIES = libpk_backend_conary.la
 libpk_backend_conary_la_SOURCES = pk-backend-conary.c
-libpk_backend_conary_la_LIBADD = @PK_PLUGIN_LIBS@
+libpk_backend_conary_la_LIBADD = $(PK_PLUGIN_LIBS)
 libpk_backend_conary_la_LDFLAGS = -module -avoid-version
-libpk_backend_conary_la_CFLAGS = @PK_PLUGIN_CFLAGS@
+libpk_backend_conary_la_CFLAGS = $(PK_PLUGIN_CFLAGS)
 
diff --git a/backends/dummy/Makefile.am b/backends/dummy/Makefile.am
index daff2d6..dc713fa 100644
--- a/backends/dummy/Makefile.am
+++ b/backends/dummy/Makefile.am
@@ -1,7 +1,7 @@
-plugindir = @PK_PLUGIN_DIR@
+plugindir = $(PK_PLUGIN_DIR)
 plugin_LTLIBRARIES = libpk_backend_dummy.la
 libpk_backend_dummy_la_SOURCES = pk-backend-dummy.c
-libpk_backend_dummy_la_LIBADD = @PK_PLUGIN_LIBS@
+libpk_backend_dummy_la_LIBADD = $(PK_PLUGIN_LIBS)
 libpk_backend_dummy_la_LDFLAGS = -module -avoid-version
-libpk_backend_dummy_la_CFLAGS = @PK_PLUGIN_CFLAGS@
+libpk_backend_dummy_la_CFLAGS = $(PK_PLUGIN_CFLAGS)
 
diff --git a/backends/opkg/Makefile.am b/backends/opkg/Makefile.am
index a9615a8..ac05d44 100644
--- a/backends/opkg/Makefile.am
+++ b/backends/opkg/Makefile.am
@@ -1,8 +1,8 @@
-plugindir = @PK_PLUGIN_DIR@
+plugindir = $(PK_PLUGIN_DIR)
 plugin_LTLIBRARIES = libpk_backend_opkg.la
 libpk_backend_opkg_la_SOURCES = pk-backend-opkg.c
-libpk_backend_opkg_la_LIBADD = @PK_PLUGIN_LIBS@ $(OPKG_LIBS)
+libpk_backend_opkg_la_LIBADD = $(PK_PLUGIN_LIBS) $(OPKG_LIBS)
 
 libpk_backend_opkg_la_LDFLAGS = -module -avoid-version
-libpk_backend_opkg_la_CFLAGS = @PK_PLUGIN_CFLAGS@ $(OPKG_CFLAGS) 
+libpk_backend_opkg_la_CFLAGS = $(PK_PLUGIN_CFLAGS) $(OPKG_CFLAGS)
 
diff --git a/backends/pisi/Makefile.am b/backends/pisi/Makefile.am
index e0c28d0..e51f285 100644
--- a/backends/pisi/Makefile.am
+++ b/backends/pisi/Makefile.am
@@ -1,8 +1,8 @@
 SUBDIRS = helpers
-plugindir = @PK_PLUGIN_DIR@
+plugindir = $(PK_PLUGIN_DIR)
 plugin_LTLIBRARIES = libpk_backend_pisi.la
 libpk_backend_pisi_la_SOURCES = pk-backend-pisi.c
-libpk_backend_pisi_la_LIBADD = @PK_PLUGIN_LIBS@
+libpk_backend_pisi_la_LIBADD = $(PK_PLUGIN_LIBS)
 libpk_backend_pisi_la_LDFLAGS = -module -avoid-version
-libpk_backend_pisi_la_CFLAGS = @PK_PLUGIN_CFLAGS@
+libpk_backend_pisi_la_CFLAGS = $(PK_PLUGIN_CFLAGS)
 
diff --git a/backends/smart/Makefile.am b/backends/smart/Makefile.am
index 6fae321..c790201 100644
--- a/backends/smart/Makefile.am
+++ b/backends/smart/Makefile.am
@@ -1,7 +1,7 @@
 SUBDIRS = helpers
-plugindir = @PK_PLUGIN_DIR@
+plugindir = $(PK_PLUGIN_DIR)
 plugin_LTLIBRARIES = libpk_backend_smart.la
 libpk_backend_smart_la_SOURCES = pk-backend-smart.c
-libpk_backend_smart_la_LIBADD = @PK_PLUGIN_LIBS@
+libpk_backend_smart_la_LIBADD = $(PK_PLUGIN_LIBS)
 libpk_backend_smart_la_LDFLAGS = -module -avoid-version
-libpk_backend_smart_la_CFLAGS = @PK_PLUGIN_CFLAGS@
+libpk_backend_smart_la_CFLAGS = $(PK_PLUGIN_CFLAGS)
diff --git a/backends/test/Makefile.am b/backends/test/Makefile.am
index cc4a04d..6879d45 100644
--- a/backends/test/Makefile.am
+++ b/backends/test/Makefile.am
@@ -1,5 +1,5 @@
 SUBDIRS = helpers
-plugindir = @PK_PLUGIN_DIR@
+plugindir = $(PK_PLUGIN_DIR)
 plugin_LTLIBRARIES =			\
 	libpk_backend_test_dbus.la	\
 	libpk_backend_test_nop.la	\
@@ -9,32 +9,32 @@ plugin_LTLIBRARIES =			\
 	libpk_backend_test_thread.la
 
 libpk_backend_test_dbus_la_SOURCES = pk-backend-test-dbus.c
-libpk_backend_test_dbus_la_LIBADD = @PK_PLUGIN_LIBS@
+libpk_backend_test_dbus_la_LIBADD = $(PK_PLUGIN_LIBS)
 libpk_backend_test_dbus_la_LDFLAGS = -module -avoid-version
-libpk_backend_test_dbus_la_CFLAGS = @PK_PLUGIN_CFLAGS@
+libpk_backend_test_dbus_la_CFLAGS = $(PK_PLUGIN_CFLAGS)
 
 libpk_backend_test_nop_la_SOURCES = pk-backend-test-nop.c
-libpk_backend_test_nop_la_LIBADD = @PK_PLUGIN_LIBS@
+libpk_backend_test_nop_la_LIBADD = $(PK_PLUGIN_LIBS)
 libpk_backend_test_nop_la_LDFLAGS = -module -avoid-version
-libpk_backend_test_nop_la_CFLAGS = @PK_PLUGIN_CFLAGS@
+libpk_backend_test_nop_la_CFLAGS = $(PK_PLUGIN_CFLAGS)
 
 libpk_backend_test_fail_la_SOURCES = pk-backend-test-fail.c
-libpk_backend_test_fail_la_LIBADD = @PK_PLUGIN_LIBS@
+libpk_backend_test_fail_la_LIBADD = $(PK_PLUGIN_LIBS)
 libpk_backend_test_fail_la_LDFLAGS = -module -avoid-version
-libpk_backend_test_fail_la_CFLAGS = @PK_PLUGIN_CFLAGS@
+libpk_backend_test_fail_la_CFLAGS = $(PK_PLUGIN_CFLAGS)
 
 libpk_backend_test_spawn_la_SOURCES = pk-backend-test-spawn.c
-libpk_backend_test_spawn_la_LIBADD = @PK_PLUGIN_LIBS@
+libpk_backend_test_spawn_la_LIBADD = $(PK_PLUGIN_LIBS)
 libpk_backend_test_spawn_la_LDFLAGS = -module -avoid-version
-libpk_backend_test_spawn_la_CFLAGS = @PK_PLUGIN_CFLAGS@
+libpk_backend_test_spawn_la_CFLAGS = $(PK_PLUGIN_CFLAGS)
 
 libpk_backend_test_succeed_la_SOURCES = pk-backend-test-succeed.c
-libpk_backend_test_succeed_la_LIBADD = @PK_PLUGIN_LIBS@
+libpk_backend_test_succeed_la_LIBADD = $(PK_PLUGIN_LIBS)
 libpk_backend_test_succeed_la_LDFLAGS = -module -avoid-version
-libpk_backend_test_succeed_la_CFLAGS = @PK_PLUGIN_CFLAGS@
+libpk_backend_test_succeed_la_CFLAGS = $(PK_PLUGIN_CFLAGS)
 
 libpk_backend_test_thread_la_SOURCES = pk-backend-test-thread.c
-libpk_backend_test_thread_la_LIBADD = @PK_PLUGIN_LIBS@
+libpk_backend_test_thread_la_LIBADD = $(PK_PLUGIN_LIBS)
 libpk_backend_test_thread_la_LDFLAGS = -module -avoid-version
-libpk_backend_test_thread_la_CFLAGS = @PK_PLUGIN_CFLAGS@
+libpk_backend_test_thread_la_CFLAGS = $(PK_PLUGIN_CFLAGS)
 
diff --git a/backends/yum/Makefile.am b/backends/yum/Makefile.am
index 8f5dd24..7fa3d2f 100644
--- a/backends/yum/Makefile.am
+++ b/backends/yum/Makefile.am
@@ -1,10 +1,10 @@
 SUBDIRS = helpers
-plugindir = @PK_PLUGIN_DIR@
+plugindir = $(PK_PLUGIN_DIR)
 plugin_LTLIBRARIES = libpk_backend_yum.la
 libpk_backend_yum_la_SOURCES = pk-backend-yum.c
-libpk_backend_yum_la_LIBADD = @PK_PLUGIN_LIBS@
+libpk_backend_yum_la_LIBADD = $(PK_PLUGIN_LIBS)
 libpk_backend_yum_la_LDFLAGS = -module -avoid-version
-libpk_backend_yum_la_CFLAGS = @PK_PLUGIN_CFLAGS@
+libpk_backend_yum_la_CFLAGS = $(PK_PLUGIN_CFLAGS)
 
 clean-local:
 	rm -f *.gcno
diff --git a/backends/yum2/Makefile.am b/backends/yum2/Makefile.am
index a3fb218..e159794 100644
--- a/backends/yum2/Makefile.am
+++ b/backends/yum2/Makefile.am
@@ -1,10 +1,10 @@
 SUBDIRS = helpers
-plugindir = @PK_PLUGIN_DIR@
+plugindir = $(PK_PLUGIN_DIR)
 plugin_LTLIBRARIES = libpk_backend_yum2.la
 libpk_backend_yum2_la_SOURCES = pk-backend-yum2.c
-libpk_backend_yum2_la_LIBADD = @PK_PLUGIN_LIBS@
+libpk_backend_yum2_la_LIBADD = $(PK_PLUGIN_LIBS)
 libpk_backend_yum2_la_LDFLAGS = -module -avoid-version
-libpk_backend_yum2_la_CFLAGS = @PK_PLUGIN_CFLAGS@
+libpk_backend_yum2_la_CFLAGS = $(PK_PLUGIN_CFLAGS)
 
 clean-local:
 	rm -f *.gcno
diff --git a/backends/zypp/Makefile.am b/backends/zypp/Makefile.am
index 8504f4b..0de41d2 100644
--- a/backends/zypp/Makefile.am
+++ b/backends/zypp/Makefile.am
@@ -1,13 +1,13 @@
 #SUBDIRS = helpers
-plugindir = @PK_PLUGIN_DIR@
+plugindir = $(PK_PLUGIN_DIR)
 plugin_LTLIBRARIES = libpk_backend_zypp.la
 libpk_backend_zypp_la_SOURCES =		\
 	pk-backend-zypp.cpp		\
 	zypp-utils.cpp
-libpk_backend_zypp_la_LIBADD = @PK_PLUGIN_LIBS@
+libpk_backend_zypp_la_LIBADD = $(PK_PLUGIN_LIBS)
 libpk_backend_zypp_la_LDFLAGS = -module -avoid-version $(ZYPP_LIBS)
-libpk_backend_zypp_la_CFLAGS = @PK_PLUGIN_CFLAGS@
-libpk_backend_zypp_la_CPPFLAGS = @PK_PLUGIN_CFLAGS@ $(ZYPP_CFLAGS) -Wno-deprecated
+libpk_backend_zypp_la_CFLAGS = $(PK_PLUGIN_CFLAGS)
+libpk_backend_zypp_la_CPPFLAGS = $(PK_PLUGIN_CFLAGS) $(ZYPP_CFLAGS) -Wno-deprecated
 
 EXTRA_DIST =		\
 	zypp-utils.h	\
diff --git a/libgbus/Makefile.am b/libgbus/Makefile.am
index f0444b6..1162dda 100644
--- a/libgbus/Makefile.am
+++ b/libgbus/Makefile.am
@@ -13,7 +13,7 @@ libgbus_la_SOURCES =						\
 	libgbus-marshal.c					\
 	libgbus.c						\
 	libgbus.h
-libgbus_la_LIBADD = @DBUS_LIBS@ $(INTLLIBS) $(GLIB_LIBS)
+libgbus_la_LIBADD = $(DBUS_LIBS) $(INTLLIBS) $(GLIB_LIBS)
 
 EXTRA_DIST =							\
 	libgbus-marshal.list
diff --git a/libselftest/Makefile.am b/libselftest/Makefile.am
index a777fb1..82a75ef 100644
--- a/libselftest/Makefile.am
+++ b/libselftest/Makefile.am
@@ -11,7 +11,7 @@ noinst_LTLIBRARIES =						\
 libselftest_la_SOURCES =					\
 	libselftest.c						\
 	libselftest.h
-libselftest_la_LIBADD = @DBUS_LIBS@ $(INTLLIBS) $(GLIB_LIBS)
+libselftest_la_LIBADD = $(DBUS_LIBS) $(INTLLIBS) $(GLIB_LIBS)
 
 clean-local:
 	rm -f *~
commit c61a2f2c31bbeb014c4b539b1ea26c2f0eedf759
Author: Stepan Kasal <skasal at redhat.com>
Date:   Wed Feb 20 18:12:46 2008 +0000

    do not list check_PROGRAMS again in noinst_PROGRAMS

diff --git a/libpackagekit/Makefile.am b/libpackagekit/Makefile.am
index 86ccc5b..1afd725 100644
--- a/libpackagekit/Makefile.am
+++ b/libpackagekit/Makefile.am
@@ -112,9 +112,6 @@ if PK_BUILD_TESTS
 check_PROGRAMS =						\
 	pk-self-test
 
-noinst_PROGRAMS =						\
-	pk-self-test
-
 pk_self_test_SOURCES =						\
 	pk-self-test.c						\
 	$(NULL)
diff --git a/src/Makefile.am b/src/Makefile.am
index b370d48..a606224 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -132,9 +132,6 @@ if PK_BUILD_TESTS
 check_PROGRAMS =					\
 	pk-self-test
 
-noinst_PROGRAMS =					\
-	pk-self-test
-
 pk_self_test_SOURCES =					\
 	pk-self-test.c					\
 	$(shared_SOURCES)				\
commit d7e9e774e6083215f310ec38ca0791bdd91c9601
Author: Richard Hughes <richard at hughsie.com>
Date:   Wed Feb 20 17:56:11 2008 +0000

    add some FAQ text on user interaction

diff --git a/docs/html/pk-faq.html b/docs/html/pk-faq.html
index e91270d..05c0148 100644
--- a/docs/html/pk-faq.html
+++ b/docs/html/pk-faq.html
@@ -114,10 +114,60 @@ and we can add it to the supported list.
 Upgrading, installing or removing packages <b>has to be 100% silent</b>.
 </p>
 <p>
-The user cannot be prompted for questions "set applet setuid?" as these will
-not be handled in PackageKit.
-The backend should do the right thing, as these messages mean very little to
-the average user and cannot be translated.
+The user cannot be prompted mid-transaction for questions as these will not be
+handled in PackageKit.
+The backend should do the right thing, as these questions mean very
+little to the average user.
+</p>
+<p>
+The reasons for this are as follows:
+</p>
+<ul>
+ <li>
+  The messages cannot be translated as the daemon is running in the C locale,
+  and there may be multiple running session clients in different locales.
+ </li>
+ <li>
+  Stopping the transaction and waiting for input would also mean the methods
+  are no longer "fire and forget".
+ </li>
+ <li>
+  Security updates can now be performed automatically, i.e.
+  when the user is idle.
+  There's no user at the console in this case to answer questions.
+ </li>
+ <li>
+  Due to the client/server split of PackageKit, a non-root user would be able
+  to change the answer of debconf scripts, and another PolicyKit role would have
+  to be defined.
+  In this case a situation could arise where a user is able to update software,
+  but not agree to EULAs, thus making the transaction invalid and impossible.
+ </li>
+</ul>
+</p>
+<p>
+EULAs or other agreements will have to be agreed to <b>before</b> the
+transaction is processed.
+EULAs are legally questionable (because the files are already installed) and
+only the user that installing the software is ever shown them.
+If EULAs are required, they should be shown per-user - i.e. the first time an
+application is run.
+</p>
+<p>
+PackageKit will not install packages with broken maintainer scripts that
+require a stdin.
+If this is attempted the backend should detect this and error out of the
+transaction with <code>PK_ERROR_ENUM_BROKEN_PACKAGE</code>.
+<b>We cannot and will not ask the user for random standard input.</b>
+</p>
+<p>
+See the <a href="http://wiki.debian.org/PackageKit">Debian PackageKit wiki</a>
+for more details and further discussion.
+</p>
+<p>
+If the transaction needs to tell the user something, the <code>Message()</code>
+method can be used that will localise the message up the stack, and also give the user a way
+of ignoring duplicate messages of this type.
 </p>
 
 <h3>Does PackageKit replace up2date?</h3>
commit ffc934325954b5e38c04501db9a5f9a0ea35688a
Author: Richard Hughes <richard at hughsie.com>
Date:   Wed Feb 20 17:41:32 2008 +0000

    remove the at_console stuff from the dbus backend descriptions

diff --git a/data/org.freedesktop.PackageKitAptBackend.conf.in b/data/org.freedesktop.PackageKitAptBackend.conf.in
index f050954..7e34eee 100644
--- a/data/org.freedesktop.PackageKitAptBackend.conf.in
+++ b/data/org.freedesktop.PackageKitAptBackend.conf.in
@@ -12,10 +12,6 @@
     <allow send_destination="org.freedesktop.PackageKitAptBackend"/>
     <allow send_interface="org.freedesktop.PackageKitBackend"/>
   </policy>
-  <policy at_console="true">
-    <deny send_destination="org.freedesktop.PackageKitAptBackend"/>
-    <deny send_interface="org.freedesktop.PackageKitBackend"/>
-  </policy>
   <policy context="default">
     <deny own="org.freedesktop.PackageKitAptBackend"/>
     <deny send_destination="org.freedesktop.PackageKitAptBackend"/>
diff --git a/data/org.freedesktop.PackageKitTestBackend.conf.in b/data/org.freedesktop.PackageKitTestBackend.conf.in
index 4f51831..788134b 100644
--- a/data/org.freedesktop.PackageKitTestBackend.conf.in
+++ b/data/org.freedesktop.PackageKitTestBackend.conf.in
@@ -12,10 +12,6 @@
     <allow send_destination="org.freedesktop.PackageKitTestBackend"/>
     <allow send_interface="org.freedesktop.PackageKitBackend"/>
   </policy>
-  <policy at_console="true">
-    <deny send_destination="org.freedesktop.PackageKitTestBackend"/>
-    <deny send_interface="org.freedesktop.PackageKitBackend"/>
-  </policy>
   <policy context="default">
     <deny own="org.freedesktop.PackageKitTestBackend"/>
     <deny send_destination="org.freedesktop.PackageKitTestBackend"/>
diff --git a/data/org.freedesktop.PackageKitYumBackend.conf.in b/data/org.freedesktop.PackageKitYumBackend.conf.in
index e105f5f..b511943 100644
--- a/data/org.freedesktop.PackageKitYumBackend.conf.in
+++ b/data/org.freedesktop.PackageKitYumBackend.conf.in
@@ -12,10 +12,6 @@
     <allow send_destination="org.freedesktop.PackageKitYumBackend"/>
     <allow send_interface="org.freedesktop.PackageKitBackend"/>
   </policy>
-  <policy at_console="true">
-    <deny send_destination="org.freedesktop.PackageKitYumBackend"/>
-    <deny send_interface="org.freedesktop.PackageKitBackend"/>
-  </policy>
   <policy context="default">
     <deny own="org.freedesktop.PackageKitYumBackend"/>
     <deny send_destination="org.freedesktop.PackageKitYumBackend"/>
commit bb67ebd2b56af0e5801827652e68ca7405b9a8f7
Author: Robin Norwood <rnorwood at redhat.com>
Date:   Wed Feb 20 10:21:44 2008 -0500

    Ok, just removing the at_console="true" parameter is clearly wrong.  Very wrong, in that it causes dbus not to start.

diff --git a/data/org.freedesktop.PackageKit.conf.in b/data/org.freedesktop.PackageKit.conf.in
index 4e3e45b..708f2eb 100644
--- a/data/org.freedesktop.PackageKit.conf.in
+++ b/data/org.freedesktop.PackageKit.conf.in
@@ -20,7 +20,7 @@
   </policy>
 
   <!-- This will not work if pam_console support is not enabled -->
-  <policy>
+  <policy at_console="true">
     <allow send_interface="org.freedesktop.PackageKit"/>
   </policy>
 
diff --git a/data/org.freedesktop.PackageKitAptBackend.conf.in b/data/org.freedesktop.PackageKitAptBackend.conf.in
index 06770db..f050954 100644
--- a/data/org.freedesktop.PackageKitAptBackend.conf.in
+++ b/data/org.freedesktop.PackageKitAptBackend.conf.in
@@ -12,7 +12,7 @@
     <allow send_destination="org.freedesktop.PackageKitAptBackend"/>
     <allow send_interface="org.freedesktop.PackageKitBackend"/>
   </policy>
-  <policy>
+  <policy at_console="true">
     <deny send_destination="org.freedesktop.PackageKitAptBackend"/>
     <deny send_interface="org.freedesktop.PackageKitBackend"/>
   </policy>
diff --git a/data/org.freedesktop.PackageKitTestBackend.conf.in b/data/org.freedesktop.PackageKitTestBackend.conf.in
index 3035521..4f51831 100644
--- a/data/org.freedesktop.PackageKitTestBackend.conf.in
+++ b/data/org.freedesktop.PackageKitTestBackend.conf.in
@@ -12,7 +12,7 @@
     <allow send_destination="org.freedesktop.PackageKitTestBackend"/>
     <allow send_interface="org.freedesktop.PackageKitBackend"/>
   </policy>
-  <policy>
+  <policy at_console="true">
     <deny send_destination="org.freedesktop.PackageKitTestBackend"/>
     <deny send_interface="org.freedesktop.PackageKitBackend"/>
   </policy>
diff --git a/data/org.freedesktop.PackageKitYumBackend.conf.in b/data/org.freedesktop.PackageKitYumBackend.conf.in
index 6f34237..e105f5f 100644
--- a/data/org.freedesktop.PackageKitYumBackend.conf.in
+++ b/data/org.freedesktop.PackageKitYumBackend.conf.in
@@ -12,7 +12,7 @@
     <allow send_destination="org.freedesktop.PackageKitYumBackend"/>
     <allow send_interface="org.freedesktop.PackageKitBackend"/>
   </policy>
-  <policy>
+  <policy at_console="true">
     <deny send_destination="org.freedesktop.PackageKitYumBackend"/>
     <deny send_interface="org.freedesktop.PackageKitBackend"/>
   </policy>
commit a6d512cec31cc956059ac6c872bec86a465fd290
Author: Stefan Haas <shaas at suse.de>
Date:   Wed Feb 20 12:39:20 2008 +0100

    get_description: added missing stuff

diff --git a/backends/zypp/pk-backend-zypp.cpp b/backends/zypp/pk-backend-zypp.cpp
index c6f8c81..48e54d8 100644
--- a/backends/zypp/pk-backend-zypp.cpp
+++ b/backends/zypp/pk-backend-zypp.cpp
@@ -378,7 +378,7 @@ backend_get_description_thread (PkBackendThread *thread, gpointer data)
 			it != v->end (); it++) {
 		zypp::ResObject::constPtr pkg = (*it);
 		const char *version = pkg->edition ().asString ().c_str ();
-fprintf (stderr, "\n\n *** comparing versions '%s' == '%s'", pi->version, version);
+                fprintf (stderr, "\n\n *** comparing versions '%s' == '%s'", pi->version, version);
 		if (strcmp (pi->version, version) == 0) {
 			package = pkg;
 			break;
@@ -395,14 +395,55 @@ fprintf (stderr, "\n\n *** comparing versions '%s' == '%s'", pi->version, versio
 		pk_backend_finished (backend);
 		return FALSE;
 	}
+        
+        try {
+                // currently it is necessary to access the rpmDB directly to get infos like size for already installed packages
+                if (package->isSystem ()){
+                       zypp::Target_Ptr target;
+
+                        zypp::ZYpp::Ptr zypp;
+                        zypp = get_zypp ();
 
-	pk_backend_description (backend,
-				d->package_id,		// package_id
-				"unknown",		// const gchar *license
-				PK_GROUP_ENUM_OTHER,	// PkGroupEnum group
-				package->description ().c_str (),	// const gchar *description
-				"TODO: add package URL here",			// const gchar *url
-				(gulong)package->size());			// gulong size
+                        target = zypp->target ();
+  
+                        zypp::target::rpm::RpmDb &rpm = target->rpmDb (); 
+                        rpm.initDatabase();
+                        zypp::target::rpm::RpmHeader::constPtr rpmHeader;
+                        rpm.getData (package-> name (), package->edition (), rpmHeader);
+
+	                pk_backend_description (backend,
+			                	d->package_id,                  		// package_id
+				                rpmHeader->tag_license ().c_str (),		// const gchar *license
+				                PK_GROUP_ENUM_OTHER,                    	// PkGroupEnum group
+				                rpmHeader->tag_description ().c_str (),   	// const gchar *description
+				                rpmHeader->tag_url (). c_str (),	  	// const gchar *url
+				                (gulong)rpmHeader->tag_size ());		// gulong size
+
+                        rpm.closeDatabase();
+                }else{
+                        zypp::Package::constPtr pkg = zypp::asKind<zypp::Package>(package);
+                        pk_backend_description (backend,
+                                                d->package_id,
+                                                pkg->license ().c_str (),
+                                                PK_GROUP_ENUM_OTHER,
+                                                pkg->description ().c_str (),
+                                                pkg->url ().c_str (),
+                                                (gulong)pkg->size ());
+                }
+
+        } catch (const zypp::target::rpm::RpmException &ex) {
+	        pk_backend_error_code (backend, PK_ERROR_ENUM_REPO_NOT_FOUND, "Couldn't open rpm-database");
+                pk_backend_finished (backend);
+		g_free (d->package_id);
+                g_free (d);
+                return FALSE;
+        } catch (const zypp::Exception &ex) {
+                pk_backend_error_code (backend, PK_ERROR_ENUM_INTERNAL_ERROR, ex.asUserString ().c_str ());
+                pk_backend_finished (backend);
+                g_free (d->package_id);
+                g_free (d);
+                return FALSE;
+        }
 
 	pk_package_id_free (pi);
 	g_free (d->package_id);
commit b70f18bb8f92f0056ee427848203657cd453a844
Author: Stefan Haas <shaas at suse.de>
Date:   Wed Feb 20 11:13:00 2008 +0100

    get_depends: now it shows every package only one time

diff --git a/backends/zypp/pk-backend-zypp.cpp b/backends/zypp/pk-backend-zypp.cpp
index a6e486d..c6f8c81 100644
--- a/backends/zypp/pk-backend-zypp.cpp
+++ b/backends/zypp/pk-backend-zypp.cpp
@@ -251,6 +251,7 @@ backend_get_depends_thread (PkBackendThread *thread, gpointer data)
                 zypp::Capabilities req = solvable[zypp::Dep::REQUIRES];
                 
                 std::map<std::string, zypp::sat::Solvable> caps;
+                std::vector<std::string> temp;
 
 		for (zypp::Capabilities::const_iterator it = req.begin ();
 				it != req.end ();
@@ -262,15 +263,18 @@ backend_get_depends_thread (PkBackendThread *thread, gpointer data)
 
                                 // Adding Packages only one time
                                 std::map<std::string, zypp::sat::Solvable>::iterator mIt;
-                                mIt = caps.find(it2->name ());
-                                if( mIt != caps.end()){
-                                        if(it2->isSystem ()){
-                                                caps.erase (mIt);
-                                                caps[it2->name ()] = *it2;
-                                        }                       
-                                }else{
-                                        caps[it2->name ()] = *it2;
-                                }  
+                                mIt = caps.find(it->asString ());
+                                if ( std::find (temp.begin (), temp.end(), it2->name ()) == temp.end()){
+                                        if( mIt != caps.end()){
+                                                if(it2->isSystem ()){
+                                                        caps.erase (mIt);
+                                                        caps[it->asString ()] = *it2;
+                                                }                       
+                                        }else{
+                                                caps[it->asString ()] = *it2;
+                                        }
+                                        temp.push_back(it2->name ());
+                                }
                               
                         }
                 }



More information about the PackageKit mailing list