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

Richard Hughes hughsient at kemper.freedesktop.org
Sun Nov 11 01:37:18 PST 2007


 backends/apt/wscript               |    2 -
 backends/wscript                   |    2 -
 backends/yum/helpers/yumBackend.py |    7 ++++++
 backends/yum/wscript               |    2 -
 configure.ac                       |    2 -
 docs/wscript_build                 |   17 +++++++++++++++
 etc/wscript_build                  |    4 +--
 libpackagekit/pk-enum-list.c       |    6 +++++
 libpackagekit/pk-enum-list.h       |    1 
 libpackagekit/wscript_build        |   33 +++++++++++++++++++++++++++---
 policy/packagekit.policy           |    4 +--
 policy/wscript_build               |    4 +--
 src/pk-security-polkit.c           |   13 ++++++++----
 src/wscript_build                  |   40 +++++++++++++++++++++++++++++++------
 wscript                            |   21 +++++++++----------
 15 files changed, 124 insertions(+), 34 deletions(-)

New commits:
commit 9634045045b3d98d3155b7fcae5dff91eb913435
Merge: 5f5780f... 05241ce...
Author: Richard Hughes <richard at hughsie.com>
Date:   Sun Nov 11 09:31:52 2007 +0000

    Merge branch 'master' of git+ssh://hughsie@git.packagekit.org/srv/git/PackageKit

commit 05241ce15c58bba39e7ca5447921c8d6a67b733b
Author: Grzegorz Dabrowski <gdx at o2.pl>
Date:   Sun Nov 11 10:13:24 2007 +0000

    free memory in case of dbus error

diff --git a/src/pk-security-polkit.c b/src/pk-security-polkit.c
index 68a8253..507a75b 100644
--- a/src/pk-security-polkit.c
+++ b/src/pk-security-polkit.c
@@ -79,6 +79,7 @@ pk_security_can_do_action (PkSecurity *security, const gchar *dbus_sender, const
 		if (dbus_error_is_set (&dbus_error)) {
 			pk_warning ("error: polkit_caller_new_from_dbus_name(): %s: %s\n",
 				    dbus_error.name, dbus_error.message);
+			dbus_error_free (&dbus_error);
 		}
 		return POLKIT_RESULT_NO;
 	}
@@ -206,7 +207,10 @@ pk_security_init (PkSecurity *security)
 	dbus_error_init (&dbus_error);
 	security->priv->connection = dbus_bus_get (DBUS_BUS_SYSTEM, &dbus_error);
 	if (security->priv->connection == NULL) {
-		pk_warning ("failed to get system connection %s: %s\n", dbus_error.name, dbus_error.message);
+		if (dbus_error_is_set (&dbus_error)) {
+			pk_warning ("failed to get system connection %s: %s\n", dbus_error.name, dbus_error.message);
+			dbus_error_free (&dbus_error);
+		}
 	}
 
 	/* get PolicyKit context */
commit 5f5780fe56a064b12c59dd67fe1c77cbedd3ed5a
Author: Richard Hughes <richard at hughsie.com>
Date:   Sat Nov 10 19:53:34 2007 +0000

    yum has no more configure checks

diff --git a/backends/yum/wscript b/backends/yum/wscript
index 051a4bc..65c1dae 100644
--- a/backends/yum/wscript
+++ b/backends/yum/wscript
@@ -13,7 +13,7 @@ def configure(conf):
 		return False
 
 	# Additional checks required
-	return False
+	return True
 
 def set_options(opt):
 	pass
commit 2615a3ab58318072683ef88b249918f0c8a87c83
Author: Richard Hughes <richard at hughsie.com>
Date:   Sat Nov 10 19:39:06 2007 +0000

    mark out status as QUERY when we have finished setting up the yum transaction so we get the correct icon

diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index 3856a20..0322b6d 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -368,6 +368,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         self.percentage(None)
 
         searchlist = ['name']
+        self.status(STATUS_QUERY)
         self._do_search(searchlist, filters, key)
 
     def search_details(self,filters,key):
@@ -378,6 +379,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         self.percentage(None)
 
         searchlist = ['name', 'summary', 'description', 'group']
+        self.status(STATUS_QUERY)
         self._do_search(searchlist, filters, key)
 
     def _buildGroupDict(self):
@@ -406,6 +408,8 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         self.percentage(None)
         self.yumbase.doConfigSetup(errorlevel=0,debuglevel=0)# Setup Yum Config
         self.yumbase.conf.cache = 1 # Only look in cache.
+        self.status(STATUS_QUERY)
+
         try:
             pkgGroupDict = self._buildGroupDict()
             self.yumbase.conf.cache = 1 # Only look in cache.
@@ -443,6 +447,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         '''
         self.allow_interrupt(True)
         self.percentage(None)
+        self.status(STATUS_QUERY)
 
         #self.yumbase.conf.cache = 1 # Only look in cache.
         fltlist = filters.split(';')
@@ -507,6 +512,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         '''
         self.allow_interrupt(True)
         self.percentage(None)
+        self.status(STATUS_QUERY)
         name = package.split(';')[0]
         pkg,inst = self._findPackage(package)
         pkgs = self.yumbase.rpmdb.searchRequires(pkg.name)
@@ -597,6 +603,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         '''
         self.allow_interrupt(True)
         self.percentage(None)
+        self.status(STATUS_QUERY)
 
         name = package.split(';')[0]
         pkg,inst = self._findPackage(package)
commit 0d8ebe60042ae830facbe6cd1303a58057c53e34
Author: Richard Hughes <richard at hughsie.com>
Date:   Sat Nov 10 19:28:30 2007 +0000

    add another PkEnumList type

diff --git a/libpackagekit/pk-enum-list.c b/libpackagekit/pk-enum-list.c
index a2e27db..5bb164a 100644
--- a/libpackagekit/pk-enum-list.c
+++ b/libpackagekit/pk-enum-list.c
@@ -147,6 +147,8 @@ pk_enum_list_from_string (PkEnumList *elist, const gchar *enums)
 			value_temp = pk_group_enum_from_text (sections[i]);
 		} else if (elist->priv->type == PK_ENUM_LIST_TYPE_FILTER) {
 			value_temp = pk_filter_enum_from_text (sections[i]);
+		} else if (elist->priv->type == PK_ENUM_LIST_TYPE_STATUS) {
+			value_temp = pk_status_enum_from_text (sections[i]);
 		} else {
 			pk_error ("unknown type %i (did you use pk_enum_list_set_type?)", elist->priv->type);
 		}
@@ -173,6 +175,8 @@ pk_enum_list_get_item_text (PkEnumList *elist, guint value)
 		text = pk_group_enum_to_text (value);
 	} else if (elist->priv->type == PK_ENUM_LIST_TYPE_FILTER) {
 		text = pk_filter_enum_to_text (value);
+	} else if (elist->priv->type == PK_ENUM_LIST_TYPE_STATUS) {
+		text = pk_status_enum_to_text (value);
 	} else {
 		pk_warning ("unknown type %i (did you use pk_enum_list_set_type?)", elist->priv->type);
 	}
@@ -243,6 +247,8 @@ pk_enum_list_print (PkEnumList *elist)
 		g_print ("Printing groups:\n");
 	} else if (elist->priv->type == PK_ENUM_LIST_TYPE_FILTER) {
 		g_print ("Printing filters:\n");
+	} else if (elist->priv->type == PK_ENUM_LIST_TYPE_STATUS) {
+		g_print ("Printing status:\n");
 	}
 	for (i=0; i<elist->priv->data->len; i++) {
 		value = GPOINTER_TO_UINT (g_ptr_array_index (elist->priv->data, i));
diff --git a/libpackagekit/pk-enum-list.h b/libpackagekit/pk-enum-list.h
index 5320c21..2d00962 100644
--- a/libpackagekit/pk-enum-list.h
+++ b/libpackagekit/pk-enum-list.h
@@ -50,6 +50,7 @@ typedef enum {
 	PK_ENUM_LIST_TYPE_ROLE,
 	PK_ENUM_LIST_TYPE_GROUP,
 	PK_ENUM_LIST_TYPE_FILTER,
+	PK_ENUM_LIST_TYPE_STATUS,
 	PK_ENUM_LIST_TYPE_UNKNOWN
 } PkEnumListType;
 
diff --git a/wscript b/wscript
index 34b14cf..8b65503 100644
--- a/wscript
+++ b/wscript
@@ -19,7 +19,7 @@ APPNAME='PackageKit'
 
 # these variables are mandatory ('/' are converted automatically)
 srcdir = '.'
-blddir = 'build'
+blddir = '_build_'
 
 def set_options(opt):
 	opt.add_option('--wall', action="store_true", help="stop on compile warnings", dest="wall", default=True)
commit 732cf0a0fc40244ddaa7599d34f944fb8fb8992f
Author: Daniel Svensson <dsvensson at gmail.com>
Date:   Sat Nov 10 20:02:04 2007 +0100

    Use bld.env() instead of bld.env_of_name('default')

diff --git a/backends/apt/wscript b/backends/apt/wscript
index 8012736..20ac390 100644
--- a/backends/apt/wscript
+++ b/backends/apt/wscript
@@ -10,7 +10,7 @@ def build(bld):
 	obj.install_var = 'LIBDIR'
 	obj.install_subdir = 'packagekit-backend'
 
-	env = bld.env_of_name('default')
+	env = bld.env()
 	if env['APT_SEARCH_PLAIN']:
 		obj.source += ' pk-apt-search-plain.c'
 
diff --git a/backends/wscript b/backends/wscript
index 18984ec..1f1d5f4 100644
--- a/backends/wscript
+++ b/backends/wscript
@@ -1,7 +1,7 @@
 import Params
 
 def build(bld):
-	env = bld.env_of_name('default')
+	env = bld.env()
 	bld.add_subdirs(env['DEFAULT_BACKEND'])
 
 def configure(conf):
diff --git a/libpackagekit/wscript_build b/libpackagekit/wscript_build
index fa6f5a7..44e7f2e 100644
--- a/libpackagekit/wscript_build
+++ b/libpackagekit/wscript_build
@@ -37,7 +37,7 @@ libpackagekit.source = """
 # 		built with previous versions of this library. Don't use.
 libpackagekit.vnum='3.0.0'
 
-defines = bld.env_of_name('default')['defines']
+defines = bld.env()['defines']
 if defines.get('PK_BUILD_NETWORKMANAGER', False):
     libpackagekit.uselib += ' NM_GLIB'
     libpackagekit.source += '''
diff --git a/src/wscript_build b/src/wscript_build
index 26e9b38..d7e65ca 100644
--- a/src/wscript_build
+++ b/src/wscript_build
@@ -26,7 +26,7 @@ pk-transaction-id.c
 pk-transaction-list.c
 '''
 
-defines = bld.env_of_name('default')['defines']
+defines = bld.env()['defines']
 
 obj.includes='. ../libpackagekit ../libselftest'
 obj.uselib='DBUS_GLIB GMODULE SQLITE GTHREAD'
commit dbde6547199980bb2dfb9e791e447c6375d5cf0c
Author: Richard Hughes <richard at hughsie.com>
Date:   Sat Nov 10 18:20:46 2007 +0000

    more stub waf stuff

diff --git a/docs/wscript_build b/docs/wscript_build
new file mode 100644
index 0000000..0a772fa
--- /dev/null
+++ b/docs/wscript_build
@@ -0,0 +1,17 @@
+#! /usr/bin/env python
+# encoding: utf-8
+#
+# Copyright (C) 2007 Richard Hughes <richard at hughsie.com>
+#
+# Licensed under the GNU General Public License Version 2
+# 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.
+
+# TODO: we want to build this using xmlto, i.e. doxmlto html-nochunks -m config.xsl pk-reference.xml
+
+install_files('DATADIR', 'APPNAME/docs', 'pk-reference.html')
+install_files('DATADIR', 'APPNAME/docs', 'pk-structure.png')
+install_files('DATADIR', 'APPNAME/docs', 'docbook.css')
+
diff --git a/libpackagekit/wscript_build b/libpackagekit/wscript_build
index 6683d6d..fa6f5a7 100644
--- a/libpackagekit/wscript_build
+++ b/libpackagekit/wscript_build
@@ -1,4 +1,13 @@
-#!/usr/bin/python
+#! /usr/bin/env python
+# encoding: utf-8
+#
+# Copyright (C) 2007 Richard Hughes <richard at hughsie.com>
+#
+# Licensed under the GNU General Public License Version 2
+# 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.
 
 #Marshall file
 libpackagekit = bld.create_obj('gnome', 'shlib')
diff --git a/wscript b/wscript
index 0b8e946..34b14cf 100644
--- a/wscript
+++ b/wscript
@@ -14,7 +14,7 @@ import Params
 import misc
 
 # the following two variables are used by the target "waf dist"
-VERSION='0.1.3'
+VERSION='0.1.4'
 APPNAME='PackageKit'
 
 # these variables are mandatory ('/' are converted automatically)
@@ -84,10 +84,6 @@ 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'))
 
-	#TODO: can we define these here?
-	#AC_SUBST(PK_PLUGIN_CFLAGS, "-I\$(top_srcdir)/src -I\$(top_srcdir)/libpackagekit $GLIB_CFLAGS $DBUS_CFLAGS $GMODULE_CFLAGS")
-	#AC_SUBST(PK_PLUGIN_LIBS, "$GLIB_LIBS $DBUS_LIBS $GMODULE_LIBS")
-
 	conf.env.append_value('CCFLAGS', '-DHAVE_CONFIG_H')
 	conf.write_config_header('config.h')
 
@@ -104,13 +100,14 @@ def configure(conf):
 def build(bld):
 	# process subfolders from here
 	# Pending dirs:
-	#  docs man python
-        bld.add_subdirs('libpackagekit backends client libgbus libselftest etc policy po data src')
+	#  man python
+        bld.add_subdirs('libpackagekit backends client libgbus libselftest etc policy po data src docs')
 
 	#set the user in packagekit.pc.in and install
 	obj=bld.create_obj('subst')
 	obj.source = 'packagekit.pc.in'
 	obj.target = 'packagekit.pc'
+	#TODO: set these correctly
 	obj.dict = {'VERSION': 'dave', 'prefix':'PREFIX', 'exec_prefix':'PREFIX', 'libdir':'usr/lib', 'includedir':'usr/include'}
 	obj.fun = misc.subst_func
 	obj.install_var = 'PREFIX'
commit eeb965a0d9edcf4d65d9534edaf62b7b187a031d
Author: Richard Hughes <richard at hughsie.com>
Date:   Sat Nov 10 18:08:55 2007 +0000

    add libtool versioning for libpackagekit

diff --git a/libpackagekit/wscript_build b/libpackagekit/wscript_build
index c9c59ff..6683d6d 100644
--- a/libpackagekit/wscript_build
+++ b/libpackagekit/wscript_build
@@ -6,7 +6,6 @@ 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 = """
 	pk-debug.c
 	pk-connection.c
@@ -21,6 +20,14 @@ libpackagekit.source = """
 	pk-polkit-client.c
 """
 
+# 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'
+
 defines = bld.env_of_name('default')['defines']
 if defines.get('PK_BUILD_NETWORKMANAGER', False):
     libpackagekit.uselib += ' NM_GLIB'
commit b601475c3c192875241902e016ac7139c8cb2c6b
Author: Richard Hughes <richard at hughsie.com>
Date:   Sat Nov 10 17:36:23 2007 +0000

    use different permissions for update-system and update-package

diff --git a/policy/packagekit.policy b/policy/packagekit.policy
index 2c27827..05e76fa 100644
--- a/policy/packagekit.policy
+++ b/policy/packagekit.policy
@@ -27,7 +27,7 @@ Copyright (c) 2007 Richard Hughes <richard at hughsie.com>
     </defaults>
   </action>
 
-  <action id="org.freedesktop.packagekit.update">
+  <action id="org.freedesktop.packagekit.update-package">
     <description>Update package</description>
     <message>System policy prevents updating package</message>
     <defaults>
@@ -45,7 +45,7 @@ Copyright (c) 2007 Richard Hughes <richard at hughsie.com>
     </defaults>
   </action>
 
-  <action id="org.freedesktop.packagekit.update">
+  <action id="org.freedesktop.packagekit.update-system">
     <description>Update all packages on system</description>
     <message>System policy prevents updating system</message>
     <defaults>
diff --git a/src/pk-security-polkit.c b/src/pk-security-polkit.c
index 15816ff..68a8253 100644
--- a/src/pk-security-polkit.c
+++ b/src/pk-security-polkit.c
@@ -103,9 +103,10 @@ pk_security_role_to_action (PkSecurity *security, PkRoleEnum role)
 	g_return_val_if_fail (security != NULL, NULL);
 	g_return_val_if_fail (PK_IS_SECURITY (security), NULL);
 
-	if (role == PK_ROLE_ENUM_UPDATE_PACKAGE ||
-	    role == PK_ROLE_ENUM_UPDATE_SYSTEM) {
-		policy = "org.freedesktop.packagekit.update";
+	if (role == PK_ROLE_ENUM_UPDATE_PACKAGE) {
+		policy = "org.freedesktop.packagekit.update-package";
+	} else if (role == PK_ROLE_ENUM_UPDATE_SYSTEM) {
+		policy = "org.freedesktop.packagekit.update-system";
 	} else if (role == PK_ROLE_ENUM_REMOVE_PACKAGE) {
 		policy = "org.freedesktop.packagekit.remove";
 	} else if (role == PK_ROLE_ENUM_INSTALL_PACKAGE) {
commit c077f99c44612ad4f9c42348fb48b0ed427ea132
Author: Richard Hughes <richard at hughsie.com>
Date:   Sat Nov 10 17:10:54 2007 +0000

    add stub code to generate the gprof output

diff --git a/src/wscript_build b/src/wscript_build
index 6fc1d01..26e9b38 100644
--- a/src/wscript_build
+++ b/src/wscript_build
@@ -56,10 +56,17 @@ install_files('PREFIX', 'include/packagekit-backends', '''
 	pk-backend-python.h
 ''')
 
+import Runner, Common
 
-#TODO: if Params.g_options.gcov then we need to execute $(top_srcdir)/tools/create-coverage-report.sh packagekit $(filter %.c,$(packagekitd_SOURCES)) > gcov.txt
+#create and process the gcov output, TODO: pipe to a file
+if Params.g_options.gcov:
+	command = '../tools/create-coverage-report.sh packagekit %s' % obj.source
+	ret = Runner.exec_command(command)
 
-#TODO: if Params.g_options.gprof then we need to execute gprof .libs/pk-self-test > gprof.txt
+#create gprof output, TODO: pipe to a file
+if Params.g_options.gprof:
+	command = 'gprof .libs/pk-self-test'
+	ret = Runner.exec_command(command)
 
 #TODO: if Params.g_options.tests then add the self test program: pk-self-test.c and all the libs above and execute the pk-self-test application
 
commit 079b505795812ec406b15f93765fced555494f5f
Author: Richard Hughes <richard at hughsie.com>
Date:   Sat Nov 10 17:01:03 2007 +0000

    add extra libraries for polkit

diff --git a/src/wscript_build b/src/wscript_build
index a094c3e..6fc1d01 100644
--- a/src/wscript_build
+++ b/src/wscript_build
@@ -28,17 +28,6 @@ pk-transaction-list.c
 
 defines = bld.env_of_name('default')['defines']
 
-if defines.get('SECURITY_TYPE_POLKIT', False):
-    obj.source += '''
-	pk-security-polkit.c
-'''
-
-if defines.get('SECURITY_TYPE_DUMMY', False):
-    obj.source += '''
-	pk-security-dummy.c
-'''
-
-
 obj.includes='. ../libpackagekit ../libselftest'
 obj.uselib='DBUS_GLIB GMODULE SQLITE GTHREAD'
 obj.uselib_local = 'libpackagekit'
@@ -50,8 +39,16 @@ obj.add_marshal_file('pk-marshal.list', 'pk_marshal', '--body')
 #obj.env.append_value('CCDEFINES', 'LOCALSTATEDIR="%s"' % obj.env['LOCALSTATEDIR'])
 obj.env.append_value('CCDEFINES', 'DATABASEDIR=PK_DB_DIR')
 
+if defines.get('SECURITY_TYPE_POLKIT', False):
+    obj.uselib += ' POLKIT_DBUS'
+    obj.source += '''
+	pk-security-polkit.c
+'''
 
-#TODO: if SECURITY_TYPE_POLKIT then obj.source needs to have pk-security-polkit.c added else pk-security-dummy.c
+if defines.get('SECURITY_TYPE_DUMMY', False):
+    obj.source += '''
+	pk-security-dummy.c
+'''
 
 # install backend headers to /usr/include/packagekit-backends/
 install_files('PREFIX', 'include/packagekit-backends', '''
commit 74eb4c4b5cb85bda0d19d997c61abbcbda7cda83
Author: Richard Hughes <richard at hughsie.com>
Date:   Sat Nov 10 16:45:52 2007 +0000

    use NM_GLIB when we are using NetworkManager

diff --git a/libpackagekit/wscript_build b/libpackagekit/wscript_build
index 7dd8db7..c9c59ff 100644
--- a/libpackagekit/wscript_build
+++ b/libpackagekit/wscript_build
@@ -23,6 +23,7 @@ libpackagekit.source = """
 
 defines = bld.env_of_name('default')['defines']
 if defines.get('PK_BUILD_NETWORKMANAGER', False):
+    libpackagekit.uselib += ' NM_GLIB'
     libpackagekit.source += '''
 	pk-network-nm.c
 '''
commit 39dcdaf64f35ea8d780493301585a21ec1f72d99
Merge: b9444ec... 3b9b13f...
Author: Gustavo Carneiro <gjc at nazgul.(none)>
Date:   Sat Nov 10 16:19:40 2007 +0000

    Merge git+ssh://gjc@git.packagekit.org/srv/git/PackageKit
    
    Conflicts:
    
    	backends/apt/wscript
    	libpackagekit/wscript_build

commit b9444ec64009819c36b521cf4d0c83b05b58ede7
Author: Gustavo Carneiro <gjc at nazgul.(none)>
Date:   Sat Nov 10 16:14:04 2007 +0000

    Make the daemon build (src)

diff --git a/libpackagekit/wscript_build b/libpackagekit/wscript_build
index 0dc9a51..7dd8db7 100644
--- a/libpackagekit/wscript_build
+++ b/libpackagekit/wscript_build
@@ -6,7 +6,6 @@ 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.target = 'packagekit'
 
 libpackagekit.source = """
 	pk-debug.c
@@ -22,6 +21,17 @@ libpackagekit.source = """
 	pk-polkit-client.c
 """
 
+defines = bld.env_of_name('default')['defines']
+if defines.get('PK_BUILD_NETWORKMANAGER', False):
+    libpackagekit.source += '''
+	pk-network-nm.c
+'''
+else:
+    libpackagekit.source += '''
+	pk-network-dummy.c
+'''
+
+
 libpackagekit.includes      = '. ../libgbus ../libselftest'
 libpackagekit.target        = 'packagekit'
 libpackagekit.name          = 'libpackagekit'
diff --git a/src/wscript_build b/src/wscript_build
index 6be6a2f..a094c3e 100644
--- a/src/wscript_build
+++ b/src/wscript_build
@@ -25,16 +25,40 @@ pk-transaction-db.c
 pk-transaction-id.c
 pk-transaction-list.c
 '''
-obj.includes='.'
-obj.uselib='DBUS_GLIB'
+
+defines = bld.env_of_name('default')['defines']
+
+if defines.get('SECURITY_TYPE_POLKIT', False):
+    obj.source += '''
+	pk-security-polkit.c
+'''
+
+if defines.get('SECURITY_TYPE_DUMMY', False):
+    obj.source += '''
+	pk-security-dummy.c
+'''
+
+
+obj.includes='. ../libpackagekit ../libselftest'
+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'])
+obj.env.append_value('CCDEFINES', 'DATABASEDIR=PK_DB_DIR')
+
 
 #TODO: if SECURITY_TYPE_POLKIT then obj.source needs to have pk-security-polkit.c added else pk-security-dummy.c
 
-#TODO: Need to 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: if Params.g_options.gcov then we need to execute $(top_srcdir)/tools/create-coverage-report.sh packagekit $(filter %.c,$(packagekitd_SOURCES)) > gcov.txt
 
diff --git a/wscript b/wscript
index 871ce44..0b8e946 100644
--- a/wscript
+++ b/wscript
@@ -55,6 +55,7 @@ def configure(conf):
 		print "*******************************************************************"
 		print "** YOU ARE NOT USING A SECURE DAEMON. ALL USERS CAN DO ANYTHING! **"
 		print "*******************************************************************"
+		conf.add_define('SECURITY_TYPE_DUMMY', 1)
 
 	#optional deps
 	if conf.check_pkg('libnm_glib', destvar='NM_GLIB', vnum='0.6.4'):
@@ -104,7 +105,7 @@ def build(bld):
 	# process subfolders from here
 	# Pending dirs:
 	#  docs man python
-        bld.add_subdirs('libpackagekit backends client libgbus libselftest etc policy po data')
+        bld.add_subdirs('libpackagekit backends client libgbus libselftest etc policy po data src')
 
 	#set the user in packagekit.pc.in and install
 	obj=bld.create_obj('subst')
commit 3b9b13fa83011c02abf6ffb5ebfe3a1db0a089c4
Author: Richard Hughes <richard at hughsie.com>
Date:   Sat Nov 10 15:57:58 2007 +0000

    post release version bump to 0.1.4

diff --git a/configure.ac b/configure.ac
index 20ed960..e507913 100755
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
 AC_PREREQ(2.52)
 
-AC_INIT(PackageKit, 0.1.3)
+AC_INIT(PackageKit, 0.1.4)
 AC_CONFIG_SRCDIR(src)
 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
 AM_CONFIG_HEADER(config.h)
commit 7c96ed73daed1bee4cd6285f58918e3b0bc99127
Author: Gustavo Carneiro <gjc at nazgul.(none)>
Date:   Sat Nov 10 15:13:58 2007 +0000

    Install to SYSCONFDIR instead of PREFIX/etc

diff --git a/etc/wscript_build b/etc/wscript_build
index ce0e0ef..8fdc336 100644
--- a/etc/wscript_build
+++ b/etc/wscript_build
@@ -18,6 +18,6 @@ obj.target = 'PackageKit.conf'
 #TODO: need to get this from wscript
 obj.dict = {'defaultbackend': 'default_backend'}
 obj.fun = misc.subst_func
-obj.install_var = 'PREFIX'
-obj.install_subdir = 'etc/PackageKit'
+obj.install_var = 'SYSCONFDIR'
+obj.install_subdir = 'PackageKit'
 
commit 3fff5c8adc7858d2f05b7174e7276ade5aab0666
Author: Gustavo Carneiro <gjc at nazgul.(none)>
Date:   Sat Nov 10 15:09:34 2007 +0000

    Expand PK_* variables to make them prefix dependent.

diff --git a/wscript b/wscript
index 537e35c..871ce44 100644
--- a/wscript
+++ b/wscript
@@ -77,10 +77,11 @@ def configure(conf):
 	conf.add_define('GETTEXT_PACKAGE', 'PackageKit')
 	conf.add_define('PACKAGE', 'PackageKit')
 
-	#TODO: expand these into PREFIX and something recognised by waf
-	conf.add_define('PK_CONF_DIR', '/etc/PackageKit')
-	conf.add_define('PK_DB_DIR', '/var/lib/PackageKit')
-	conf.add_define('PK_PLUGIN_DIR', '/usr/lib/packagekit-backend')
+        assert conf.env['SYSCONFDIR'], "You have too old WAF; please update to trunk"
+
+	conf.add_define('PK_CONF_DIR', os.path.join(conf.env['SYSCONFDIR'], 'PackageKit'))
+	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'))
 
 	#TODO: can we define these here?
 	#AC_SUBST(PK_PLUGIN_CFLAGS, "-I\$(top_srcdir)/src -I\$(top_srcdir)/libpackagekit $GLIB_CFLAGS $DBUS_CFLAGS $GMODULE_CFLAGS")
commit cf818aa1a5738c2cc774379263d87a0fda420ede
Author: Gustavo Carneiro <gjc at nazgul.(none)>
Date:   Sat Nov 10 14:45:50 2007 +0000

    install the packagekit.policy file to /usr/share/PolicyKit/policy

diff --git a/policy/wscript_build b/policy/wscript_build
index a6d7f76..d1fe681 100644
--- a/policy/wscript_build
+++ b/policy/wscript_build
@@ -9,5 +9,5 @@
 # the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 
-#TODO: install the packagekit.policy file to /usr/share/PolicyKit/policy
-
+#install the packagekit.policy file to /usr/share/PolicyKit/policy
+install_files('DATADIR', 'PolicyKit', 'packagekit.policy')
commit e9a9428177777d870c17eb7f654b16e2945ef7ae
Merge: 7526103... e53eaa9...
Author: Gustavo Carneiro <gjc at nazgul.(none)>
Date:   Sat Nov 10 14:20:04 2007 +0000

    Merge git://anongit.freedesktop.org/git/packagekit
    
    Conflicts:
    
    	data/wscript_build

commit 75261032089d63661e5ea87c0474cd27c51932ff
Author: Gustavo Carneiro <gjc at nazgul.(none)>
Date:   Sat Nov 10 13:12:21 2007 +0000

    Install the pk_backend_apt plugin.

diff --git a/backends/apt/wscript b/backends/apt/wscript
index fcce0cf..c218aca 100644
--- a/backends/apt/wscript
+++ b/backends/apt/wscript
@@ -7,6 +7,9 @@ def build(bld):
 	obj.uselib = 'APT'
 	obj.uselib_local = 'libpackagekit'
 	obj.includes = '../../src ../../libpackagekit'
+        obj.install_var = 'LIBDIR'
+        obj.install_subdir = 'packagekit-backend'
+        
 
 	env = bld.env_of_name('default')
 	if env['APT_SEARCH_PLAIN']:
commit 169b499c1c1b198cbc8614c6ce0301af13be036d
Author: Gustavo Carneiro <gjc at nazgul.(none)>
Date:   Sat Nov 10 13:11:36 2007 +0000

    Fix install_files() parameters.

diff --git a/data/wscript_build b/data/wscript_build
index 43af4a2..4d3e240 100644
--- a/data/wscript_build
+++ b/data/wscript_build
@@ -22,7 +22,6 @@ obj.fun = misc.subst_func
 obj.install_var = 'PREFIX'
 obj.install_subdir = 'usr/share/dbus-1/system-services'
 
-#TODO: install properly
-install_files('var', 'run', 'PackageKit', 'job_count.dat')
-install_files('var', 'lib', 'PackageKit', 'transactions.db')
+install_files('PREFIX', 'var/run/PackageKit', 'job_count.dat')
+install_files('PREFIX', 'var/lib/PackageKit', 'transactions.db')
 
commit a5300cad9ac72acc2e024d68c38fd2f56406e30d
Author: Gustavo Carneiro <gjc at nazgul.(none)>
Date:   Sat Nov 10 12:51:08 2007 +0000

    install headers to /usr/include/packagekit/

diff --git a/libpackagekit/wscript_build b/libpackagekit/wscript_build
index 2c4cca9..0dc9a51 100644
--- a/libpackagekit/wscript_build
+++ b/libpackagekit/wscript_build
@@ -26,7 +26,22 @@ libpackagekit.includes      = '. ../libgbus ../libselftest'
 libpackagekit.target        = 'packagekit'
 libpackagekit.name          = 'libpackagekit'
 
-#TODO: Need to install headers to /usr/include/packagekit/
+# install headers to /usr/include/packagekit/
+install_files('PREFIX', 'include/packagekit',"""
+	pk-debug.h
+	pk-connection.h
+	pk-network.h
+	pk-package-id.h
+	pk-package-list.h
+	pk-enum-list.h
+	pk-enum.h
+	pk-common.h
+	pk-client.h
+	pk-task-list.h
+	pk-job-list.h
+	pk-polkit-client.h
+""")
+
 
 #TODO: if Params.g_options.tests then add the self test program: pk-self-test.c and all the libs above and execute the pk-self-test application
 
commit 7aa2dd0a23e526dd6e02fa5de55486ca6c821bd1
Author: Gustavo Carneiro <gjc at nazgul.(none)>
Date:   Sat Nov 10 12:40:27 2007 +0000

    Build libgbus and libselftest as objects, not static library; also build with -fPIC, otherwise it won't link on x86_64.

diff --git a/libgbus/wscript_build b/libgbus/wscript_build
index a87c85f..130cd09 100644
--- a/libgbus/wscript_build
+++ b/libgbus/wscript_build
@@ -1,7 +1,8 @@
 #!/usr/bin/python
 
 #Marshall file
-libgbus = bld.create_obj('gnome', 'staticlib')
+libgbus = bld.create_obj('gnome', 'objects')
+libgbus.env.append_value('CCFLAGS', libgbus.env['shlib_CCFLAGS'])
 libgbus.add_marshal_file('libgbus-marshal.list', 'libgbus_marshal', '--header')
 libgbus.add_marshal_file('libgbus-marshal.list', 'libgbus_marshal', '--body')
 libgbus.uselib = 'GLIB GOBJECT DBUS DBUS_GLIB'
@@ -11,5 +12,5 @@ libgbus.source = """
 """
 
 libgbus.includes = '.'
-libgbus.target   = 'libgbus'
+#libgbus.target   = 'libgbus'
 libgbus.name     = 'libgbus'
diff --git a/libpackagekit/wscript_build b/libpackagekit/wscript_build
index 9aa3a62..2c4cca9 100644
--- a/libpackagekit/wscript_build
+++ b/libpackagekit/wscript_build
@@ -5,7 +5,7 @@ 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.uselib_local = 'libgbus libselftest'
+libpackagekit.add_objects = 'libgbus libselftest'
 libpackagekit.target = 'packagekit'
 
 libpackagekit.source = """
@@ -23,7 +23,7 @@ libpackagekit.source = """
 """
 
 libpackagekit.includes      = '. ../libgbus ../libselftest'
-libpackagekit.target        = 'libpackagekit'
+libpackagekit.target        = 'packagekit'
 libpackagekit.name          = 'libpackagekit'
 
 #TODO: Need to install headers to /usr/include/packagekit/
diff --git a/libselftest/wscript_build b/libselftest/wscript_build
index ec4d805..b76ba8c 100644
--- a/libselftest/wscript_build
+++ b/libselftest/wscript_build
@@ -1,7 +1,9 @@
 #!/usr/bin/python
 
 #Marshall file
-libselftest = bld.create_obj('gnome', 'staticlib')
+libselftest = bld.create_obj('gnome', 'objects')
+libselftest.env.append_value('CCFLAGS', libselftest.env['shlib_CCFLAGS'])
+
 libselftest.uselib = 'GLIB GOBJECT'
 
 libselftest.source = """
@@ -9,5 +11,5 @@ libselftest.source = """
 """
 
 libselftest.includes = '.'
-libselftest.target   = 'libselftest'
+#libselftest.target   = 'libselftest'
 libselftest.name     = 'libselftest'



More information about the PackageKit mailing list