[PackageKit-commit] packagekit: Branch 'master' - 13 commits
Richard Hughes
hughsient at kemper.freedesktop.org
Thu May 28 01:59:39 PDT 2009
HACKING | 6 -
Makefile.am | 25 ----
backends/dummy/.gitignore | 4
backends/test/.gitignore | 5
backends/urpmi/.gitignore | 5
backends/yum/.gitignore | 4
client/.gitignore | 6 -
configure.ac | 65 -----------
etc/PackageKit.conf.in | 12 ++
lib/packagekit-glib/.gitignore | 5
lib/packagekit-glib/pk-bitfield.c | 2
lib/packagekit-glib/pk-bitfield.h | 4
lib/packagekit-glib/pk-control.c | 160 +++++++++++++++++++++++++++++
lib/packagekit-glib/pk-self-test.c | 2
src/.gitignore | 4
src/Makefile.am | 17 ++-
src/org.freedesktop.PackageKit.Backend.xml | 95 +++++++++++++++++
src/pk-backend-spawn.c | 6 -
src/pk-backend.c | 21 ++-
src/pk-engine.c | 6 -
src/pk-transaction-db.c | 6 -
src/pk-transaction.c | 10 +
tools/backend-change.sh | 14 --
tools/create-coverage-report.sh | 101 ------------------
tools/mugshot.sh | 11 -
tools/upload-packages.sh | 16 --
tools/yum-get-groups.sh | 11 -
tools/yum-remove-gpgkeys.sh | 2
28 files changed, 309 insertions(+), 316 deletions(-)
New commits:
commit f90a45f97b123da3cfafe9d1ea286d7d0c7048c5
Author: Richard Hughes <richard at hughsie.com>
Date: Thu May 28 09:39:50 2009 +0100
Remove unused scripts from git
diff --git a/tools/backend-change.sh b/tools/backend-change.sh
deleted file mode 100755
index 2293912..0000000
--- a/tools/backend-change.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2008 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.
-
-make clean
-./autogen.sh --prefix=/home/hughsie/.root --with-default-backend=$1 --enable-tests
-make
-make install
-
diff --git a/tools/upload-packages.sh b/tools/upload-packages.sh
deleted file mode 100755
index fbf4fa1..0000000
--- a/tools/upload-packages.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-echo "Upload!"
-#ssh packagekit.org "rm /srv/www/html/packages/*.rpm"
-rm -Rf /tmp/repo
-mkdir /tmp/repo
-cp /home/hughsie/rpmbuild/REPOS/fedora/11/i386/PackageKit-* /tmp/repo
-cp /home/hughsie/rpmbuild/REPOS/fedora/11/SRPMS/PackageKit-* /tmp/repo
-cp /home/hughsie/rpmbuild/REPOS/fedora/11/i386/gnome-packagekit-* /tmp/repo
-cp /home/hughsie/rpmbuild/REPOS/fedora/11/SRPMS/gnome-packagekit-* /tmp/repo
-cd /tmp/repo
-createrepo -d .
-#scp -r * packagekit.org:/srv/www/html/packages/
-rsync -avz -e ssh --human-readable --fuzzy --delete-after . hughsie at packagekit.org:/srv/www/html/packages
-cd -
-
diff --git a/tools/yum-get-groups.sh b/tools/yum-get-groups.sh
deleted file mode 100755
index 8c72910..0000000
--- a/tools/yum-get-groups.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2008 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.
-
-cat ../backends/yum/helpers/yumBackend.py | grep "GROUP_" | cut -d":" -f2 | cut -d"," -f1 | cut -d" " -f2 | sort| uniq
-
diff --git a/tools/yum-remove-gpgkeys.sh b/tools/yum-remove-gpgkeys.sh
deleted file mode 100755
index 13f5b6e..0000000
--- a/tools/yum-remove-gpgkeys.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-sudo rm /var/cache/yum/*/gpgdir/ -rf
-
commit ec1c152d16a8ed405cfb58c353083ee7bb95b632
Author: Richard Hughes <richard at hughsie.com>
Date: Thu May 28 09:38:06 2009 +0100
Remove mugshot data script
diff --git a/tools/mugshot.sh b/tools/mugshot.sh
deleted file mode 100755
index ab85e17..0000000
--- a/tools/mugshot.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2008 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.
-
-wget http://mugshot.org/xml/allApplications
-
commit 0e0b909aeb771925b0f179e40c7ee7010dbcf523
Author: Richard Hughes <richard at hughsie.com>
Date: Thu May 28 09:37:22 2009 +0100
Remove support for the unused gcov and gprof testing tools
diff --git a/HACKING b/HACKING
index 8a71c41..1cfa0a9 100644
--- a/HACKING
+++ b/HACKING
@@ -63,12 +63,6 @@ Remember:
Use 'make security-check' to find obvious security problems.
Use "ITS4: ignore" if you are totally 100% sure that it's not a problem.
-If you compile with --enable-gcov you can use 'make gcov' to get coverage
-reports for the unit test code.
-If you compile with --enable-gprof you can use 'make gprof' to get profiling
-data - but you probably don't want to be building packages with these options
-turned on for obvious reasons.
-
Submitting Patches
------------------
Use 'git format-patch' to generate patches against a checked out copy
diff --git a/Makefile.am b/Makefile.am
index 30cb6c3..f1d1d39 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -17,29 +17,11 @@ SUBDIRS = \
$(NULL)
clean-local :
- rm -f *~ *.bb *.bbg *.da *.gcov .libs/*.da .libs/*.bbg
+ rm -f *~
security-check:
flawfinder `find -name "*.c"`
-if PK_BUILD_GCOV
-gcov:
- make -C src gcov
- make -C libpackagekit gcov
- cat src/gcov.txt > gcov.txt
- cat libpackagekit/gcov.txt >> gcov.txt
- cat gcov.txt
-endif
-
-if PK_BUILD_GPROF
-gprof:
- make -C src gprof
- make -C libpackagekit gprof
- cat src/gprof.txt > gprof.txt
- cat libpackagekit/gprof.txt >> gprof.txt
- cat gprof.txt
-endif
-
snapshot:
$(MAKE) dist distdir=$(PACKAGE)-$(VERSION)-`date +"%Y%m%d"`
@@ -49,8 +31,6 @@ DISTCLEANFILES = \
intltool-extract \
intltool-merge \
intltool-update \
- gcov.txt \
- gprof.txt \
packagekit-decl-list.txt \
packagekit-decl.txt \
packagekit-overrides.txt \
@@ -94,7 +74,6 @@ EXTRA_DIST = \
$(NULL)
DISTCHECK_CONFIGURE_FLAGS = \
- --disable-gcov \
--enable-gtk-doc \
--with-security-framework=dummy \
--disable-tests \
diff --git a/backends/dummy/.gitignore b/backends/dummy/.gitignore
index 996fb0d..c851833 100644
--- a/backends/dummy/.gitignore
+++ b/backends/dummy/.gitignore
@@ -7,8 +7,4 @@ Makefile.in
*.loT
*.o
*~
-*.gcov
-*.gcda
-*.gcno
-*.out
diff --git a/backends/test/.gitignore b/backends/test/.gitignore
index 996fb0d..f52b70c 100644
--- a/backends/test/.gitignore
+++ b/backends/test/.gitignore
@@ -7,8 +7,3 @@ Makefile.in
*.loT
*.o
*~
-*.gcov
-*.gcda
-*.gcno
-*.out
-
diff --git a/backends/urpmi/.gitignore b/backends/urpmi/.gitignore
index 996fb0d..f52b70c 100644
--- a/backends/urpmi/.gitignore
+++ b/backends/urpmi/.gitignore
@@ -7,8 +7,3 @@ Makefile.in
*.loT
*.o
*~
-*.gcov
-*.gcda
-*.gcno
-*.out
-
diff --git a/backends/yum/.gitignore b/backends/yum/.gitignore
index dbc06a5..25e0c4c 100644
--- a/backends/yum/.gitignore
+++ b/backends/yum/.gitignore
@@ -7,10 +7,6 @@ Makefile.in
*.loT
*.o
*~
-*.gcov
-*.gcda
-*.gcno
-*.out
*.pyc
test
diff --git a/client/.gitignore b/client/.gitignore
index c0aa981..443b31d 100644
--- a/client/.gitignore
+++ b/client/.gitignore
@@ -11,9 +11,5 @@ pk-self-test
*.glade.bak
*.gladep
*.gladep.bak
-*.gcov
-*.gcda
-*.gcno
-*.out
-*.pack
+*.servicepack
diff --git a/configure.ac b/configure.ac
index 5569344..2593215 100644
--- a/configure.ac
+++ b/configure.ac
@@ -436,14 +436,6 @@ AC_ARG_ENABLE(ruck, AS_HELP_STRING([--enable-ruck],[Build ruck client]),
build_ruck=$enableval,build_ruck=yes)
AM_CONDITIONAL(PK_BUILD_RUCK, test $build_ruck = "yes")
-dnl ---------------------------------------------------------------------------
-dnl - Other tests
-dnl ---------------------------------------------------------------------------
-AC_ARG_ENABLE(gcov, AS_HELP_STRING([--enable-gcov],[compile with coverage profiling instrumentation (gcc only)]),
- enable_gcov=$enableval,enable_gcov=no)
-AC_ARG_ENABLE(gprof, AS_HELP_STRING([--enable-gprof],[compile with gprof support (gcc only)]),
- enable_gprof=$enableval,enable_gprof=no)
-
# backends
AC_ARG_ENABLE(alpm, AS_HELP_STRING([--enable-alpm],[use the ALPM backend]),enable_alpm=$enableval,enable_alpm=no)
AC_ARG_ENABLE(apt, AS_HELP_STRING([--enable-apt],[use the APT backend]),enable_apt=$enableval,enable_apt=no)
@@ -478,32 +470,6 @@ AM_CONDITIONAL(BACKEND_TYPE_URPMI, [test x$enable_urpmi = xyes])
AM_CONDITIONAL(BACKEND_TYPE_YUM, [test x$enable_yum = xyes])
AM_CONDITIONAL(BACKEND_TYPE_ZYPP, [test x$enable_zypp = xyes])
-if test x$enable_gcov = xyes; then
- ## so that config.h changes when you toggle gcov support
- AC_DEFINE_UNQUOTED(PK_BUILD_GCOV, 1, [Defined if gcov is enabled to force a rebuild due to config.h changing])
-
- AC_MSG_CHECKING([for gcc 3.3 version of gcov file format])
- have_gcc33_gcov=no
- AC_RUN_IFELSE( [AC_LANG_PROGRAM( , [[ if (__GNUC__ >=3 && __GNUC_MINOR__ >= 3) exit (0); else exit (1); ]])],
- have_gcc33_gcov=yes)
- if test x$have_gcc33_gcov = xyes ; then
- AC_DEFINE_UNQUOTED(PK_HAVE_GCC33_GCOV, 1, [Defined if we have gcc 3.3 and thus the new gcov format])
- fi
- CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
- AC_MSG_RESULT($have_gcc33_gcov)
-fi
-AM_CONDITIONAL(PK_BUILD_GCOV, test x$enable_gcov = xyes)
-
-if test x$enable_gprof = xyes; then
- ## so that config.h changes when you toggle gprof support
- AC_DEFINE_UNQUOTED(PK_BUILD_GPROF, 1, [Defined if gprof is enabled to force a rebuild due to config.h changing])
- CPPFLAGS="$CPPFLAGS -pg"
- LDFLAGS="$LDFLAGS -pg"
- CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
- AC_MSG_RESULT($enable_gprof)
-fi
-AM_CONDITIONAL(PK_BUILD_GPROF, test x$enable_gprof = xyes)
-
dnl ---------------------------------------------------------------------------
dnl - Are we specifying a different dbus root ?
dnl ---------------------------------------------------------------------------
@@ -796,8 +762,6 @@ echo "
Building unit tests: ${enable_tests}
Able to run locally: ${enable_local}
Developer warnings: ${enable_developer}
- GCC coverage profiling: ${enable_gcov}
- GCC time profiling: ${enable_gprof}
Security framework: ${with_security_framework}
Networking stack: ${with_networking_stack}
GIO support: ${with_gio}
diff --git a/lib/packagekit-glib/.gitignore b/lib/packagekit-glib/.gitignore
index 5d3c4af..a013a7d 100644
--- a/lib/packagekit-glib/.gitignore
+++ b/lib/packagekit-glib/.gitignore
@@ -7,11 +7,6 @@
*-marshal.h
pk-self-test
*.loT
-*.gcov
-*.gcda
-*.gcno
-*.txt
-*.out
*.db
pk-version.h
diff --git a/src/.gitignore b/src/.gitignore
index a4507b0..e66aa01 100644
--- a/src/.gitignore
+++ b/src/.gitignore
@@ -7,10 +7,6 @@ org.freedesktop.PackageKit*.h
packagekitd
pk-self-test
debug.log
-*.gcov
-*.gcda
-*.gcno
*.txt
-*.out
*.db
diff --git a/tools/create-coverage-report.sh b/tools/create-coverage-report.sh
deleted file mode 100755
index a78d9ea..0000000
--- a/tools/create-coverage-report.sh
+++ /dev/null
@@ -1,101 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2008 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.
-
-TOTAL_ACTUAL=0
-TOTAL_COVERED=0
-TOTAL_SOURCE=0
-TOTAL_PERCENT=0
-NOT_TESTED=""
-
-MODULE=$1
-shift
-
-process ()
-{
- if [ -e ".libs/packagekitd" ]; then
- gcov $1 &> /dev/null
- elif [ -e "src/.libs/packagekitd" ]; then
- gcov $1 &> /dev/null
- elif [ -e ".libs/libpackagekit.la" ]; then
- gcov $1 -o .libs &> /dev/null
- elif [ -e "libpackagekit/.libs/libpackagekit.la" ]; then
- gcov $1 -o .libs &> /dev/null
- else
- return
- fi
- if [ ! -e $1.gcov ]; then
- NOT_TESTED="$1,$NOT_TESTED"
- return
- fi
- SOURCE=`cat $1 |wc -l`
- ACTUAL=`grep -v " -:" $1.gcov |wc -l`
- NOT_COVERED=`grep " #####:" $1.gcov |wc -l`
- COVERED=$(($ACTUAL - $NOT_COVERED))
- if [ $ACTUAL -ne 0 ]; then
- PERCENT=$((100 * $COVERED / $ACTUAL))
- else
- PERCENT=0
- fi
-
- TOTAL_SOURCE=$(($TOTAL_SOURCE + $SOURCE))
- TOTAL_ACTUAL=$(($TOTAL_ACTUAL + $ACTUAL))
- TOTAL_COVERED=$(($TOTAL_COVERED + $COVERED))
-
- echo -n "$1"
-
- n=${#1}
- while [ $n -lt 55 ] ; do
- echo -n " "
- n=$(($n + 1))
- done
-
- echo -n " : "
-
- if [ $PERCENT -lt 10 ] ; then
- echo -n " $PERCENT%"
- elif [ $PERCENT -lt 100 ] ; then
- echo -n " $PERCENT%"
- else
- echo -n "100%"
- fi
-
- echo " ($COVERED of $ACTUAL)"
-}
-
-echo "=============================================================================="
-echo "Test coverage for module $MODULE:"
-echo "=============================================================================="
-
-while [ $# -gt 0 ] ; do
-
- case "$1" in
- "pk-main.c"|"pk-marshal.c"|"pk-security-dummy.c"|"pk-backend-python.c")
- #ignore these
- ;;
- *)
- process $1
- ;;
- esac
- shift
-done
-
-if [ $TOTAL_ACTUAL -ne 0 ]; then
- TOTAL_PERCENT=$((100 * $TOTAL_COVERED / $TOTAL_ACTUAL))
-fi
-if [ -n "NOT_TESTED" ]; then
- echo "NOT TESTED = $NOT_TESTED"
-fi
-
-echo
-echo "Source lines : $TOTAL_SOURCE"
-echo "Actual statements : $TOTAL_ACTUAL"
-echo "Executed statements : $TOTAL_COVERED"
-echo "Test coverage : $TOTAL_PERCENT%"
-echo
-
commit e8a68d6f8766251d49b66cb8c2773222f0c565d6
Author: Richard Hughes <richard at hughsie.com>
Date: Thu May 28 09:27:12 2009 +0100
Don't use --enable-developer, instead use DeveloperMode set in the config file
diff --git a/configure.ac b/configure.ac
index c6dec2e..5569344 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,10 +22,6 @@ AC_SUBST(PK_MINOR_VERSION)
AC_SUBST(PK_MICRO_VERSION)
AC_SUBST(PK_VERSION)
-# Should we enable extra stuff automatically?
-# set no for release builds, yes for development builds
-DEVELOPMENT_RELEASE=yes
-
# libtool versioning - this applies to libpackagekit
#
# See http://sources.redhat.com/autobook/autobook/autobook_91.html#SEC91 for details
@@ -326,27 +322,17 @@ dnl ---------------------------------------------------------------------------
dnl - Build self tests
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE(tests, AS_HELP_STRING([--enable-tests],[enable unit test code]),
- enable_tests=$enableval,enable_tests=$DEVELOPMENT_RELEASE)
+ enable_tests=$enableval,enable_tests=yes)
AM_CONDITIONAL(EGG_BUILD_TESTS, test x$enable_tests = xyes)
if test x$enable_tests = xyes; then
AC_DEFINE(EGG_BUILD_TESTS,1,[Build test code])
fi
dnl ---------------------------------------------------------------------------
-dnl - Display DAEMON messages?
-dnl ---------------------------------------------------------------------------
-AC_ARG_ENABLE(developer, AS_HELP_STRING([--enable-developer],[enable daemon debug messages]),
- enable_developer=$enableval,enable_developer=$DEVELOPMENT_RELEASE)
-AM_CONDITIONAL(PK_IS_DEVELOPER, test x$enable_developer = xyes)
-if test x$enable_developer = xyes; then
- AC_DEFINE(PK_IS_DEVELOPER,1,[Build developer code])
-fi
-
-dnl ---------------------------------------------------------------------------
dnl - Able to run from a checkout?
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE(local, AS_HELP_STRING([--enable-local],[enable running in local checkout]),
- enable_local=$enableval,enable_local=$DEVELOPMENT_RELEASE)
+ enable_local=$enableval,enable_local=no)
AM_CONDITIONAL(PK_BUILD_LOCAL, test x$enable_local = xyes)
if test x$enable_local = xyes; then
AC_DEFINE(PK_BUILD_LOCAL,1,[Build local code])
diff --git a/etc/PackageKit.conf.in b/etc/PackageKit.conf.in
index 5ab4cd6..9c0fc19 100644
--- a/etc/PackageKit.conf.in
+++ b/etc/PackageKit.conf.in
@@ -127,3 +127,15 @@ CheckTestingRepos=true
# default=true
UseUpdateCache=true
+# Use strict developer checking in the daemon
+#
+# This should be set to TRUE if the backend should be run in strict compliance
+# mode, which is useful when developing a backend. Normal sane users should not
+# have to use this mode.
+#
+# If this is set to FALSE, then the daemon will try to 'fix' any craziness in
+# the backend without notifying the end user.
+#
+# default=false
+DeveloperMode=false
+
diff --git a/src/pk-backend.c b/src/pk-backend.c
index 0e6e7dd..54b743c 100644
--- a/src/pk-backend.c
+++ b/src/pk-backend.c
@@ -2146,9 +2146,11 @@ void
pk_backend_test (EggTest *test)
{
PkBackend *backend;
+ PkConf *conf;
gchar *text;
gboolean ret;
const gchar *filename;
+ gboolean developer_mode;
if (!egg_test_start (test, "PkBackend"))
return;
@@ -2405,13 +2407,18 @@ pk_backend_test (EggTest *test)
ret = pk_backend_set_allow_cancel (backend, FALSE);
egg_test_assert (test, ret);
-#ifdef PK_IS_DEVELOPER
- egg_test_title (test, "check we enforce finished after error_code");
- if (number_messages == 1)
- egg_test_success (test, NULL);
- else
- egg_test_failed (test, "we messaged %i times!", number_messages);
-#endif
+ /* if running in developer mode, then expect a Message */
+ conf = pk_conf_new ();
+ developer_mode = pk_conf_get_bool (conf, "DeveloperMode");
+ g_object_unref (conf);
+ if (developer_mode) {
+ /************************************************************/
+ egg_test_title (test, "check we enforce finished after error_code");
+ if (number_messages == 1)
+ egg_test_success (test, NULL);
+ else
+ egg_test_failed (test, "we messaged %i times!", number_messages);
+ }
g_object_unref (backend);
diff --git a/src/pk-transaction.c b/src/pk-transaction.c
index 9144ebb..650910c 100644
--- a/src/pk-transaction.c
+++ b/src/pk-transaction.c
@@ -744,17 +744,19 @@ static void
pk_transaction_message_cb (PkBackend *backend, PkMessageEnum message, const gchar *details, PkTransaction *transaction)
{
const gchar *message_text;
+ gboolean developer_mode;
g_return_if_fail (PK_IS_TRANSACTION (transaction));
g_return_if_fail (transaction->priv->tid != NULL);
-#ifndef PK_IS_DEVELOPER
- if (message == PK_MESSAGE_ENUM_BACKEND_ERROR ||
- message == PK_MESSAGE_ENUM_DAEMON_ERROR) {
+ /* if not running in developer mode, then skip these types */
+ developer_mode = pk_conf_get_bool (transaction->priv->conf, "DeveloperMode");
+ if (!developer_mode &&
+ (message == PK_MESSAGE_ENUM_BACKEND_ERROR ||
+ message == PK_MESSAGE_ENUM_DAEMON_ERROR)) {
egg_warning ("ignoring message: %s", details);
return;
}
-#endif
message_text = pk_message_enum_to_text (message);
egg_debug ("emitting message %s, '%s'", message_text, details);
commit 1ddf20dff4cd774fbce4a9c2041600c3cf10db0a
Author: Richard Hughes <richard at hughsie.com>
Date: Thu May 28 09:26:20 2009 +0100
Don't opt out of tests in make dstcheck in some modules anymore
diff --git a/src/pk-backend-spawn.c b/src/pk-backend-spawn.c
index 9d678b9..dffc2a8 100644
--- a/src/pk-backend-spawn.c
+++ b/src/pk-backend-spawn.c
@@ -932,12 +932,6 @@ pk_backend_test_spawn (EggTest *test)
if (!egg_test_start (test, "PkBackendSpawn"))
return;
- /* don't do these when doing make distcheck */
-#ifndef PK_IS_DEVELOPER
- egg_test_end (test);
- return;
-#endif
-
/************************************************************/
egg_test_title (test, "get an backend_spawn");
backend_spawn = pk_backend_spawn_new ();
diff --git a/src/pk-engine.c b/src/pk-engine.c
index 4a62fa7..164a84d 100644
--- a/src/pk-engine.c
+++ b/src/pk-engine.c
@@ -1050,12 +1050,6 @@ pk_engine_test (EggTest *test)
if (!egg_test_start (test, "PkEngine"))
return;
- /* don't do these when doing make distcheck */
-#ifndef PK_IS_DEVELOPER
- egg_test_end (test);
- return;
-#endif
-
/************************************************************/
egg_test_title (test, "get a backend instance");
backend = pk_backend_new ();
diff --git a/src/pk-transaction-db.c b/src/pk-transaction-db.c
index c2dbacd..1bc82fc 100644
--- a/src/pk-transaction-db.c
+++ b/src/pk-transaction-db.c
@@ -765,12 +765,6 @@ pk_transaction_db_test (EggTest *test)
if (!egg_test_start (test, "PkTransactionDb"))
return;
- /* don't do these when doing make distcheck */
-#ifndef PK_IS_DEVELOPER
- egg_test_end (test);
- return;
-#endif
-
/* remove the self check file */
#if PK_BUILD_LOCAL
g_unlink (PK_TRANSACTION_DB_FILE);
commit 5ed5a6d82cb2e84ced36c314596c0fd2ebe53b00
Author: Richard Hughes <richard at hughsie.com>
Date: Thu May 28 09:25:08 2009 +0100
Don't run unit tests on make distcheck, there's too much that can go wrong
diff --git a/Makefile.am b/Makefile.am
index 4db746f..30cb6c3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -97,7 +97,7 @@ DISTCHECK_CONFIGURE_FLAGS = \
--disable-gcov \
--enable-gtk-doc \
--with-security-framework=dummy \
- --disable-developer \
+ --disable-tests \
$(NULL)
distclean-local:
commit 87d57126bd647232acf5b3753394695b6a955210
Author: Richard Hughes <richard at hughsie.com>
Date: Thu May 28 08:58:08 2009 +0100
Remove the configure --with-backend-user as nothing now uses it
diff --git a/configure.ac b/configure.ac
index 1cf900f..c6dec2e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -322,17 +322,6 @@ fi
AC_SUBST(PACKAGEKIT_USER)
AC_DEFINE_UNQUOTED(PACKAGEKIT_USER,"$PACKAGEKIT_USER", [User for running the PackageKit daemon])
-AC_ARG_WITH([backend_user],
- AS_HELP_STRING([--with-backend-user=<user>],
- [Alternative user for running the PackageKit backend]))
-if test -z "$with_backend_user" ; then
- PK_BACKEND_USER=$PACKAGEKIT_USER
-else
- PK_BACKEND_USER=$with_backend_user
-fi
-AC_SUBST(PK_BACKEND_USER)
-AC_DEFINE_UNQUOTED(PK_BACKEND_USER,"$PK_BACKEND_USER", [Alternative user for running the PackageKit backend])
-
dnl ---------------------------------------------------------------------------
dnl - Build self tests
dnl ---------------------------------------------------------------------------
commit 19d7878da71bd0ed74a13cdff0e579346c8cc9ea
Author: Richard Hughes <richard at hughsie.com>
Date: Wed May 27 23:24:08 2009 +0100
Don't crash the daemon if we are connecting to an old packagekitd (no properties) with a new client
diff --git a/lib/packagekit-glib/pk-control.c b/lib/packagekit-glib/pk-control.c
index f22e49f..f102ae3 100644
--- a/lib/packagekit-glib/pk-control.c
+++ b/lib/packagekit-glib/pk-control.c
@@ -1064,6 +1064,7 @@ static void
pk_control_init (PkControl *control)
{
GError *error = NULL;
+ GHashTable *hash;
control->priv = PK_CONTROL_GET_PRIVATE (control);
/* check dbus connections, exit if not valid */
@@ -1122,12 +1123,14 @@ pk_control_init (PkControl *control)
dbus_g_proxy_add_signal (control->priv->proxy, "Locked", G_TYPE_BOOLEAN, G_TYPE_INVALID);
dbus_g_proxy_connect_signal (control->priv->proxy, "Locked",
G_CALLBACK (pk_control_locked_cb), control, NULL);
-{
- GHashTable *hash;
+
+ /* get properties if they exist */
hash = pk_control_get_properties (control);
- g_hash_table_foreach (hash, (GHFunc) pk_control_collect_props_cb, control);
- g_hash_table_unref (hash);
-}
+ if (hash != NULL) {
+ g_hash_table_foreach (hash, (GHFunc) pk_control_collect_props_cb, control);
+ g_hash_table_unref (hash);
+ }
+
/* idle add a refresh so we have valid data */
control->priv->idle_id = g_idle_add ((GSourceFunc) pk_control_transaction_list_refresh_idle_cb, control);
}
commit a86b5b8477c41199aeac0c2e9ea56b3b43412e49
Author: Richard Hughes <richard at hughsie.com>
Date: Wed May 27 23:23:38 2009 +0100
Trivial whitespace fix
diff --git a/lib/packagekit-glib/pk-bitfield.h b/lib/packagekit-glib/pk-bitfield.h
index 53cdfc1..fddca3d 100644
--- a/lib/packagekit-glib/pk-bitfield.h
+++ b/lib/packagekit-glib/pk-bitfield.h
@@ -48,9 +48,9 @@ PkBitfield pk_bitfield_from_enums (gint value, ...);
PkBitfield pk_role_bitfield_from_text (const gchar *roles);
gchar *pk_role_bitfield_to_text (PkBitfield roles);
PkBitfield pk_group_bitfield_from_text (const gchar *groups);
-gchar *pk_group_bitfield_to_text (PkBitfield groups);
+gchar *pk_group_bitfield_to_text (PkBitfield groups);
PkBitfield pk_filter_bitfield_from_text (const gchar *filters);
-gchar *pk_filter_bitfield_to_text (PkBitfield filters);
+gchar *pk_filter_bitfield_to_text (PkBitfield filters);
G_END_DECLS
commit 7fd7882113812222e74bf9081c28c0e194d21e98
Author: Richard Hughes <richard at hughsie.com>
Date: Wed May 27 18:05:16 2009 +0100
Add a prototype backend interface definition, but don't expose it on the bus yet
diff --git a/src/Makefile.am b/src/Makefile.am
index 4806f56..7c78d03 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -156,8 +156,9 @@ endif
BUILT_SOURCES = \
pk-marshal.c \
pk-marshal.h \
- org.freedesktop.PackageKit.h \
- org.freedesktop.PackageKit.Transaction.h \
+ org.freedesktop.PackageKit.h \
+ org.freedesktop.PackageKit.Transaction.h \
+ org.freedesktop.PackageKit.Backend.h \
$(NULL)
pk-marshal.c: pk-marshal.list
@@ -181,6 +182,13 @@ org.freedesktop.PackageKit.Transaction.h: org.freedesktop.PackageKit.Transaction
--output=org.freedesktop.PackageKit.Transaction.h \
$(srcdir)/org.freedesktop.PackageKit.Transaction.xml
+org.freedesktop.PackageKit.Backend.h: org.freedesktop.PackageKit.Backend.xml
+ $(LIBTOOL) --mode=execute dbus-binding-tool \
+ --prefix=pk_backend \
+ --mode=glib-server \
+ --output=org.freedesktop.PackageKit.Backend.h \
+ $(srcdir)/org.freedesktop.PackageKit.Backend.xml
+
if EGG_BUILD_TESTS
check_PROGRAMS = \
@@ -220,8 +228,9 @@ EXTRA_DIST = \
pk-marshal.list \
pk-security-polkit.c \
pk-security-dummy.c \
- org.freedesktop.PackageKit.xml \
- org.freedesktop.PackageKit.Transaction.xml \
+ org.freedesktop.PackageKit.xml \
+ org.freedesktop.PackageKit.Transaction.xml \
+ org.freedesktop.PackageKit.Backend.xml \
$(NULL)
clean-local:
diff --git a/src/org.freedesktop.PackageKit.Backend.xml b/src/org.freedesktop.PackageKit.Backend.xml
new file mode 100644
index 0000000..3376e63
--- /dev/null
+++ b/src/org.freedesktop.PackageKit.Backend.xml
@@ -0,0 +1,95 @@
+<!DOCTYPE node PUBLIC
+"-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
+"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd" [
+ <!ENTITY ERROR_GENERAL "org.freedesktop.packagekit.Denied">
+]>
+<node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
+ <interface name="org.freedesktop.PackageKit.Backend">
+ <doc:doc>
+ <doc:description>
+ <doc:para>
+ This interface is used for getting information about the loaded backend.
+ </doc:para>
+ </doc:description>
+ </doc:doc>
+
+ <!--*****************************************************************************************-->
+ <property name="name" type="s" access="read">
+ <doc:doc>
+ <doc:description>
+ <doc:para>
+ The backend name, e.g. <doc:tt>"yum"</doc:tt>.
+ </doc:para>
+ </doc:description>
+ </doc:doc>
+ </property>
+
+ <!--*****************************************************************************************-->
+ <property name="description" type="s" access="read">
+ <doc:doc>
+ <doc:description>
+ <doc:para>
+ The backend name, e.g. <doc:tt>"Yellow Dog Update Modifier"</doc:tt>.
+ </doc:para>
+ </doc:description>
+ </doc:doc>
+ </property>
+
+ <!--*****************************************************************************************-->
+ <property name="author" type="s" access="read">
+ <doc:doc>
+ <doc:description>
+ <doc:para>
+ The backend author, e.g. <doc:tt>"Joe Bloggs <joe&blogs.com>"</doc:tt>.
+ </doc:para>
+ </doc:description>
+ </doc:doc>
+ </property>
+
+ <!--*****************************************************************************************-->
+ <property name="roles" type="as" access="read">
+ <doc:doc>
+ <doc:description>
+ <doc:para>
+ The roles the backend supports, e.g. <doc:tt>["search-name", "refresh-cache"]</doc:tt>.
+ </doc:para>
+ </doc:description>
+ </doc:doc>
+ </property>
+
+ <!--*****************************************************************************************-->
+ <property name="groups" type="as" access="read">
+ <doc:doc>
+ <doc:description>
+ <doc:para>
+ The groups the backend supports, e.g. <doc:tt>["accessories", "games"]</doc:tt>.
+ </doc:para>
+ </doc:description>
+ </doc:doc>
+ </property>
+
+ <!--*****************************************************************************************-->
+ <property name="filters" type="as" access="read">
+ <doc:doc>
+ <doc:description>
+ <doc:para>
+ The filters the backend supports, e.g. <doc:tt>["installed", "newest"]</doc:tt>.
+ </doc:para>
+ </doc:description>
+ </doc:doc>
+ </property>
+
+ <!--*****************************************************************************************-->
+ <property name="mime-types" type="as" access="read">
+ <doc:doc>
+ <doc:description>
+ <doc:para>
+ The mime-types the backend supports, e.g. <doc:tt>["application/x-rpm", "application/x-deb"]</doc:tt>.
+ </doc:para>
+ </doc:description>
+ </doc:doc>
+ </property>
+
+ </interface>
+</node>
+
commit 9e96960505c72248a7f48df4b938d012fa5a0bae
Author: Richard Hughes <richard at hughsie.com>
Date: Wed May 27 18:04:27 2009 +0100
Trivial comment fix
diff --git a/lib/packagekit-glib/pk-bitfield.c b/lib/packagekit-glib/pk-bitfield.c
index fe5118d..5e96c3d 100644
--- a/lib/packagekit-glib/pk-bitfield.c
+++ b/lib/packagekit-glib/pk-bitfield.c
@@ -109,7 +109,7 @@ pk_bitfield_from_enums (gint value, ...)
}
/**
- * pk_roles_bitfield_to_text:
+ * pk_role_bitfield_to_text:
* @roles: The enumerated type values
*
* Converts a enumerated type bitfield to its text representation
commit 30cee8045ca9d3bcd46280681ec46a96e502eab3
Author: Richard Hughes <richard at hughsie.com>
Date: Wed May 27 17:27:32 2009 +0100
Disable the desktop self tests for now
diff --git a/lib/packagekit-glib/pk-self-test.c b/lib/packagekit-glib/pk-self-test.c
index d03fdb2..b5fe22a 100644
--- a/lib/packagekit-glib/pk-self-test.c
+++ b/lib/packagekit-glib/pk-self-test.c
@@ -65,7 +65,6 @@ main (int argc, char **argv)
pk_package_list_test (test);
pk_enum_test (test);
pk_bitfield_test (test);
- pk_desktop_test (test);
pk_client_test (test);
pk_catalog_test (test);
pk_control_test (test);
@@ -73,6 +72,7 @@ main (int argc, char **argv)
pk_update_detail_test (test);
pk_details_test (test);
pk_service_pack_test (test);
+// pk_desktop_test (test);
return (egg_test_finish (test));
}
commit 471a7ee8fbaf828dd649ea1f16a810b9bdcbf4ba
Author: Richard Hughes <richard at hughsie.com>
Date: Wed May 27 17:27:02 2009 +0100
Export version-* properties in PkControl
diff --git a/lib/packagekit-glib/pk-control.c b/lib/packagekit-glib/pk-control.c
index 721b575..f22e49f 100644
--- a/lib/packagekit-glib/pk-control.c
+++ b/lib/packagekit-glib/pk-control.c
@@ -47,6 +47,7 @@
#include <packagekit-glib/pk-connection.h>
#include <packagekit-glib/pk-common.h>
#include <packagekit-glib/pk-enum.h>
+#include <packagekit-glib/pk-version.h>
#include "egg-debug.h"
@@ -66,6 +67,9 @@ struct _PkControlPrivate
PkConnection *pconnection;
gchar **array;
guint idle_id;
+ gboolean version_major;
+ gboolean version_minor;
+ gboolean version_micro;
};
enum {
@@ -78,6 +82,14 @@ enum {
PK_CONTROL_LAST_SIGNAL
};
+enum {
+ PROP_0,
+ PROP_VERSION_MAJOR,
+ PROP_VERSION_MINOR,
+ PROP_VERSION_MICRO,
+ PROP_LAST
+};
+
static guint signals [PK_CONTROL_LAST_SIGNAL] = { 0 };
static gpointer pk_control_object = NULL;
@@ -830,16 +842,79 @@ pk_control_locked_cb (DBusGProxy *proxy, gboolean is_locked, PkControl *control)
}
/**
+ * pk_control_get_property:
+ **/
+static void
+pk_control_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
+{
+ PkControl *control = PK_CONTROL (object);
+ switch (prop_id) {
+ case PROP_VERSION_MAJOR:
+ g_value_set_uint (value, control->priv->version_major);
+ break;
+ case PROP_VERSION_MINOR:
+ g_value_set_uint (value, control->priv->version_minor);
+ break;
+ case PROP_VERSION_MICRO:
+ g_value_set_uint (value, control->priv->version_micro);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+/**
+ * pk_control_set_property:
+ **/
+static void
+pk_control_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
+{
+ switch (prop_id) {
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+/**
* pk_control_class_init:
* @klass: The PkControlClass
**/
static void
pk_control_class_init (PkControlClass *klass)
{
+ GParamSpec *pspec;
GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ object_class->get_property = pk_control_get_property;
+ object_class->set_property = pk_control_set_property;
object_class->finalize = pk_control_finalize;
/**
+ * PkControl:version-major:
+ */
+ pspec = g_param_spec_uint ("version-major", NULL, NULL,
+ 0, G_MAXUINT, 0,
+ G_PARAM_READWRITE);
+ g_object_class_install_property (object_class, PROP_VERSION_MAJOR, pspec);
+
+ /**
+ * PkControl:version-minor:
+ */
+ pspec = g_param_spec_uint ("version-minor", NULL, NULL,
+ 0, G_MAXUINT, 0,
+ G_PARAM_READWRITE);
+ g_object_class_install_property (object_class, PROP_VERSION_MINOR, pspec);
+
+ /**
+ * PkControl:version-micro:
+ */
+ pspec = g_param_spec_uint ("version-micro", NULL, NULL,
+ 0, G_MAXUINT, 0,
+ G_PARAM_READWRITE);
+ g_object_class_install_property (object_class, PROP_VERSION_MICRO, pspec);
+
+ /**
* PkControl::updates-changed:
* @control: the #PkControl instance that emitted the signal
*
@@ -925,6 +1000,63 @@ pk_control_class_init (PkControlClass *klass)
}
/**
+ * pk_control_get_properties:
+ **/
+static GHashTable *
+pk_control_get_properties (PkControl *control)
+{
+ gboolean ret;
+ GError *error = NULL;
+ GHashTable *hash_table = NULL;
+ DBusGProxy *proxy;
+
+ /* connect to the correct path for properties */
+ proxy = dbus_g_proxy_new_for_name (control->priv->connection,
+ "org.freedesktop.PackageKit",
+ "/org/freedesktop/PackageKit",
+ "org.freedesktop.DBus.Properties");
+ if (proxy == NULL) {
+ egg_warning ("Couldn't connect to proxy");
+ goto out;
+ }
+
+ /* get all properties */
+ ret = dbus_g_proxy_call (proxy, "GetAll", &error,
+ G_TYPE_STRING, "org.freedesktop.PackageKit",
+ G_TYPE_INVALID,
+ dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE),
+ &hash_table,
+ G_TYPE_INVALID);
+ if (!ret) {
+ egg_warning ("Couldn't call GetAll() to get properties for %s", error->message);
+ g_error_free (error);
+ goto out;
+ }
+out:
+ if (proxy != NULL)
+ g_object_unref (proxy);
+ return hash_table;
+}
+
+/**
+ * pk_control_collect_props_cb:
+ **/
+static void
+pk_control_collect_props_cb (const char *key, const GValue *value, PkControl *control)
+{
+ if (g_strcmp0 (key, "version-major") == 0)
+ control->priv->version_major = g_value_get_uint (value);
+ else if (g_strcmp0 (key, "version-minor") == 0)
+ control->priv->version_minor = g_value_get_uint (value);
+ else if (g_strcmp0 (key, "version-micro") == 0)
+ control->priv->version_micro = g_value_get_uint (value);
+ else {
+ egg_warning ("unhandled property '%s'", key);
+ g_assert_not_reached ();
+ }
+}
+
+/**
* pk_control_init:
* @control: This class instance
**/
@@ -945,6 +1077,9 @@ pk_control_init (PkControl *control)
/* we maintain a local copy */
control->priv->array = NULL;
control->priv->idle_id = 0;
+ control->priv->version_major = 0;
+ control->priv->version_minor = 0;
+ control->priv->version_micro = 0;
/* watch for PackageKit on the bus, and try to connect up at start */
control->priv->pconnection = pk_connection_new ();
@@ -987,7 +1122,12 @@ pk_control_init (PkControl *control)
dbus_g_proxy_add_signal (control->priv->proxy, "Locked", G_TYPE_BOOLEAN, G_TYPE_INVALID);
dbus_g_proxy_connect_signal (control->priv->proxy, "Locked",
G_CALLBACK (pk_control_locked_cb), control, NULL);
-
+{
+ GHashTable *hash;
+ hash = pk_control_get_properties (control);
+ g_hash_table_foreach (hash, (GHFunc) pk_control_collect_props_cb, control);
+ g_hash_table_unref (hash);
+}
/* idle add a refresh so we have valid data */
control->priv->idle_id = g_idle_add ((GSourceFunc) pk_control_transaction_list_refresh_idle_cb, control);
}
@@ -1058,6 +1198,7 @@ pk_control_test (EggTest *test)
gboolean ret;
PkControl *control;
PkConnection *connection;
+ guint version;
if (!egg_test_start (test, "PkControl"))
return;
@@ -1075,6 +1216,22 @@ pk_control_test (EggTest *test)
egg_test_title (test, "get control");
control = pk_control_new ();
egg_test_assert (test, control != NULL);
+
+ /************************************************************/
+ egg_test_title (test, "version major");
+ g_object_get (control, "version-major", &version, NULL);
+ egg_test_assert (test, (version == PK_MAJOR_VERSION));
+
+ /************************************************************/
+ egg_test_title (test, "version minor");
+ g_object_get (control, "version-minor", &version, NULL);
+ egg_test_assert (test, (version == PK_MINOR_VERSION));
+
+ /************************************************************/
+ egg_test_title (test, "version micro");
+ g_object_get (control, "version-micro", &version, NULL);
+ egg_test_assert (test, (version == PK_MICRO_VERSION));
+
g_object_unref (control);
out:
egg_test_end (test);
More information about the PackageKit-commit
mailing list