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

Richard Hughes hughsient at kemper.freedesktop.org
Wed Sep 5 16:39:02 PDT 2007


 configure.ac         |   10 ++++++++++
 src/Makefile.am      |    6 ++++++
 src/pk-engine.c      |   10 ++++++++++
 src/pk-engine.h      |    2 ++
 src/pk-main.c        |   11 +++++++++++
 src/pk-task-apt.cpp  |    7 +++++++
 src/pk-task-box.c    |    8 ++++++++
 src/pk-task-common.c |    8 ++++++++
 src/pk-task-conary.c |    8 ++++++++
 src/pk-task-dummy.c  |    8 ++++++++
 src/pk-task-yum.c    |    8 ++++++++
 11 files changed, 86 insertions(+)

New commits:
diff-tree 75864ee38b3f0efb517f84a07bd3cc51f541f7d7 (from 4696c795bb50e696163e645a62abbf019ac5dbfd)
Author: Richard Hughes <richard at hughsie.com>
Date:   Thu Sep 6 00:38:51 2007 +0100

    add do not edit warnings as the backend compiled code will move in a few hours

diff --git a/src/pk-task-apt.cpp b/src/pk-task-apt.cpp
index fc6777e..4a9f5ed 100644
--- a/src/pk-task-apt.cpp
+++ b/src/pk-task-apt.cpp
@@ -19,6 +19,13 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+//!!!!!                                                         !!!!!!!!!
+//!!!!!   Do not edit this file! Edit backends/$backend         !!!!!!!!!
+//!!!!!                                                         !!!!!!!!!
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
 #include <apt-pkg/pkgcachegen.h>
 #include <apt-pkg/pkgcache.h>
diff --git a/src/pk-task-box.c b/src/pk-task-box.c
index d78c09b..b8c934d 100644
--- a/src/pk-task-box.c
+++ b/src/pk-task-box.c
@@ -19,6 +19,14 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+//!!!!!                                                         !!!!!!!!!
+//!!!!!   Do not edit this file! Edit backends/$backend         !!!!!!!!!
+//!!!!!                                                         !!!!!!!!!
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
 #include "config.h"
 
 #include <stdlib.h>
diff --git a/src/pk-task-common.c b/src/pk-task-common.c
index 5818399..3d9168a 100644
--- a/src/pk-task-common.c
+++ b/src/pk-task-common.c
@@ -19,6 +19,14 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+//!!!!!                                                         !!!!!!!!!
+//!!!!!   Do not edit this file! Edit backends/$backend         !!!!!!!!!
+//!!!!!                                                         !!!!!!!!!
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
 #include "config.h"
 
 #include <glib/gi18n.h>
diff --git a/src/pk-task-conary.c b/src/pk-task-conary.c
index 2c0f2f3..f44ed5d 100644
--- a/src/pk-task-conary.c
+++ b/src/pk-task-conary.c
@@ -20,6 +20,14 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+//!!!!!                                                         !!!!!!!!!
+//!!!!!   Do not edit this file! Edit backends/$backend         !!!!!!!!!
+//!!!!!                                                         !!!!!!!!!
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
 #include "config.h"
 
 #include <stdlib.h>
diff --git a/src/pk-task-dummy.c b/src/pk-task-dummy.c
index 3d5fd50..3c73530 100644
--- a/src/pk-task-dummy.c
+++ b/src/pk-task-dummy.c
@@ -19,6 +19,14 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+//!!!!!                                                         !!!!!!!!!
+//!!!!!   Do not edit this file! Edit backends/$backend         !!!!!!!!!
+//!!!!!                                                         !!!!!!!!!
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
 #include "config.h"
 
 #include <stdlib.h>
diff --git a/src/pk-task-yum.c b/src/pk-task-yum.c
index 33b3f91..e2f9537 100644
--- a/src/pk-task-yum.c
+++ b/src/pk-task-yum.c
@@ -19,6 +19,14 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+//!!!!!                                                         !!!!!!!!!
+//!!!!!   Do not edit this file! Edit backends/$backend         !!!!!!!!!
+//!!!!!                                                         !!!!!!!!!
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
 #include "config.h"
 
 #include <stdlib.h>
diff-tree 4696c795bb50e696163e645a62abbf019ac5dbfd (from ce46e424f146e64b61631f48d4037564c9ed0459)
Author: Richard Hughes <richard at hughsie.com>
Date:   Thu Sep 6 00:36:06 2007 +0100

    install the backend header

diff --git a/src/Makefile.am b/src/Makefile.am
index 04eea6c..a24d24a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -28,6 +28,11 @@ INCLUDES =						\
 	-I$(top_srcdir)/libselftest			\
 	$(NULL)
 
+pkbackendincludedir=$(includedir)/packagekit-backend
+
+pkbackendinclude_HEADERS =				\
+	pk-backend.h
+
 sbin_PROGRAMS =						\
 	packagekitd					\
 	$(NULL)
diff-tree ce46e424f146e64b61631f48d4037564c9ed0459 (from 8077072606c861d957432fc62e76582b9035d94b)
Author: Richard Hughes <richard at hughsie.com>
Date:   Thu Sep 6 00:34:11 2007 +0100

    provide an AC_SUBST for installing an external header

diff --git a/configure.ac b/configure.ac
index be57a41..c4d5da9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -305,6 +305,10 @@ if test x$with_backend = xbox; then
 	AC_SUBST(BOX_LIBS)
 fi
 
+AC_SUBST(PK_PLUGIN_DIR, "\$(libdir)/packagekit-backend")
+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")
+
 AM_CONDITIONAL(BACKEND_TYPE_DUMMY, [test x$with_backend = xdummy], [using dummy backend])
 AM_CONDITIONAL(BACKEND_TYPE_APT, [test x$with_backend = xapt], [using APT backend])
 AM_CONDITIONAL(BACKEND_TYPE_YUM, [test x$with_backend = xyum], [using YUM backend])
diff-tree 8077072606c861d957432fc62e76582b9035d94b (from e2af036cbb0c27aeceb1c4214875dcfcef56fa46)
Author: Richard Hughes <richard at hughsie.com>
Date:   Thu Sep 6 00:30:27 2007 +0100

    detech for and use gmodule

diff --git a/configure.ac b/configure.ac
index 6d21a0e..be57a41 100644
--- a/configure.ac
+++ b/configure.ac
@@ -64,6 +64,10 @@ PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLI
 AC_SUBST(GLIB_CFLAGS)
 AC_SUBST(GLIB_LIBS)
 
+PKG_CHECK_MODULES(GMODULE, gmodule-2.0)
+AC_SUBST(GMODULE_CFLAGS)
+AC_SUBST(GMODULE_LIBS)
+
 PKG_CHECK_MODULES(DBUS, \
  dbus-glib-1 >= $DBUS_GLIB_REQUIRED \
  dbus-1 >= $DBUS_REQUIRED \
diff --git a/src/Makefile.am b/src/Makefile.am
index 25dc135..04eea6c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -74,6 +74,7 @@ endif
 
 packagekitd_LDADD =					\
 	$(GLIB_LIBS)					\
+	$(GMODULE_LIBS)					\
 	$(DBUS_LIBS)					\
 	$(PK_LIBS)					\
 	$(LIBNM_LIBS)					\
diff-tree e2af036cbb0c27aeceb1c4214875dcfcef56fa46 (from e5a7fbaa8abed1618ae12a050578d8822dee2770)
Author: Richard Hughes <richard at hughsie.com>
Date:   Thu Sep 6 00:27:49 2007 +0100

    allow choosing the backend at runtime for testing. does nothing yet.

diff --git a/configure.ac b/configure.ac
index c865b60..6d21a0e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -175,6 +175,8 @@ fi
 # we need this for the spawn code
 if test x$with_backend = xyum; then
     AC_DEFINE(BACKEND_PREFIX, "yum", [backend prefix])
+elif test x$with_backend = xapt; then
+    AC_DEFINE(BACKEND_PREFIX, "apt", [backend prefix])
 elif test x$with_backend = xconary; then
     AC_DEFINE(BACKEND_PREFIX, "conary", [backend prefix])
 elif test x$with_backend = xbox; then
diff --git a/src/pk-engine.c b/src/pk-engine.c
index 5c126b6..e8ff6e9 100644
--- a/src/pk-engine.c
+++ b/src/pk-engine.c
@@ -128,6 +128,16 @@ pk_engine_error_get_type (void)
 }
 
 /**
+ * pk_engine_use_backend:
+ **/
+gboolean
+pk_engine_use_backend (PkEngine *engine, const gchar *backend)
+{
+	pk_debug ("trying backend %s", backend);
+	return TRUE;
+}
+
+/**
  * pk_engine_reset_timer:
  **/
 static void
diff --git a/src/pk-engine.h b/src/pk-engine.h
index 52f72a1..c2004db 100644
--- a/src/pk-engine.h
+++ b/src/pk-engine.h
@@ -69,6 +69,8 @@ GQuark		 pk_engine_error_quark			(void);
 GType		 pk_engine_error_get_type		(void);
 GType		 pk_engine_get_type		  	(void);
 PkEngine	*pk_engine_new				(void);
+gboolean	 pk_engine_use_backend			(PkEngine	*engine,
+							 const gchar	*backend);
 
 gboolean	 pk_engine_get_updates			(PkEngine	*engine,
 							 guint		*job,
diff --git a/src/pk-main.c b/src/pk-main.c
index c843983..5fa9c33 100644
--- a/src/pk-main.c
+++ b/src/pk-main.c
@@ -136,11 +136,14 @@ main (int argc, char *argv[])
 	gboolean use_daemon = FALSE;
 	gboolean timed_exit = FALSE;
 	gboolean immediate_exit = FALSE;
+	gchar *backend = NULL;
 	PkEngine *engine = NULL;
 	GError *error = NULL;
 	GOptionContext *context;
 
 	const GOptionEntry options[] = {
+		{ "backend", '\0', 0, G_OPTION_ARG_STRING, &backend,
+		  "Backend to use (for debugging)", NULL },
 		{ "daemonize", '\0', 0, G_OPTION_ARG_NONE, &use_daemon,
 		  "Daemonize and detach", NULL },
 		{ "verbose", '\0', 0, G_OPTION_ARG_NONE, &verbose,
@@ -156,6 +159,13 @@ main (int argc, char *argv[])
 		{ NULL}
 	};
 
+	if (backend == NULL) {
+		backend = g_strdup (BACKEND_PREFIX);
+		pk_debug ("using default backend %s", backend);
+	} else {
+		pk_debug ("trying to use backend %s", backend);
+	}
+
 	if (! g_thread_supported ()) {
 		g_thread_init (NULL);
 	}
@@ -199,6 +209,7 @@ main (int argc, char *argv[])
 
 	/* create a new engine object */
 	engine = pk_engine_new ();
+	pk_engine_use_backend (engine, backend);
 
 	if (!pk_object_register (system_connection, G_OBJECT (engine))) {
 		g_error ("Already running on this machine");



More information about the PackageKit mailing list