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

Richard Hughes hughsient at kemper.freedesktop.org
Thu Nov 15 09:57:22 PST 2007


 AUTHORS                           |    3 +
 backends/zypp/Makefile.am         |   10 ++--
 backends/zypp/pk-backend-zypp.cpp |   86 ++++++++++----------------------------
 configure.ac                      |    6 ++
 html/pk-faq.html                  |   62 +++++++++++++--------------
 wscript                           |   29 +++++++++---
 6 files changed, 91 insertions(+), 105 deletions(-)

New commits:
commit 718bdc46eb9920f90ad60428c193575976f6ee7a
Author: Daniel Svensson <dsvensson at gmail.com>
Date:   Thu Nov 15 18:29:34 2007 +0100

    Cleanup unittest coverage report function.

diff --git a/wscript b/wscript
index d002e26..f36ff1a 100644
--- a/wscript
+++ b/wscript
@@ -148,8 +148,7 @@ def gcov_report():
 
 	os.chdir(blddir)
 
-	#for test in ['test-libpackagekit', 'test-packagekitd']:
-	for test in ['test-libpackagekit']:
+	for test in ['test-libpackagekit', 'test-packagekitd']:
 		cleanup = []
 		sources = []
 
@@ -197,8 +196,15 @@ def gcov_report():
 		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)
+		proc = subprocess.Popen(command, shell=True,
+								stdout=subprocess.PIPE,
+								stderr=subprocess.PIPE)
+		if proc.wait():
+			print 'Unable to run %s/%s!' % (testdir, test)
+			print proc.stderr.read()
+			continue
+
+		print proc.stdout.read()
 
 		# Ignore these
 		ignore = """
@@ -223,8 +229,12 @@ def gcov_report():
 		for src in sources:
 			srcpath = os.path.join(srcdir, src)
 
-			command = 'gcov -o %s %s > /dev/null' % (testdir, srcpath)
-			if subprocess.Popen(command, shell=True).wait():
+			command = 'gcov -o %s %s' % (testdir, srcpath)
+			proc = subprocess.Popen(command, shell=True,
+			                        stdout=subprocess.PIPE,
+			                        stderr=subprocess.PIPE)
+			if proc.wait():
+				print 'gcov failed when processing %s' % srcpath
 				raise SystemExit(1)
 
 			covpath = src + '.gcov'
@@ -233,6 +243,11 @@ def gcov_report():
 
 			cleanup.append(covpath)
 
+			basename, _ = os.path.splitext(src)
+			gcdaname = os.path.join(testdir, basename + '.gcda')
+			if os.path.exists(gcdaname):
+				cleanup.append(gcdaname)
+
 			not_covered = 0
 			covered = 0
 			loc = 0
@@ -251,7 +266,7 @@ def gcov_report():
 			else:
 				percent = 0
 
-			print '%30s: %7.2f%% (%d of %d)' % (covpath, percent, covered, not_covered+covered)
+			print '%30s: %7.2f%% (%d of %d)' % (src, percent, covered, not_covered+covered)
 
 			total_loc += loc
 			total_covered += covered
commit 76356dac77254f4d7b220e415bb279741ea9c58c
Author: Boyd Timothy <btimothy at gmail.com>
Date:   Thu Nov 15 09:52:14 2007 -0700

    Fix configure.ac to really set ZYPP_CFLAGS/LIBS.

diff --git a/configure.ac b/configure.ac
index 5ddc8c7..707a80b 100755
--- a/configure.ac
+++ b/configure.ac
@@ -425,7 +425,7 @@ if test x$with_default_backend = xalpm; then
 			[AC_MSG_WARN([No alpm headers found - falling back to dummy backend])])
 fi
 
-if test x$with_default_backend = zypp; then
+if test x$with_default_backend = xzypp; then
 	PKG_CHECK_MODULES(ZYPP, libzypp)
 	AC_SUBST(ZYPP_CFLAGS)
 	AC_SUBST(ZYPP_LIBS)
commit 2510369980876c630486d015d51154dc978d952a
Author: Boyd Timothy <btimothy at gmail.com>
Date:   Thu Nov 15 08:23:17 2007 -0700

    Cleaned up zypp makefile to use ZYPP_CFLAGS/LIBS from configure.ac

diff --git a/backends/zypp/Makefile.am b/backends/zypp/Makefile.am
index c5c3407..0885b55 100644
--- a/backends/zypp/Makefile.am
+++ b/backends/zypp/Makefile.am
@@ -1,10 +1,10 @@
 #SUBDIRS = helpers
 plugindir = @PK_PLUGIN_DIR@
 plugin_LTLIBRARIES = libpk_backend_zypp.la
-libpk_backend_zypp_la_SOURCES = pk-backend-zypp.cpp
+libpk_backend_zypp_la_SOURCES =		\
+	pk-backend-zypp.cpp
 libpk_backend_zypp_la_LIBADD = @PK_PLUGIN_LIBS@
-# FIXME: Do the pkg-config stuff in $top_srcdir/configure.ac
-libpk_backend_zypp_la_LDFLAGS = -module -avoid-version `pkg-config --libs libzypp`
-libpk_backend_zypp_la_CFLAGS = @PK_PLUGIN_CFLAGS@ `pkg-config --cflags libzypp`
-libpk_backend_zypp_la_CPPFLAGS = @PK_PLUGIN_CFLAGS@ `pkg-config --cflags libzypp`
+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)
 
diff --git a/backends/zypp/pk-backend-zypp.cpp b/backends/zypp/pk-backend-zypp.cpp
index 7a123a4..0377e05 100644
--- a/backends/zypp/pk-backend-zypp.cpp
+++ b/backends/zypp/pk-backend-zypp.cpp
@@ -24,58 +24,20 @@
 #include <string.h>
 #include <pk-backend.h>
 
-#include <zypp/ZYppFactory.h>
-#include <zypp/ResObject.h>
-#include <zypp/ResPoolProxy.h>
-#include <zypp/ui/Selectable.h>
-#include <zypp/Patch.h>
-#include <zypp/Selection.h>
-#include <zypp/Package.h>
-#include <zypp/Pattern.h>
-#include <zypp/Language.h>
-#include <zypp/Product.h>
-#include <zypp/Repository.h>
+//#include <zypp/ZYppFactory.h>
+//#include <zypp/ResObject.h>
+//#include <zypp/ResPoolProxy.h>
+//#include <zypp/ui/Selectable.h>
+//#include <zypp/Patch.h>
+//#include <zypp/Selection.h>
+//#include <zypp/Package.h>
+//#include <zypp/Pattern.h>
+//#include <zypp/Language.h>
+//#include <zypp/Product.h>
+//#include <zypp/Repository.h>
 #include <zypp/RepoManager.h>
 
 /**
- * backend_get_groups:
- */
-/*
-static void
-backend_get_groups (PkBackend *backend, PkEnumList *elist)
-{
-	g_return_if_fail (backend != NULL);
-	pk_enum_list_append_multiple (elist,
-				      PK_GROUP_ENUM_ACCESSORIES,
-				      PK_GROUP_ENUM_GAMES,
-				      PK_GROUP_ENUM_GRAPHICS,
-				      PK_GROUP_ENUM_INTERNET,
-				      PK_GROUP_ENUM_OFFICE,
-				      PK_GROUP_ENUM_OTHER,
-				      PK_GROUP_ENUM_PROGRAMMING,
-				      PK_GROUP_ENUM_MULTIMEDIA,
-				      PK_GROUP_ENUM_SYSTEM,
-				      -1);
-}
-*/
-
-/**
- * backend_get_filters:
- */
-/*
-static void
-backend_get_filters (PkBackend *backend, PkEnumList *elist)
-{
-	g_return_if_fail (backend != NULL);
-	pk_enum_list_append_multiple (elist,
-				      PK_FILTER_ENUM_GUI,
-				      PK_FILTER_ENUM_INSTALLED,
-				      PK_FILTER_ENUM_DEVELOPMENT,
-				      -1);
-}
-*/
-
-/**
  * backend_get_repo_list:
  */
 static void
@@ -100,28 +62,28 @@ extern "C" PK_BACKEND_OPTIONS (
 	"Boyd Timothy <btimothy at gmail.com>, Scott Reeves <sreeves at novell.com>",	/* author */
 	NULL,					/* initalize */
 	NULL,					/* destroy */
-	NULL,			/* get_groups */
-	NULL,			/* get_filters */
+	NULL,					/* get_groups */
+	NULL,					/* get_filters */
 	NULL,					/* cancel */
 	NULL,					/* get_depends */
-	NULL,		/* get_description */
+	NULL,					/* get_description */
 	NULL,					/* get_files */
 	NULL,					/* get_requires */
 	NULL,					/* get_update_detail */
-	NULL,			/* get_updates */
-	NULL,		/* install_package */
+	NULL,					/* get_updates */
+	NULL,					/* install_package */
 	NULL,					/* install_file */
-	NULL,			/* refresh_cache */
-	NULL,			/* remove_package */
+	NULL,					/* refresh_cache */
+	NULL,					/* remove_package */
 	NULL,					/* resolve */
 	NULL,					/* rollback */
-	NULL,			/* search_details */
+	NULL,					/* search_details */
 	NULL,					/* search_file */
-	NULL,			/* search_group */
-	NULL,			/* search_name */
-	NULL,			/* update_package */
-	NULL,			/* update_system */
-	backend_get_repo_list,					/* get_repo_list */
+	NULL,					/* search_group */
+	NULL,					/* search_name */
+	NULL,					/* update_package */
+	NULL,					/* update_system */
+	backend_get_repo_list,			/* get_repo_list */
 	NULL,					/* repo_enable */
 	NULL					/* repo_set_data */
 );
diff --git a/configure.ac b/configure.ac
index 7eb61fb..5ddc8c7 100755
--- a/configure.ac
+++ b/configure.ac
@@ -425,6 +425,12 @@ if test x$with_default_backend = xalpm; then
 			[AC_MSG_WARN([No alpm headers found - falling back to dummy backend])])
 fi
 
+if test x$with_default_backend = zypp; then
+	PKG_CHECK_MODULES(ZYPP, libzypp)
+	AC_SUBST(ZYPP_CFLAGS)
+	AC_SUBST(ZYPP_LIBS)
+fi
+
 AC_SUBST(PK_CONF_DIR, "\$(sysconfdir)/PackageKit")
 AC_SUBST(PK_DB_DIR, "\$(localstatedir)/lib/PackageKit")
 AC_SUBST(PK_PLUGIN_DIR, "\$(libdir)/packagekit-backend")
commit 30bbf492ae194a3e7d1bd943cbb497faf146a5a8
Author: Boyd Timothy <btimothy at gmail.com>
Date:   Thu Nov 15 08:00:40 2007 -0700

    Added zypp to html/pk-faq.html even though hardly anything is implemented.

diff --git a/AUTHORS b/AUTHORS
index 2a6628c..c43a27b 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -10,3 +10,6 @@ Backend: conary
 
 Backend: pisi
     S.Çağlar Onur <caglar at pardus.org.tr>
+
+Backend: zypp
+    Boyd Timothy <btimothy at gmail.com>
diff --git a/html/pk-faq.html b/html/pk-faq.html
index dc1850a..ea22229 100644
--- a/html/pk-faq.html
+++ b/html/pk-faq.html
@@ -20,41 +20,41 @@
 <h3>How complete are the backends?</h3>
 <h4>Methods</h4>
 <pre>
-                  | conary | yum | apt | box | alpm | smart | pisi |
---------------------------------------------------------------------
-resolve           |   X    |  X  |     |  X  |      |   X   |   X  |
-refresh-cache     |   X    |  X  |  X  |  X  |      |   X   |   X  |
-  \--force        |        |     |     |     |      |       |      |
-get-updates       |   X    |  X  |     |  X  |      |   X   |   X  |
-update-system     |   X    |  X  |     |  X  |      |   X   |   X  |
-search-name       |   X    |  X  |  X  |  X  |  X   |   X   |   X  |
-search-details    |        |  X  |  X  |  X  |      |   X   |   X  |
-search-file       |        |  X  |     |  X  |      |       |   X  |
-search-group      |        |  X  |     |     |      |       |   X  |
-install-package   |   X    |  X  |     |  X  |  X   |   X   |   X  |
-install-file      |        |  X  |     |  X  |      |   X   |   X  |
-remove-package    |   X    |  X  |     |  X  |  X   |   X   |   X  |
-update-package    |   X    |  X  |     |  X  |      |   X   |   X  |
-get-depends       |        |  X  |     |  X  |      |   X   |   X  |
-  \--recursive    |        |     |     |     |      |       |      |
-get-requires      |   X    |  X  |     |  X  |      |       |   X  |
-  \--recursive    |        |     |     |     |      |       |      |
-get-description   |   X    |  X  |  X  |  X  |      |   X   |   X  |
-get-files         |   X    |  X  |     |  X  |      |   X   |   X  |
-get-update-detail |        |  X  |     |     |      |       |      |
-get-repo-list     |        |  X  |     |  X  |  X   |   X   |   X  |
-repo-enable       |        |  X  |     |  X  |      |   X   |      |
-repo-set-data     |        |  X  |     |  X  |      |       |   X  |
-cancel-transaction|   X    |  X  |     |     |      |       |   X  |
+                  | conary | yum | apt | box | alpm | smart | pisi | zypp |
+---------------------------------------------------------------------------
+resolve           |   X    |  X  |     |  X  |      |   X   |   X  |      |
+refresh-cache     |   X    |  X  |  X  |  X  |      |   X   |   X  |      |
+  \--force        |        |     |     |     |      |       |      |      |
+get-updates       |   X    |  X  |     |  X  |      |   X   |   X  |      |
+update-system     |   X    |  X  |     |  X  |      |   X   |   X  |      |
+search-name       |   X    |  X  |  X  |  X  |  X   |   X   |   X  |      |
+search-details    |        |  X  |  X  |  X  |      |   X   |   X  |      |
+search-file       |        |  X  |     |  X  |      |       |   X  |      |
+search-group      |        |  X  |     |     |      |       |   X  |      |
+install-package   |   X    |  X  |     |  X  |  X   |   X   |   X  |      |
+install-file      |        |  X  |     |  X  |      |   X   |   X  |      |
+remove-package    |   X    |  X  |     |  X  |  X   |   X   |   X  |      |
+update-package    |   X    |  X  |     |  X  |      |   X   |   X  |      |
+get-depends       |        |  X  |     |  X  |      |   X   |   X  |      |
+  \--recursive    |        |     |     |     |      |       |      |      |
+get-requires      |   X    |  X  |     |  X  |      |       |   X  |      |
+  \--recursive    |        |     |     |     |      |       |      |      |
+get-description   |   X    |  X  |  X  |  X  |      |   X   |   X  |      |
+get-files         |   X    |  X  |     |  X  |      |   X   |   X  |      |
+get-update-detail |        |  X  |     |     |      |       |      |      |
+get-repo-list     |        |  X  |     |  X  |  X   |   X   |   X  |   X  |
+repo-enable       |        |  X  |     |  X  |      |   X   |      |      |
+repo-set-data     |        |  X  |     |  X  |      |       |   X  |      |
+cancel-transaction|   X    |  X  |     |     |      |       |   X  |      |
 </pre>
 
 <h4>Filters</h4>
 <pre>
-                  | conary | yum | apt | box | alpm | smart | pisi |
---------------------------------------------------------------------
-installed         |   X    |  X  |  X  |  X  |  X   |   X   |   X  |
-development       |        |  X  |  X  |  X  |      |       |      |
-gui               |        |  X  |  X  |  X  |      |       |   X  |
+                  | conary | yum | apt | box | alpm | smart | pisi | zypp |
+---------------------------------------------------------------------------
+installed         |   X    |  X  |  X  |  X  |  X   |   X   |   X  |      |
+development       |        |  X  |  X  |  X  |      |       |      |      |
+gui               |        |  X  |  X  |  X  |      |       |   X  |      |
 </pre>
 
 <h3>Why doesn't PackageKit work with SELinux?</h3>



More information about the PackageKit mailing list