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

Richard Hughes hughsient at kemper.freedesktop.org
Wed Nov 14 14:47:43 PST 2007


 TODO                        |    9 +++
 client/wscript_build        |    5 ++
 docs/wscript_build          |   18 ++++---
 html/pk-download.html       |    4 +
 html/pk-intro.html          |    7 ++
 libpackagekit/pk-client.c   |   62 ++++++++++++++++++++++++++
 libpackagekit/pk-client.h   |    3 -
 libpackagekit/pk-debug.c    |    9 +++
 libpackagekit/wscript_build |   62 +++++++++++++-------------
 src/pk-backend.c            |   45 ++++++++++++++++++-
 src/pk-engine.c             |   16 ++++++
 src/pk-engine.h             |    4 +
 src/pk-interface.xml        |    8 +++
 src/pk-security-dummy.c     |   12 +++++
 src/wscript_build           |  103 ++++++++++++++++++++++---------------------
 wscript                     |  104 +++++++++++++++++++++++++++++++++-----------
 16 files changed, 355 insertions(+), 116 deletions(-)

New commits:
commit 163ef1d6f84eb96079dbbf89d86685b34b615dee
Author: Richard Hughes <richard at hughsie.com>
Date:   Wed Nov 14 22:31:57 2007 +0000

    Emitting package download foo should set the status to downloading

diff --git a/TODO b/TODO
index 93e6a98..8f8da26 100644
--- a/TODO
+++ b/TODO
@@ -7,7 +7,6 @@ New method GetHoursSinceLastUpdate
 Use this in the update icon
 
 *** package->status ***
-Emitting package download foo should set the status to downloading
 Convert the backends to send more status calls.
 Add a depsolve status enum.
 
diff --git a/src/pk-backend.c b/src/pk-backend.c
index f261a3b..efb7545 100644
--- a/src/pk-backend.c
+++ b/src/pk-backend.c
@@ -755,7 +755,14 @@ pk_backend_change_status (PkBackend *backend, PkStatusEnum status)
 {
 	g_return_val_if_fail (backend != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_BACKEND (backend), FALSE);
+
+	/* already this? */
+	if (backend->priv->status == status) {
+		pk_debug ("already set same status");
+		return TRUE;
+	}
 	backend->priv->status = status;
+
 	pk_debug ("emiting transaction-status-changed %i", status);
 	g_signal_emit (backend, signals [PK_BACKEND_TRANSACTION_STATUS_CHANGED], 0, status);
 	return TRUE;
@@ -772,6 +779,21 @@ pk_backend_package (PkBackend *backend, PkInfoEnum info, const gchar *package, c
 	g_return_val_if_fail (backend != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_BACKEND (backend), FALSE);
 
+	/* we automatically set the transaction status for some infos */
+	if (info == PK_INFO_ENUM_DOWNLOADING) {
+		pk_backend_change_status (backend, PK_STATUS_ENUM_DOWNLOAD);
+	} else if (info == PK_INFO_ENUM_UPDATING) {
+		pk_backend_change_status (backend, PK_STATUS_ENUM_UPDATE);
+	} else if (info == PK_INFO_ENUM_INSTALLING) {
+		pk_backend_change_status (backend, PK_STATUS_ENUM_INSTALL);
+	} else if (info == PK_INFO_ENUM_REMOVING) {
+		pk_backend_change_status (backend, PK_STATUS_ENUM_REMOVE);
+	} else if (info == PK_INFO_ENUM_CLEANUP) {
+		pk_backend_change_status (backend, PK_STATUS_ENUM_CLEANUP);
+	} else if (info == PK_INFO_ENUM_OBSOLETING) {
+		pk_backend_change_status (backend, PK_STATUS_ENUM_OBSOLETE);
+	}
+
 	/* save in case we need this from coldplug */
 	g_free (backend->priv->last_package);
 	backend->priv->last_package = g_strdup (package);
commit fa8920eb0bd01e530b55cf8ffffde886639c5f17
Author: Richard Hughes <richard at hughsie.com>
Date:   Wed Nov 14 22:20:32 2007 +0000

    add IsCallerActive method and CallerActiveChanged signal so we know if the calling application is present on the bus or not

diff --git a/libpackagekit/pk-client.c b/libpackagekit/pk-client.c
index 45819ba..bb4cb3b 100644
--- a/libpackagekit/pk-client.c
+++ b/libpackagekit/pk-client.c
@@ -84,6 +84,7 @@ typedef enum {
 	PK_CLIENT_TRANSACTION_STATUS_CHANGED,
 	PK_CLIENT_UPDATE_DETAIL,
 	PK_CLIENT_REPO_SIGNATURE_REQUIRED,
+	PK_CLIENT_CALLER_ACTIVE_CHANGED,
 	PK_CLIENT_REPO_DETAIL,
 	PK_CLIENT_LOCKED,
 	PK_CLIENT_LAST_SIGNAL
@@ -661,6 +662,27 @@ pk_client_locked_cb (DBusGProxy *proxy, gboolean is_locked, PkClient *client)
 }
 
 /**
+ * pk_client_caller_active_changed_cb:
+ */
+static void
+pk_client_caller_active_changed_cb (DBusGProxy  *proxy,
+				    const gchar *tid,
+				    gboolean     is_active,
+				    PkClient    *client)
+{
+	g_return_if_fail (client != NULL);
+	g_return_if_fail (PK_IS_CLIENT (client));
+
+	/* not us, ignore */
+	if (pk_client_should_proxy (client, tid) == FALSE) {
+		return;
+	}
+
+	pk_debug ("emit caller-active-changed %i", is_active);
+	g_signal_emit (client , signals [PK_CLIENT_CALLER_ACTIVE_CHANGED], 0, is_active);
+}
+
+/**
  * pk_client_require_restart_cb:
  */
 static void
@@ -2155,6 +2177,30 @@ pk_client_get_backend_detail (PkClient *client, gchar **name, gchar **author)
 }
 
 /**
+ * pk_client_is_caller_active:
+ **/
+gboolean
+pk_client_is_caller_active (PkClient *client, gboolean	*is_active)
+{
+	gboolean ret;
+	GError *error;
+
+	g_return_val_if_fail (client != NULL, FALSE);
+	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
+
+	error = NULL;
+	ret = dbus_g_proxy_call (client->priv->proxy, "IsCallerActive", &error,
+				 G_TYPE_INVALID,
+				 G_TYPE_BOOLEAN, is_active,
+				 G_TYPE_INVALID);
+	if (ret == FALSE) {
+		pk_warning ("IsCallerActive failed :%s", error->message);
+		g_error_free (error);
+	}
+	return ret;
+}
+
+/**
  * pk_client_get_groups:
  **/
 PkEnumList *
@@ -2422,6 +2468,11 @@ pk_client_class_init (PkClientClass *klass)
 			      G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
 			      0, NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN,
 			      G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
+	signals [PK_CLIENT_CALLER_ACTIVE_CHANGED] =
+		g_signal_new ("caller-active-changed",
+			      G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
+			      0, NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN,
+			      G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
 	signals [PK_CLIENT_FINISHED] =
 		g_signal_new ("finished",
 			      G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
@@ -2522,6 +2573,10 @@ pk_client_init (PkClient *client)
 	dbus_g_object_register_marshaller (pk_marshal_VOID__STRING_STRING_STRING,
 					   G_TYPE_NONE, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID);
 
+	/* CallerActiveChanged */
+	dbus_g_object_register_marshaller (pk_marshal_VOID__STRING_BOOLEAN,
+					   G_TYPE_NONE, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_INVALID);
+
 	/* Description */
 	dbus_g_object_register_marshaller (pk_marshal_VOID__STRING_STRING_STRING_STRING_STRING_STRING_UINT64,
 					   G_TYPE_NONE, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
@@ -2626,6 +2681,11 @@ pk_client_init (PkClient *client)
 	dbus_g_proxy_connect_signal (proxy, "RequireRestart",
 				     G_CALLBACK (pk_client_require_restart_cb), client, NULL);
 
+	dbus_g_proxy_add_signal (proxy, "CallerActiveChanged",
+				 G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_INVALID);
+	dbus_g_proxy_connect_signal (proxy, "CallerActiveChanged",
+				     G_CALLBACK (pk_client_caller_active_changed_cb), client, NULL);
+
 	dbus_g_proxy_add_signal (proxy, "Locked", G_TYPE_BOOLEAN, G_TYPE_INVALID);
 	dbus_g_proxy_connect_signal (proxy, "Locked",
 				     G_CALLBACK (pk_client_locked_cb), client, NULL);
@@ -2674,6 +2734,8 @@ pk_client_finalize (GObject *object)
 				        G_CALLBACK (pk_client_error_code_cb), client);
 	dbus_g_proxy_disconnect_signal (client->priv->proxy, "RequireRestart",
 				        G_CALLBACK (pk_client_require_restart_cb), client);
+	dbus_g_proxy_disconnect_signal (client->priv->proxy, "CallerActiveChanged",
+					G_CALLBACK (pk_client_caller_active_changed_cb), client);
 	dbus_g_proxy_disconnect_signal (client->priv->proxy, "Locked",
 				        G_CALLBACK (pk_client_locked_cb), client);
 
diff --git a/libpackagekit/pk-client.h b/libpackagekit/pk-client.h
index e5c1cbe..844c910 100644
--- a/libpackagekit/pk-client.h
+++ b/libpackagekit/pk-client.h
@@ -152,7 +152,8 @@ gboolean	 pk_client_get_old_transactions		(PkClient	*client,
 gboolean	 pk_client_get_backend_detail		(PkClient	*client,
 							 gchar		**name,
 							 gchar		**author);
-
+gboolean	 pk_client_is_caller_active		(PkClient	*client,
+							 gboolean	*is_active);
 
 G_END_DECLS
 
diff --git a/src/pk-engine.c b/src/pk-engine.c
index 4b87c31..ac966a3 100644
--- a/src/pk-engine.c
+++ b/src/pk-engine.c
@@ -90,6 +90,7 @@ enum {
 	PK_ENGINE_DESCRIPTION,
 	PK_ENGINE_FILES,
 	PK_ENGINE_ALLOW_INTERRUPT,
+	PK_ENGINE_CALLER_ACTIVE_CHANGED,
 	PK_ENGINE_LOCKED,
 	PK_ENGINE_REPO_DETAIL,
 	PK_ENGINE_LAST_SIGNAL
@@ -2423,6 +2424,16 @@ pk_engine_get_backend_detail (PkEngine *engine, gchar **name, gchar **author, GE
 }
 
 /**
+ * pk_engine_is_caller_active:
+ **/
+gboolean
+pk_engine_is_caller_active (PkEngine *engine, const gchar *tid, gboolean *is_active, GError **error)
+{
+	//FIXME: handle NOC
+	return TRUE;
+}
+
+/**
  * pk_engine_transaction_cb:
  **/
 static void
@@ -2544,6 +2555,11 @@ pk_engine_class_init (PkEngineClass *klass)
 			      G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
 			      0, NULL, NULL, pk_marshal_VOID__STRING_BOOL,
 			      G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_BOOLEAN);
+	signals [PK_ENGINE_CALLER_ACTIVE_CHANGED] =
+		g_signal_new ("caller-active-changed",
+			      G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
+			      0, NULL, NULL, pk_marshal_VOID__STRING_BOOL,
+			      G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_BOOLEAN);
 	signals [PK_ENGINE_LOCKED] =
 		g_signal_new ("locked",
 			      G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
diff --git a/src/pk-engine.h b/src/pk-engine.h
index 26a166a..2ef3aaa 100644
--- a/src/pk-engine.h
+++ b/src/pk-engine.h
@@ -198,6 +198,10 @@ gboolean	 pk_engine_get_groups			(PkEngine	*engine,
 gboolean	 pk_engine_get_filters			(PkEngine	*engine,
 							 gchar		**filters,
 							 GError		**error);
+gboolean	 pk_engine_is_caller_active		(PkEngine	*engine,
+							 const gchar	*tid,
+							 gboolean	*is_active,
+							 GError		**error);
 guint		 pk_engine_get_seconds_idle		(PkEngine	*engine);
 
 gboolean	 pk_engine_get_progress			(PkEngine	*engine,
diff --git a/src/pk-interface.xml b/src/pk-interface.xml
index 8734fdd..c4a90cd 100644
--- a/src/pk-interface.xml
+++ b/src/pk-interface.xml
@@ -261,6 +261,14 @@
     <method name="GetFilters">
       <arg type="s" name="filters" direction="out"/> <!-- list of supported filters -->
     </method>
+    <method name="IsCallerActive">
+      <arg type="s" name="tid" direction="in"/>
+      <arg type="b" name="is_active" direction="out"/>
+    </method>
+    <signal name="CallerActiveChanged">
+      <arg type="s" name="tid" direction="out"/>
+      <arg type="b" name="is_active" direction="out"/>
+    </signal>
 
   </interface>
 </node>
commit 07677677ad5842fc07341f7e1d1b61876aec3488
Author: Richard Hughes <richard at hughsie.com>
Date:   Wed Nov 14 21:02:06 2007 +0000

    update TODO

diff --git a/TODO b/TODO
index a2b13fa..93e6a98 100644
--- a/TODO
+++ b/TODO
@@ -11,6 +11,11 @@ Emitting package download foo should set the status to downloading
 Convert the backends to send more status calls.
 Add a depsolve status enum.
 
+*** Watch NameOwnerChanged ***
+Clients that are still on the bus should handle the error, else let
+PkWatch handle it. We'll need a method to see if a transaction_id has an
+active client, which we'll also need for package notice callbacks in the future.
+
 *** Add a way to import GPG keys ***
 In fedora, if you add a signed repo you have to agree to the GPG key.
 
commit 3b51d97a12ac697d0e34b1cbe01ef62086ee3668
Author: Richard Hughes <richard at hughsie.com>
Date:   Wed Nov 14 17:53:46 2007 +0000

    fix waf buildfailures when we have NetworkManager and PolicyKit

diff --git a/client/wscript_build b/client/wscript_build
index 1a16794..da03f91 100644
--- a/client/wscript_build
+++ b/client/wscript_build
@@ -15,6 +15,8 @@ obj.includes = '. ../libpackagekit'
 obj.uselib = 'GLIB GOBJECT DBUS_GLIB POLKIT_DBUS GTHREAD'
 obj.uselib_local = 'libpackagekit'
 obj.target = 'pkcon'
+if env['HAVE_NETWORKMANAGER']:
+	obj.uselib += ' NM_GLIB'
 
 obj = bld.create_obj('cc', 'program')
 obj.source = 'pk-monitor.c'
@@ -22,3 +24,6 @@ obj.includes = '. ../libpackagekit'
 obj.uselib = 'GLIB GOBJECT DBUS_GLIB POLKIT_DBUS GTHREAD'
 obj.uselib_local = 'libpackagekit'
 obj.target = 'pkmon'
+if env['HAVE_NETWORKMANAGER']:
+	obj.uselib += ' NM_GLIB'
+
diff --git a/libpackagekit/wscript_build b/libpackagekit/wscript_build
index 7ea9f5f..f7003e2 100644
--- a/libpackagekit/wscript_build
+++ b/libpackagekit/wscript_build
@@ -78,3 +78,7 @@ if env['HAVE_TESTS']:
 	obj.uselib = 'GLIB GOBJECT DBUS_GLIB POLKIT_DBUS GTHREAD'
 	obj.target = 'test-libpackagekit'
 	obj.includes = '. ../libselftest ../libgbus'
+
+if env['HAVE_NETWORKMANAGER']:
+	obj.uselib += ' NM_GLIB'
+
diff --git a/src/wscript_build b/src/wscript_build
index 4d3562b..8194649 100644
--- a/src/wscript_build
+++ b/src/wscript_build
@@ -38,6 +38,9 @@ if env['SECURITY_TYPE_POLKIT']:
 if env['SECURITY_TYPE_DUMMY']:
     obj.source += ['pk-security-dummy.c']
 
+if env['SECURITY_TYPE_POLKIT']:
+    obj.uselib += ' POLKIT_DBUS'
+
 # Build packagekitd
 #TODO: needs to be installed in /usr/sbin/packagekitd not /usr/bin/packagekitd
 obj = bld.create_obj('gnome', 'program')
@@ -48,9 +51,10 @@ obj.add_objects = 'pkgkitd_common_source'
 obj.uselib = 'DBUS_GLIB GMODULE SQLITE GTHREAD'
 obj.uselib_local = 'libpackagekit'
 obj.add_dbus_file('pk-interface.xml', 'pk_engine', 'glib-server')
-
 if env['SECURITY_TYPE_POLKIT']:
     obj.uselib += ' POLKIT_DBUS'
+if env['HAVE_NETWORKMANAGER']:
+	obj.uselib += ' NM_GLIB'
 
 # Install backend headers to /usr/include/packagekit-backends/
 install_files('PREFIX', 'include/packagekit-backends', """
@@ -67,5 +71,7 @@ if env['HAVE_TESTS']:
 	obj.target = 'test-packagekitd'
 	obj.includes = '. ../libselftest ../libpackagekit'
 	obj.install_var = 0
+	if env['HAVE_NETWORKMANAGER']:
+		obj.uselib += ' NM_GLIB'
 
 #TODO: we really want a /src shutdown() method....
commit 0b90110251f125c312d07d9da37fa3e4172d675f
Author: Daniel Svensson <dsvensson at gmail.com>
Date:   Wed Nov 14 10:05:36 2007 +0100

    Build shared objects for code that is a part of both libs/progs and unittests.

diff --git a/libpackagekit/wscript_build b/libpackagekit/wscript_build
index 7f46692..7ea9f5f 100644
--- a/libpackagekit/wscript_build
+++ b/libpackagekit/wscript_build
@@ -9,13 +9,11 @@
 # the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 
-#Marshall file
-libpackagekit = bld.create_obj('gnome', 'shlib')
-libpackagekit.add_marshal_file('pk-marshal.list', 'pk_marshal', '--header')
-libpackagekit.add_marshal_file('pk-marshal.list', 'pk_marshal', '--body')
-libpackagekit.uselib = 'GLIB GOBJECT DBUS DBUS_GLIB'
-libpackagekit.add_objects = 'libgbus libselftest'
-libpackagekit.source = """
+obj = bld.create_obj('gnome', 'objects')
+obj.includes = '. ../libgbus ../libselftest'
+obj.target = 'libpkgkit_common_source'
+obj.uselib = 'GLIB GOBJECT DBUS DBUS_GLIB'
+obj.source = """
 	pk-debug.c
 	pk-connection.c
 	pk-package-id.c
@@ -29,24 +27,32 @@ libpackagekit.source = """
 	pk-polkit-client.c
 """
 
+env = bld.env()
+if env['HAVE_NETWORKMANAGER']:
+    obj.uselib += ' NM_GLIB'
+    obj.source += ' pk-network-nm.c'
+else:
+    obj.source += ' pk-network-dummy.c'
+obj.add_objects = 'libgbus libselftest'
+obj.add_marshal_file('pk-marshal.list', 'pk_marshal', '--header')
+obj.add_marshal_file('pk-marshal.list', 'pk_marshal', '--body')
+
+
+
+#Marshall file
+obj = bld.create_obj('gnome', 'shlib')
+obj.uselib = 'GLIB GOBJECT DBUS DBUS_GLIB'
+obj.add_objects = 'libpkgkit_common_source'
 # libtool versioning - CURRENT.REVISION.AGE
 # increment:
 # CURRENT	If the API or ABI interface has changed (reset REVISION to 0)
 # REVISION	If the API and ABI remains the same, but bugs are fixed.
 # AGE		If libpackagekit can be linked into executables which can be
 # 		built with previous versions of this library. Don't use.
-libpackagekit.vnum = '3.0.0'
-
-env = bld.env()
-if env['HAVE_NETWORKMANAGER']:
-    libpackagekit.uselib += ' NM_GLIB'
-    libpackagekit.source += ' pk-network-nm.c'
-else:
-    libpackagekit.source += ' pk-network-dummy.c'
-
-libpackagekit.includes      = '. ../libgbus ../libselftest'
-libpackagekit.target        = 'packagekit'
-libpackagekit.name          = 'libpackagekit'
+obj.vnum = '3.0.0'
+obj.includes      = '. ../libgbus ../libselftest'
+obj.target        = 'packagekit'
+obj.name          = 'libpackagekit'
 
 # install headers to /usr/include/packagekit/
 install_files('PREFIX', 'include/packagekit', """
@@ -68,7 +74,7 @@ install_files('PREFIX', 'include/packagekit', """
 if env['HAVE_TESTS']:
 	obj = bld.create_obj('cc', 'program')
 	obj.source = 'pk-self-test.c'
+	obj.add_objects = 'libpkgkit_common_source'
 	obj.uselib = 'GLIB GOBJECT DBUS_GLIB POLKIT_DBUS GTHREAD'
-	obj.uselib_local = 'libpackagekit'
 	obj.target = 'test-libpackagekit'
 	obj.includes = '. ../libselftest ../libgbus'
diff --git a/src/wscript_build b/src/wscript_build
index 7706089..4d3562b 100644
--- a/src/wscript_build
+++ b/src/wscript_build
@@ -9,7 +9,16 @@
 # the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 
-common_source = """
+env = bld.env()
+
+# Build the objects that are to be a part of both packagekitd and the testsuite
+obj = bld.create_obj('gnome', 'objects')
+obj.includes = '. ../libpackagekit ../libselftest'
+obj.target = 'pkgkitd_common_source'
+obj.uselib = 'DBUS_GLIB GMODULE SQLITE GTHREAD'
+obj.add_marshal_file('pk-marshal.list', 'pk_marshal', '--header')
+obj.add_marshal_file('pk-marshal.list', 'pk_marshal', '--body')
+obj.source = """
 	pk-backend.c
 	pk-backend-python.c
 	pk-conf.c
@@ -21,56 +30,42 @@ common_source = """
 	pk-transaction-db.c
 	pk-transaction-id.c
 	pk-transaction-list.c
-"""
-
-env = bld.env()
+""".split()
 
 if env['SECURITY_TYPE_POLKIT']:
-    common_source += """
-		pk-security-polkit.c
-	"""
+    obj.source += ['pk-security-polkit.c']
 
 if env['SECURITY_TYPE_DUMMY']:
-    common_source += """
-		pk-security-dummy.c
-	"""
-
-obj = bld.create_obj('cc', 'objects')
-obj.source = common_source
-obj.includes = '. ../libpackagekit ../libselftest'
-obj.target = 'common_source'
-obj.uselib = 'DBUS_GLIB GMODULE SQLITE GTHREAD'
+    obj.source += ['pk-security-dummy.c']
 
-#create the daemon
+# Build packagekitd
 #TODO: needs to be installed in /usr/sbin/packagekitd not /usr/bin/packagekitd
 obj = bld.create_obj('gnome', 'program')
 obj.target = 'packagekitd'
 obj.source = 'pk-main.c'
 obj.includes = '. ../libpackagekit ../libselftest'
-obj.add_objects = 'common_source'
+obj.add_objects = 'pkgkitd_common_source'
 obj.uselib = 'DBUS_GLIB GMODULE SQLITE GTHREAD'
 obj.uselib_local = 'libpackagekit'
 obj.add_dbus_file('pk-interface.xml', 'pk_engine', 'glib-server')
-obj.add_marshal_file('pk-marshal.list', 'pk_marshal', '--header')
-obj.add_marshal_file('pk-marshal.list', 'pk_marshal', '--body')
 
 if env['SECURITY_TYPE_POLKIT']:
     obj.uselib += ' POLKIT_DBUS'
 
-# install backend headers to /usr/include/packagekit-backends/
+# Install backend headers to /usr/include/packagekit-backends/
 install_files('PREFIX', 'include/packagekit-backends', """
 		pk-backend.h
 		pk-backend-python.h
-	""")
+""")
 
-#TODO: do not install this file!!!
 if env['HAVE_TESTS']:
-	selftest = bld.create_obj('cc', 'program')
-	selftest.source = 'pk-self-test.c'
-	selftest.add_objects = 'common_source'
-	selftest.uselib = 'DBUS_GLIB GMODULE SQLITE GTHREAD GOBJECT POLKIT_DBUS'
-	selftest.uselib_local = 'libpackagekit'
-	selftest.target = 'test-packagekitd'
-	selftest.includes = '. ../libselftest ../libpackagekit'
+	obj = bld.create_obj('cc', 'program')
+	obj.source = 'pk-self-test.c'
+	obj.add_objects = 'pkgkitd_common_source'
+	obj.uselib = 'DBUS_GLIB GMODULE SQLITE GTHREAD GOBJECT POLKIT_DBUS'
+	obj.uselib_local = 'libpackagekit'
+	obj.target = 'test-packagekitd'
+	obj.includes = '. ../libselftest ../libpackagekit'
+	obj.install_var = 0
 
 #TODO: we really want a /src shutdown() method....
diff --git a/wscript b/wscript
index 71482ae..e544333 100644
--- a/wscript
+++ b/wscript
@@ -146,9 +146,12 @@ def gcov_report():
 
 	rootdir = os.getcwd()
 
-	cleanup = []
 
-	for test in ['test-libpackagekit', 'test-packagekitd']:
+	#for test in ['test-libpackagekit', 'test-packagekitd']:
+	for test in ['test-libpackagekit']:
+		cleanup = []
+		sources = []
+
 		obj = Object.name_to_obj(test)
 
 		testdir = os.path.join(blddir, obj.path.bldpath(env))
@@ -179,11 +182,13 @@ def gcov_report():
 				tgt_name = lib_name + suffix
 				tgt_path = os.path.join(rootdir, testdir, tgt_name)
 				src_path = os.path.join(rootdir, blddir, lib_path, lib_name)
-				
+
 				if not os.path.exists(tgt_path):
 					os.symlink(src_path, tgt_path)
 					cleanup.append(tgt_path)
 
+		sources += obj.to_list(obj.source)
+
 		#from http://code.nsnam.org/ns-3-dev/file/c21093326f8d/wscript
 		#command = 'rm -f gcov.txt'
 		#if subprocess.Popen(command, shell=True).wait():
commit b5ea50c416c565cd99510f668a6c87f3ea0957a7
Author: Daniel Svensson <dsvensson at gmail.com>
Date:   Wed Nov 14 01:28:59 2007 +0100

    Run test suite.
    This only runs the suite, what's left is to collect the gcov data.

diff --git a/libpackagekit/wscript_build b/libpackagekit/wscript_build
index 2af4a9b..7f46692 100644
--- a/libpackagekit/wscript_build
+++ b/libpackagekit/wscript_build
@@ -67,8 +67,8 @@ install_files('PREFIX', 'include/packagekit', """
 #TODO: do not install this file!!!
 if env['HAVE_TESTS']:
 	obj = bld.create_obj('cc', 'program')
-	obj.source = libpackagekit.source + ' pk-self-test.c'
+	obj.source = 'pk-self-test.c'
 	obj.uselib = 'GLIB GOBJECT DBUS_GLIB POLKIT_DBUS GTHREAD'
 	obj.uselib_local = 'libpackagekit'
-	obj.target = 'pk-self-test'
+	obj.target = 'test-libpackagekit'
 	obj.includes = '. ../libselftest ../libgbus'
diff --git a/src/pk-security-dummy.c b/src/pk-security-dummy.c
index 1d51d60..ff8d0d6 100644
--- a/src/pk-security-dummy.c
+++ b/src/pk-security-dummy.c
@@ -30,6 +30,8 @@
 
 #include <pk-enum.h>
 
+#include <config.h>
+
 #include "pk-debug.h"
 #include "pk-security.h"
 
@@ -107,3 +109,13 @@ pk_security_new (void)
 	return PK_SECURITY (security);
 }
 
+#ifdef PK_BUILD_TESTS
+#include <libselftest.h>
+
+void
+libst_security (LibSelfTest *test)
+{
+	return;
+}
+#endif
+
diff --git a/src/wscript_build b/src/wscript_build
index d4fcf2c..7706089 100644
--- a/src/wscript_build
+++ b/src/wscript_build
@@ -35,22 +35,24 @@ if env['SECURITY_TYPE_DUMMY']:
 		pk-security-dummy.c
 	"""
 
+obj = bld.create_obj('cc', 'objects')
+obj.source = common_source
+obj.includes = '. ../libpackagekit ../libselftest'
+obj.target = 'common_source'
+obj.uselib = 'DBUS_GLIB GMODULE SQLITE GTHREAD'
+
 #create the daemon
-obj = bld.create_obj('gnome', 'program')
-obj.source = common_source + ' pk-main.c'
 #TODO: needs to be installed in /usr/sbin/packagekitd not /usr/bin/packagekitd
-
-defines = env['defines']
-
+obj = bld.create_obj('gnome', 'program')
+obj.target = 'packagekitd'
+obj.source = 'pk-main.c'
 obj.includes = '. ../libpackagekit ../libselftest'
+obj.add_objects = 'common_source'
 obj.uselib = 'DBUS_GLIB GMODULE SQLITE GTHREAD'
 obj.uselib_local = 'libpackagekit'
-#obj.add_objects = 'selftest'
-obj.target = 'packagekitd'
 obj.add_dbus_file('pk-interface.xml', 'pk_engine', 'glib-server')
 obj.add_marshal_file('pk-marshal.list', 'pk_marshal', '--header')
 obj.add_marshal_file('pk-marshal.list', 'pk_marshal', '--body')
-#obj.env.append_value('CCDEFINES', 'LOCALSTATEDIR="%s"' % obj.env['LOCALSTATEDIR'])
 
 if env['SECURITY_TYPE_POLKIT']:
     obj.uselib += ' POLKIT_DBUS'
@@ -62,12 +64,13 @@ install_files('PREFIX', 'include/packagekit-backends', """
 	""")
 
 #TODO: do not install this file!!!
-if env['HAVE_TESTS'] and env['SECURITY_TYPE_POLKIT']:
+if env['HAVE_TESTS']:
 	selftest = bld.create_obj('cc', 'program')
-	selftest.source = common_source + ' pk-self-test.c'
+	selftest.source = 'pk-self-test.c'
+	selftest.add_objects = 'common_source'
 	selftest.uselib = 'DBUS_GLIB GMODULE SQLITE GTHREAD GOBJECT POLKIT_DBUS'
 	selftest.uselib_local = 'libpackagekit'
-	selftest.target = 'pk-self-test'
+	selftest.target = 'test-packagekitd'
 	selftest.includes = '. ../libselftest ../libpackagekit'
 
 #TODO: we really want a /src shutdown() method....
diff --git a/wscript b/wscript
index 13db39a..71482ae 100644
--- a/wscript
+++ b/wscript
@@ -11,6 +11,7 @@
 
 import os
 import Params
+import Object
 import misc
 import shutil
 import subprocess
@@ -100,8 +101,8 @@ def configure(conf):
 		conf.env.append_value('CPPFLAGS', '-Wall -Werror -Wcast-align -Wno-uninitialized')
 	if Params.g_options.gcov:
 		conf.env['HAVE_GCOV'] = True
-		conf.env.append_value('CFLAGS', '-fprofile-arcs')
-		conf.env.append_value('CFLAGS', '-ftest-coverage')
+		conf.env.append_value('CCFLAGS', '-fprofile-arcs')
+		conf.env.append_value('CCFLAGS', '-ftest-coverage')
 		conf.env.append_value('CXXFLAGS', '-fprofile-arcs')
 		conf.env.append_value('CXXFLAGS', '-ftest-coverage')
 		conf.env.append_value('LINKFLAGS', '-fprofile-arcs')
@@ -143,34 +144,63 @@ def gcov_report():
 	env = Params.g_build.env()
 	variant = env.variant()
 
-	basedir = os.path.join(blddir, variant)
 	rootdir = os.getcwd()
 
-	for test in ['libpackagekit', 'src']:
-		testdir = os.path.join(basedir, test)
+	cleanup = []
+
+	for test in ['test-libpackagekit', 'test-packagekitd']:
+		obj = Object.name_to_obj(test)
+
+		testdir = os.path.join(blddir, obj.path.bldpath(env))
 		if not os.path.isdir(testdir):
 			continue
 
-		file = os.path.join(testdir, 'pk-self-test')
+		file = os.path.join(testdir, obj.name)
 		if not os.path.isfile(file):
 			continue
 
-		os.chdir(testdir)
-
-		try:
-			#from http://code.nsnam.org/ns-3-dev/file/c21093326f8d/wscript
-			command = 'rm -f gcov.txt'
-			if subprocess.Popen(command, shell=True).wait():
-				raise SystemExit(1)
-
-			command = './pk-self-test'
-			if subprocess.Popen(command, shell=True).wait():
-				raise SystemExit(1)
-
-			report_tool = os.path.join(rootdir, 'tools', 'create-coverage-report.sh')
-			command = report_tool + ' packagekit src/*.c'
-			if subprocess.Popen(command, shell=True).wait():
-				raise SystemExit(1)
-
-		finally:
-			os.chdir(rootdir)
+		# Waf currently doesn't name libraries until install. :(
+		#
+		# This should properly link all local libraries in use
+		# to the directory of the test.
+		for uselib in obj.to_list(obj.uselib_local):
+			lib = Object.name_to_obj(uselib)
+
+			lib_path = lib.path.bldpath(env)
+			lib_name = lib.name + '.so'
+
+			vnum_lst = lib.vnum.split('.')
+
+			for x in range(len(vnum_lst) + 1):
+				suffix = '.'.join(vnum_lst[:x])
+				if suffix:
+					suffix = '.' + suffix
+
+				tgt_name = lib_name + suffix
+				tgt_path = os.path.join(rootdir, testdir, tgt_name)
+				src_path = os.path.join(rootdir, blddir, lib_path, lib_name)
+				
+				if not os.path.exists(tgt_path):
+					os.symlink(src_path, tgt_path)
+					cleanup.append(tgt_path)
+
+		#from http://code.nsnam.org/ns-3-dev/file/c21093326f8d/wscript
+		#command = 'rm -f gcov.txt'
+		#if subprocess.Popen(command, shell=True).wait():
+		#	raise SystemExit(1)
+
+		d = obj.path.bldpath(env)
+
+		command = 'LD_LIBRARY_PATH=%s %s/%s' % (testdir, testdir, test)
+		if subprocess.Popen(command, shell=True).wait():
+			raise SystemExit(1)
+
+		os.chdir(rootdir)
+
+		"""
+		report_tool = os.path.join(rootdir, 'tools', 'create-coverage-report.sh')
+		command = report_tool + ' packagekit ../libpackagekit/*.c'
+		print command, os.getcwd()
+		if subprocess.Popen(command, shell=True).wait():
+			raise SystemExit(1)
+		"""
commit 60b1a657a77dd7d9e6111aea43d1f4aae61bc7ba
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Nov 13 00:12:11 2007 +0000

    add note about QPackageKit

diff --git a/html/pk-download.html b/html/pk-download.html
index 65e9f60..5e483c0 100644
--- a/html/pk-download.html
+++ b/html/pk-download.html
@@ -61,10 +61,12 @@ Just make sure you install PackageKit before gnome-packagekit!
 
 <h2>Compiling the latest code</h2>
 <p>
-You can get the latest code from the public git repo on freedesktop.
+You can get the latest PackageKit daemon, and QT or GNOME frontends from the
+public git repositories on freedesktop.
 </p>
 <pre>
 git clone git://anongit.freedesktop.org/git/packagekit
+git clone git://people.freedesktop.org/~hughsient/QPackageKit
 git clone git://people.freedesktop.org/~hughsient/gnome-packagekit
 </pre>
 <p>
diff --git a/html/pk-intro.html b/html/pk-intro.html
index 8198cc8..537b88e 100644
--- a/html/pk-intro.html
+++ b/html/pk-intro.html
@@ -45,8 +45,11 @@ consume memory when not being used.
 <p>
 <code>gnome-packagekit</code> is the name of the collection of graphical
 tools for PackageKit to be used in the GNOME desktop.
-There are also QT applications being designed, although these are not
-fully functional yet.
+</p>
+<p>
+<code>QPackageKit</code> is the name of the QT graphical tools designed
+for PackageKit.
+These are not fully functional yet, although development is rapid.
 </p>
 
 <p>
commit e4b1229faa239b0aba1c6df48f6ea27604ed70b0
Author: Richard Hughes <richard at hughsie.com>
Date:   Mon Nov 12 23:07:22 2007 +0000

    commit a half finished patch where we warn on status not changing

diff --git a/TODO b/TODO
index b52b129..a2b13fa 100644
--- a/TODO
+++ b/TODO
@@ -6,6 +6,11 @@ Requires writing to a database for config stuff
 New method GetHoursSinceLastUpdate
 Use this in the update icon
 
+*** package->status ***
+Emitting package download foo should set the status to downloading
+Convert the backends to send more status calls.
+Add a depsolve status enum.
+
 *** Add a way to import GPG keys ***
 In fedora, if you add a signed repo you have to agree to the GPG key.
 
diff --git a/src/pk-backend.c b/src/pk-backend.c
index e5817bd..f261a3b 100644
--- a/src/pk-backend.c
+++ b/src/pk-backend.c
@@ -1046,9 +1046,15 @@ pk_backend_finished_delay (gpointer data)
 gboolean
 pk_backend_finished (PkBackend *backend)
 {
+	const gchar *role_text;
+
 	g_return_val_if_fail (backend != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_BACKEND (backend), FALSE);
 
+	/* find out what we just did */
+	role_text = pk_role_enum_to_text (backend->priv->role);
+	pk_debug ("finished role %s", role_text);
+
 	/* are we trying to finish in init? */
 	if (backend->priv->during_initialize == TRUE) {
 		g_print ("You can't call pk_backend_finished in backend_initialize!\n");
@@ -1070,13 +1076,28 @@ pk_backend_finished (PkBackend *backend)
 	/* check we have not already finished */
 	if (backend->priv->finished == TRUE) {
 		g_print ("Backends cannot request Finished more than once!\n");
-		g_print ("If you are using :\n");
+		g_print ("If you are using:\n");
 		g_print ("* pk_backend_thread_helper\n");
 		g_print ("   - You should _not_ use pk_backend_finished directly");
 		g_print ("   - Return from the function like normal\n");
 		pk_error ("Internal error, cannot continue!");
 	}
 
+	/* check we sent at least one status calls */
+	if (backend->priv->status == PK_STATUS_ENUM_SETUP) {
+		g_print ("Backends should send status <value> signals to update the UI!\n");
+		g_print ("If you are:\n");
+		g_print ("* Calling out to external tools, the compiled backend "
+			 "should call pk_backend_change_status() manually.\n");
+		g_print ("* Using a scripted backend with dumb commands then "
+			 "this should be set at the start of the runtime call\n");
+		g_print ("   - see helpers/yumBackend.py:self.status()\n");
+		g_print ("* Using a scripted backend with clever commands then a "
+			 "  callback should use map values into status enums\n");
+		g_print ("   - see helpers/yumBackend.py:self.state_actions\n");
+		pk_warning ("GUI will remain unchanged!");
+	}
+
 	/* we can't ever be re-used */
 	backend->priv->finished = TRUE;
 
commit 83d9358d1a6ff8b963e5766292afd7918420dd37
Author: Richard Hughes <richard at hughsie.com>
Date:   Mon Nov 12 22:55:13 2007 +0000

    force a fflush to make sure we always get the error text context

diff --git a/libpackagekit/pk-debug.c b/libpackagekit/pk-debug.c
index 0d6accf..e255c58 100644
--- a/libpackagekit/pk-debug.c
+++ b/libpackagekit/pk-debug.c
@@ -89,6 +89,9 @@ pk_warning_real (const gchar *func, const gchar *file, const int line, const gch
 	g_vasprintf (&buffer, format, args);
 	va_end (args);
 
+	/* flush other output */
+	fflush (stdout);
+
 	/* do extra stuff for a warning */
 	fprintf (stderr, "*** WARNING ***\n");
 	pk_print_line (func, file, line, buffer);
@@ -109,10 +112,16 @@ pk_error_real (const gchar *func, const gchar *file, const int line, const gchar
 	g_vasprintf (&buffer, format, args);
 	va_end (args);
 
+	/* flush other output */
+	fflush (stdout);
+
 	/* do extra stuff for a warning */
 	fprintf (stderr, "*** ERROR ***\n");
 	pk_print_line (func, file, line, buffer);
 	g_free(buffer);
+
+	/* flush this message */
+	fflush (stderr);
 	exit (1);
 }
 
commit b6a2f61286b8c14d7c3bac7c3daebb145af29886
Author: Daniel Svensson <dsvensson at gmail.com>
Date:   Tue Nov 13 01:04:14 2007 +0100

    Append HAVE_CONFIG_H as a CCDEFINE instead of adding it to CCFLAGS.

diff --git a/wscript b/wscript
index f551ceb..13db39a 100644
--- a/wscript
+++ b/wscript
@@ -91,7 +91,7 @@ def configure(conf):
 	conf.add_define('PK_DB_DIR', os.path.join(conf.env['DATADIR'], 'lib', 'PackageKit'))
 	conf.add_define('PK_PLUGIN_DIR', os.path.join(conf.env['LIBDIR'], 'packagekit-backend'))
 
-	conf.env.append_value('CCFLAGS', '-DHAVE_CONFIG_H')
+	conf.env['CCDEFINES'] += ['HAVE_CONFIG_H']
 	conf.write_config_header('config.h')
 
 
commit 767705c8d9232abbbf9e3ba0810c1ee80a2c9588
Author: Daniel Svensson <dsvensson at gmail.com>
Date:   Tue Nov 13 00:57:13 2007 +0100

    Style cleanup of libpackagekit/wscript_build.

diff --git a/libpackagekit/wscript_build b/libpackagekit/wscript_build
index e843b87..2af4a9b 100644
--- a/libpackagekit/wscript_build
+++ b/libpackagekit/wscript_build
@@ -35,26 +35,21 @@ libpackagekit.source = """
 # REVISION	If the API and ABI remains the same, but bugs are fixed.
 # AGE		If libpackagekit can be linked into executables which can be
 # 		built with previous versions of this library. Don't use.
-libpackagekit.vnum='3.0.0'
+libpackagekit.vnum = '3.0.0'
 
 env = bld.env()
 if env['HAVE_NETWORKMANAGER']:
     libpackagekit.uselib += ' NM_GLIB'
-    libpackagekit.source += '''
-	pk-network-nm.c
-'''
+    libpackagekit.source += ' pk-network-nm.c'
 else:
-    libpackagekit.source += '''
-	pk-network-dummy.c
-'''
-
+    libpackagekit.source += ' pk-network-dummy.c'
 
 libpackagekit.includes      = '. ../libgbus ../libselftest'
 libpackagekit.target        = 'packagekit'
 libpackagekit.name          = 'libpackagekit'
 
 # install headers to /usr/include/packagekit/
-install_files('PREFIX', 'include/packagekit',"""
+install_files('PREFIX', 'include/packagekit', """
 	pk-debug.h
 	pk-connection.h
 	pk-network.h
@@ -70,11 +65,10 @@ install_files('PREFIX', 'include/packagekit',"""
 """)
 
 #TODO: do not install this file!!!
-if Params.g_options.tests:
+if env['HAVE_TESTS']:
 	obj = bld.create_obj('cc', 'program')
 	obj.source = libpackagekit.source + ' pk-self-test.c'
 	obj.uselib = 'GLIB GOBJECT DBUS_GLIB POLKIT_DBUS GTHREAD'
 	obj.uselib_local = 'libpackagekit'
 	obj.target = 'pk-self-test'
 	obj.includes = '. ../libselftest ../libgbus'
-
commit d5ab6f0005326e95fe6c2350f88d743bf0b9c23e
Author: Daniel Svensson <dsvensson at gmail.com>
Date:   Tue Nov 13 00:56:34 2007 +0100

    Run testsuites and gcov on shutdown if configured with --enable-gcov.

diff --git a/wscript b/wscript
index 74e53d8..f551ceb 100644
--- a/wscript
+++ b/wscript
@@ -13,6 +13,7 @@ import os
 import Params
 import misc
 import shutil
+import subprocess
 
 # the following two variables are used by the target "waf dist"
 VERSION='0.1.4'
@@ -98,6 +99,7 @@ def configure(conf):
 	if Params.g_options.wall:
 		conf.env.append_value('CPPFLAGS', '-Wall -Werror -Wcast-align -Wno-uninitialized')
 	if Params.g_options.gcov:
+		conf.env['HAVE_GCOV'] = True
 		conf.env.append_value('CFLAGS', '-fprofile-arcs')
 		conf.env.append_value('CFLAGS', '-ftest-coverage')
 		conf.env.append_value('CXXFLAGS', '-fprofile-arcs')
@@ -133,25 +135,42 @@ def build(bld):
 	obj.install_subdir = 'etc/dbus-1/system.d'
 
 def shutdown():
-	#TODO: why ohh why doesn't this work?
-	if Params.g_options.gcov:
+	env = Params.g_build.env()
+	if env['HAVE_GCOV']:
 		gcov_report()
-	pass
 
 def gcov_report():
-	env = Params.g_build.env_of_name('default')
-	os.chdir(blddir)
-	try:
-		#from http://code.nsnam.org/ns-3-dev/file/c21093326f8d/wscript
-		command = 'rm -f gcov.txt'
-		if subprocess.Popen(command, shell=True).wait():
-			raise SystemExit(1)
-		command = '../src/pk-self-test'
-		if subprocess.Popen(command, shell=True).wait():
-			raise SystemExit(1)
-		command = '../tools/create-coverage-report.sh packagekit src/*.c'
-		if subprocess.Popen(command, shell=True).wait():
-			raise SystemExit(1)
-	finally:
-		os.chdir("..")
+	env = Params.g_build.env()
+	variant = env.variant()
+
+	basedir = os.path.join(blddir, variant)
+	rootdir = os.getcwd()
+
+	for test in ['libpackagekit', 'src']:
+		testdir = os.path.join(basedir, test)
+		if not os.path.isdir(testdir):
+			continue
+
+		file = os.path.join(testdir, 'pk-self-test')
+		if not os.path.isfile(file):
+			continue
+
+		os.chdir(testdir)
+
+		try:
+			#from http://code.nsnam.org/ns-3-dev/file/c21093326f8d/wscript
+			command = 'rm -f gcov.txt'
+			if subprocess.Popen(command, shell=True).wait():
+				raise SystemExit(1)
+
+			command = './pk-self-test'
+			if subprocess.Popen(command, shell=True).wait():
+				raise SystemExit(1)
+
+			report_tool = os.path.join(rootdir, 'tools', 'create-coverage-report.sh')
+			command = report_tool + ' packagekit src/*.c'
+			if subprocess.Popen(command, shell=True).wait():
+				raise SystemExit(1)
 
+		finally:
+			os.chdir(rootdir)
commit d368e59616201f20961a71929fe8041168e39e23
Author: Daniel Svensson <dsvensson at gmail.com>
Date:   Tue Nov 13 00:25:22 2007 +0100

    Change some more settings to live in env[] instead.

diff --git a/libpackagekit/wscript_build b/libpackagekit/wscript_build
index 4564fb5..e843b87 100644
--- a/libpackagekit/wscript_build
+++ b/libpackagekit/wscript_build
@@ -37,8 +37,8 @@ libpackagekit.source = """
 # 		built with previous versions of this library. Don't use.
 libpackagekit.vnum='3.0.0'
 
-defines = bld.env()['defines']
-if defines.get('PK_BUILD_NETWORKMANAGER', False):
+env = bld.env()
+if env['HAVE_NETWORKMANAGER']:
     libpackagekit.uselib += ' NM_GLIB'
     libpackagekit.source += '''
 	pk-network-nm.c
diff --git a/src/wscript_build b/src/wscript_build
index 9748a08..d4fcf2c 100644
--- a/src/wscript_build
+++ b/src/wscript_build
@@ -40,7 +40,7 @@ obj = bld.create_obj('gnome', 'program')
 obj.source = common_source + ' pk-main.c'
 #TODO: needs to be installed in /usr/sbin/packagekitd not /usr/bin/packagekitd
 
-defines = bld.env()['defines']
+defines = env['defines']
 
 obj.includes = '. ../libpackagekit ../libselftest'
 obj.uselib = 'DBUS_GLIB GMODULE SQLITE GTHREAD'
@@ -62,7 +62,7 @@ install_files('PREFIX', 'include/packagekit-backends', """
 	""")
 
 #TODO: do not install this file!!!
-if Params.g_options.tests and env['SECURITY_TYPE_POLKIT']:
+if env['HAVE_TESTS'] and env['SECURITY_TYPE_POLKIT']:
 	selftest = bld.create_obj('cc', 'program')
 	selftest.source = common_source + ' pk-self-test.c'
 	selftest.uselib = 'DBUS_GLIB GMODULE SQLITE GTHREAD GOBJECT POLKIT_DBUS'
diff --git a/wscript b/wscript
index 2eeee11..74e53d8 100644
--- a/wscript
+++ b/wscript
@@ -65,13 +65,13 @@ def configure(conf):
 
 	#optional deps
 	if conf.check_pkg('libnm_glib', destvar='NM_GLIB', vnum='0.6.4'):
-		conf.add_define('PK_BUILD_NETWORKMANAGER', 1)
+		conf.env['HAVE_NETWORKMANAGER'] = True
 
 	if conf.find_program('docbook2man', var='DOCBOOK2MAN'):
-		conf.env['HAVE_DOCBOOK2MAN'] = 1
+		conf.env['HAVE_DOCBOOK2MAN'] = True
 
 	if conf.find_program('xmlto', var='XMLTO'):
-		conf.env['DOCBOOK_DOCS_ENABLED'] = 1
+		conf.env['DOCBOOK_DOCS_ENABLED'] = True
 
 	# Check what backend to use
 	conf.sub_config('backends')
@@ -79,6 +79,7 @@ def configure(conf):
 	#do we build the self tests?
 	if Params.g_options.tests:
 		conf.add_define('PK_BUILD_TESTS', 1)
+		conf.env['HAVE_TESTS'] = True
 
 	conf.add_define('VERSION', VERSION)
 	conf.add_define('GETTEXT_PACKAGE', 'PackageKit')
commit e82c48607ba3b19e1800ba61f708eac8f03edb06
Author: Daniel Svensson <dsvensson at gmail.com>
Date:   Tue Nov 13 00:07:15 2007 +0100

    Do not build test suite unless PolicyKit is enabled.
    A bit messed up diff :(. This also changes so that SECURITY_TYPE_DUMMY and
    SECURITY_TYPE_POLKIT are checked in the env instead of defines (as they are
    never used in the source code placing them in defines is useless). And I
    couldn't help myself to fix some python coding style changes while I was at it.

diff --git a/src/wscript_build b/src/wscript_build
index 1f25162..9748a08 100644
--- a/src/wscript_build
+++ b/src/wscript_build
@@ -9,29 +9,31 @@
 # the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 
-common_source='''
-pk-backend.c
-pk-backend-python.c
-pk-conf.c
-pk-engine.c
-pk-inhibit.c
-pk-spawn.c
-pk-thread-list.c
-pk-time.c
-pk-transaction-db.c
-pk-transaction-id.c
-pk-transaction-list.c
-'''
+common_source = """
+	pk-backend.c
+	pk-backend-python.c
+	pk-conf.c
+	pk-engine.c
+	pk-inhibit.c
+	pk-spawn.c
+	pk-thread-list.c
+	pk-time.c
+	pk-transaction-db.c
+	pk-transaction-id.c
+	pk-transaction-list.c
+"""
 
-if defines.get('SECURITY_TYPE_POLKIT', False):
-    common_source += '''
-	pk-security-polkit.c
-'''
+env = bld.env()
 
-if defines.get('SECURITY_TYPE_DUMMY', False):
-    common_source += '''
-	pk-security-dummy.c
-'''
+if env['SECURITY_TYPE_POLKIT']:
+    common_source += """
+		pk-security-polkit.c
+	"""
+
+if env['SECURITY_TYPE_DUMMY']:
+    common_source += """
+		pk-security-dummy.c
+	"""
 
 #create the daemon
 obj = bld.create_obj('gnome', 'program')
@@ -40,27 +42,27 @@ obj.source = common_source + ' pk-main.c'
 
 defines = bld.env()['defines']
 
-obj.includes='. ../libpackagekit ../libselftest'
-obj.uselib='DBUS_GLIB GMODULE SQLITE GTHREAD'
+obj.includes = '. ../libpackagekit ../libselftest'
+obj.uselib = 'DBUS_GLIB GMODULE SQLITE GTHREAD'
 obj.uselib_local = 'libpackagekit'
 #obj.add_objects = 'selftest'
-obj.target='packagekitd'
+obj.target = 'packagekitd'
 obj.add_dbus_file('pk-interface.xml', 'pk_engine', 'glib-server')
 obj.add_marshal_file('pk-marshal.list', 'pk_marshal', '--header')
 obj.add_marshal_file('pk-marshal.list', 'pk_marshal', '--body')
 #obj.env.append_value('CCDEFINES', 'LOCALSTATEDIR="%s"' % obj.env['LOCALSTATEDIR'])
 
-if defines.get('SECURITY_TYPE_POLKIT', False):
+if env['SECURITY_TYPE_POLKIT']:
     obj.uselib += ' POLKIT_DBUS'
 
 # install backend headers to /usr/include/packagekit-backends/
-install_files('PREFIX', 'include/packagekit-backends', '''
-	pk-backend.h
-	pk-backend-python.h
-''')
+install_files('PREFIX', 'include/packagekit-backends', """
+		pk-backend.h
+		pk-backend-python.h
+	""")
 
 #TODO: do not install this file!!!
-if Params.g_options.tests:
+if Params.g_options.tests and env['SECURITY_TYPE_POLKIT']:
 	selftest = bld.create_obj('cc', 'program')
 	selftest.source = common_source + ' pk-self-test.c'
 	selftest.uselib = 'DBUS_GLIB GMODULE SQLITE GTHREAD GOBJECT POLKIT_DBUS'
@@ -69,4 +71,3 @@ if Params.g_options.tests:
 	selftest.includes = '. ../libselftest ../libpackagekit'
 
 #TODO: we really want a /src shutdown() method....
-
diff --git a/wscript b/wscript
index 9d68a56..2eeee11 100644
--- a/wscript
+++ b/wscript
@@ -56,12 +56,12 @@ def configure(conf):
 		if Params.g_options.tests:
 			ret = conf.find_program('polkit-config-file-validate', var='POLKIT_POLICY_FILE_VALIDATE')
 	if ret:
-		conf.add_define('SECURITY_TYPE_POLKIT', 1)
+		conf.env['SECURITY_TYPE_POLKIT'] = True
 	else:
 		print "*******************************************************************"
 		print "** YOU ARE NOT USING A SECURE DAEMON. ALL USERS CAN DO ANYTHING! **"
 		print "*******************************************************************"
-		conf.add_define('SECURITY_TYPE_DUMMY', 1)
+		conf.env['SECURITY_TYPE_DUMMY'] = True
 
 	#optional deps
 	if conf.check_pkg('libnm_glib', destvar='NM_GLIB', vnum='0.6.4'):
@@ -84,7 +84,7 @@ def configure(conf):
 	conf.add_define('GETTEXT_PACKAGE', 'PackageKit')
 	conf.add_define('PACKAGE', 'PackageKit')
 
-        assert conf.env['SYSCONFDIR'], "You have too old WAF; please update to trunk"
+	assert conf.env['SYSCONFDIR'], "You have too old WAF; please update to trunk"
 
 	conf.add_define('PK_DB_DIR', os.path.join(conf.env['DATADIR'], 'lib', 'PackageKit'))
 	conf.add_define('PK_PLUGIN_DIR', os.path.join(conf.env['LIBDIR'], 'packagekit-backend'))
@@ -93,7 +93,7 @@ def configure(conf):
 	conf.write_config_header('config.h')
 
 
-	# We want these last as they shouldn't 
+	# We want these last as they might confligt with configuration checks.
 	if Params.g_options.wall:
 		conf.env.append_value('CPPFLAGS', '-Wall -Werror -Wcast-align -Wno-uninitialized')
 	if Params.g_options.gcov:
@@ -102,7 +102,6 @@ def configure(conf):
 		conf.env.append_value('CXXFLAGS', '-fprofile-arcs')
 		conf.env.append_value('CXXFLAGS', '-ftest-coverage')
 		conf.env.append_value('LINKFLAGS', '-fprofile-arcs')
-
 	if Params.g_options.gprof:
 		conf.env.append_value('CFLAGS', '-fprofile-arcs -ftest-coverage')
 
commit 572ff68ab4fc8bc754d92ed2d80631a7133f174b
Author: Daniel Svensson <dsvensson at gmail.com>
Date:   Mon Nov 12 23:50:59 2007 +0100

    Only build pk-reference.html if DOCBOOK_DOCS_ENABLED is 1

diff --git a/docs/wscript_build b/docs/wscript_build
index 34aee40..4e4629f 100644
--- a/docs/wscript_build
+++ b/docs/wscript_build
@@ -18,11 +18,13 @@ install_files('DATADIR', doc_subdir, 'pk-structure.png')
 install_files('DATADIR', doc_subdir, 'docbook.css')
 
 # xmlto html-nochunks -m config.xsl pk-reference.xml
-cmd = bld.create_obj('command-output')
-cmd.hidden_outputs = 'pk-reference.html'
-cmd.command = 'xmlto'
-cmd.command_is_external = True
-cmd.cwd = cmd.input_dir('.') # xmlto is stupid, doesn't work from outside the xml source dir :(
-cmd.argv = ['html-nochunks', '-m', cmd.input_file('config.xsl'),
-            '--searchpath', cmd.input_dir('.'), '-o', cmd.output_dir('.'),
-            cmd.input_file('pk-reference.xml')]
+env = bld.env()
+if env['DOCBOOK_DOCS_ENABLED']:
+	cmd = bld.create_obj('command-output')
+	cmd.hidden_outputs = 'pk-reference.html'
+	cmd.command = 'xmlto'
+	cmd.command_is_external = True
+	cmd.cwd = cmd.input_dir('.') # xmlto is stupid, doesn't work from outside the xml source dir :(
+	cmd.argv = ['html-nochunks', '-m', cmd.input_file('config.xsl'),
+				'--searchpath', cmd.input_dir('.'), '-o', cmd.output_dir('.'),
+				cmd.input_file('pk-reference.xml')]



More information about the PackageKit mailing list