[PackageKit-commit] packagekit: Branch 'master' - 7 commits
Richard Hughes
hughsient at kemper.freedesktop.org
Sun Apr 13 13:30:50 PDT 2008
backends/alpm/pk-backend-alpm.c | 12 +
backends/yum/helpers/yumBackend.py | 4
configure.ac | 1
docs/api/PackageKit-docs.sgml | 1
libpackagekit/Makefile.am | 3
libpackagekit/pk-extra-obj.c | 248 -------------------------------------
libpackagekit/pk-extra-obj.h | 50 -------
libpackagekit/pk-extra.c | 1
libpackagekit/pk-self-test.c | 2
9 files changed, 12 insertions(+), 310 deletions(-)
New commits:
commit 5fcad170a7c3f1a9a5e40db0c3e72885467ce253
Merge: 3c26108... bf7d55b...
Author: Richard Hughes <richard at hughsie.com>
Date: Sun Apr 13 21:29:39 2008 +0100
Merge branch 'master' of git+ssh://hughsie@git.packagekit.org/srv/git/PackageKit
commit 3c261088bd7e479ef361253b5f6cbdb95c53bbd3
Author: Richard Hughes <richard at hughsie.com>
Date: Sun Apr 13 21:29:20 2008 +0100
remove PkExtraObj as nothing uses it
diff --git a/docs/api/PackageKit-docs.sgml b/docs/api/PackageKit-docs.sgml
index 686545a..601074f 100644
--- a/docs/api/PackageKit-docs.sgml
+++ b/docs/api/PackageKit-docs.sgml
@@ -26,7 +26,6 @@
<xi:include href="xml/pk-control.xml"/>
<xi:include href="xml/pk-task-list.xml"/>
<xi:include href="xml/pk-debug.xml"/>
- <xi:include href="xml/pk-extra-obj.xml"/>
<xi:include href="xml/pk-common.xml"/>
<xi:include href="xml/pk-enum.xml"/>
<xi:include href="xml/pk-package-id.xml"/>
diff --git a/libpackagekit/Makefile.am b/libpackagekit/Makefile.am
index ad28599..d33bc36 100644
--- a/libpackagekit/Makefile.am
+++ b/libpackagekit/Makefile.am
@@ -35,7 +35,6 @@ libpackagekit_includedir = $(includedir)/packagekit
libpackagekit_include_HEADERS = \
pk-debug.h \
pk-extra.h \
- pk-extra-obj.h \
pk-connection.h \
pk-network.h \
pk-package-id.h \
@@ -56,8 +55,6 @@ libpackagekit_la_SOURCES = \
pk-marshal.h \
pk-extra.c \
pk-extra.h \
- pk-extra-obj.c \
- pk-extra-obj.h \
pk-connection.c \
pk-connection.h \
pk-network.h \
diff --git a/libpackagekit/pk-extra-obj.c b/libpackagekit/pk-extra-obj.c
deleted file mode 100644
index 72b06dc..0000000
--- a/libpackagekit/pk-extra-obj.c
+++ /dev/null
@@ -1,248 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Copyright (C) 2007-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.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-/**
- * SECTION:pk-extra-obj
- * @short_description: Client object access to extra metadata about a package
- *
- * Extra metadata such as icon name and localised summary may be stored here
- */
-
-#include "config.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <glib/gi18n.h>
-
-#include "pk-debug.h"
-#include "pk-common.h"
-#include "pk-package-id.h"
-#include "pk-extra.h"
-#include "pk-extra-obj.h"
-
-/**
- * pk_extra_obj_new:
- *
- * Creates a new #PkExtraObj object with default values
- *
- * Return value: a new #PkExtraObj object
- **/
-PkExtraObj *
-pk_extra_obj_new (void)
-{
- PkExtraObj *eobj;
- eobj = g_new0 (PkExtraObj, 1);
- eobj->id = NULL;
- eobj->icon = NULL;
- eobj->exec = NULL;
- eobj->summary = NULL;
- return eobj;
-}
-
-/**
- * pk_extra_obj_new_from_package_id:
- * @package_id: the package_id to pre-fill the object
- *
- * Creates a new #PkExtraObj object with values taken from the supplied id.
- *
- * Return value: a new #PkExtraObj object
- **/
-PkExtraObj *
-pk_extra_obj_new_from_package_id (const gchar *package_id)
-{
- PkExtra *extra;
- PkExtraObj *eobj;
-
- eobj = pk_extra_obj_new ();
- eobj->id = pk_package_id_new_from_string (package_id);
-
- extra = pk_extra_new ();
- pk_debug ("getting localised for %s", eobj->id->name);
- pk_extra_get_localised_detail (extra, eobj->id->name, &eobj->summary);
- pk_extra_get_package_detail (extra, eobj->id->name, &eobj->icon, &eobj->exec);
- g_object_unref (extra);
-
- return eobj;
-}
-
-/**
- * pk_extra_obj_new_from_package_id_summary:
- * @package_id: the package_id to pre-fill the object
- *
- * Creates a new #PkExtraObj object with values taken from the supplied id.
- *
- * Return value: a new #PkExtraObj object
- **/
-PkExtraObj *
-pk_extra_obj_new_from_package_id_summary (const gchar *package_id, const gchar *summary)
-{
- PkExtraObj *eobj;
- eobj = pk_extra_obj_new_from_package_id (package_id);
- /* nothing better */
- if (eobj->summary == NULL) {
- eobj->summary = g_strdup (summary);
- }
- return eobj;
-}
-
-/**
- * pk_extra_obj_free:
- * @extra_obj: the #PkExtraObj object
- *
- * Return value: %TRUE if the #PkExtraObj object was freed.
- **/
-gboolean
-pk_extra_obj_free (PkExtraObj *eobj)
-{
- if (eobj == NULL) {
- return FALSE;
- }
- if (eobj->id != NULL) {
- pk_package_id_free (eobj->id);
- }
- g_free (eobj->icon);
- g_free (eobj->exec);
- g_free (eobj->summary);
- g_free (eobj);
- return TRUE;
-}
-
-/***************************************************************************
- *** MAKE CHECK TESTS ***
- ***************************************************************************/
-#ifdef PK_BUILD_TESTS
-#include <libselftest.h>
-#include <glib/gstdio.h>
-
-void
-libst_extra_obj (LibSelfTest *test)
-{
- gboolean ret;
- PkExtra *extra;
- PkExtraObj *eobj;
-
- if (libst_start (test, "PkExtraObj", CLASS_AUTO) == FALSE) {
- return;
- }
-
- /* should be single instance */
- extra = pk_extra_new ();
- /************************************************************/
- libst_title (test, "set database");
- ret = pk_extra_set_database (extra, "extra.db");
- if (ret) {
- libst_success (test, NULL);
- } else {
- libst_failed (test, NULL);
- }
-
- /* set correct locale */
- pk_extra_set_locale (extra, "en_GB");
-
- /************************************************************/
- libst_title (test, "get an extra_obj object");
- eobj = pk_extra_obj_new_from_package_id ("gnome-power-manager;0.0.1;i386;fedora");
- if (eobj != NULL) {
- libst_success (test, NULL);
- } else {
- libst_failed (test, NULL);
- }
-
- /************************************************************/
- libst_title (test, "got an icon");
- if (eobj->icon != NULL) {
- libst_success (test, "got %s", eobj->icon);
- } else {
- libst_failed (test, NULL);
- }
-
- /************************************************************/
- libst_title (test, "got an exec");
- if (eobj->exec != NULL) {
- libst_success (test, "got %s", eobj->exec);
- } else {
- libst_failed (test, NULL);
- }
-
- /************************************************************/
- libst_title (test, "got a summary");
- if (eobj->summary != NULL) {
- libst_success (test, "got %s", eobj->summary);
- } else {
- libst_failed (test, NULL);
- }
-
- /************************************************************/
- libst_title (test, "free eobj");
- ret = pk_extra_obj_free (eobj);
- if (ret) {
- libst_success (test, NULL);
- } else {
- libst_failed (test, NULL);
- }
-
- /* set incorrect locale */
- pk_extra_set_locale (extra, "fr_GB");
-
- /************************************************************/
- libst_title (test, "get an extra_obj object");
- eobj = pk_extra_obj_new_from_package_id ("gnome-power-manager;0.0.1;i386;fedora");
- if (eobj != NULL) {
- libst_success (test, NULL);
- } else {
- libst_failed (test, NULL);
- }
-
- /************************************************************/
- libst_title (test, "make sure we don't get a summary for a wrong locale");
- if (eobj->summary == NULL) {
- libst_success (test, NULL);
- } else {
- libst_failed (test, "got %s", eobj->summary);
- }
- pk_extra_obj_free (eobj);
-
- /************************************************************/
- libst_title (test, "get an wrong object");
- eobj = pk_extra_obj_new_from_package_id ("gnome-baz-manager;0.0.1;i386;fedora");
- if (eobj != NULL) {
- libst_success (test, NULL);
- } else {
- libst_failed (test, NULL);
- }
-
- /************************************************************/
- libst_title (test, "make sure we don't get a summary for a wrong package");
- if (eobj->summary == NULL) {
- libst_success (test, NULL);
- } else {
- libst_failed (test, "got %s", eobj->summary);
- }
- pk_extra_obj_free (eobj);
-
- g_unlink ("extra.db");
-
- libst_end (test);
-}
-#endif
-
diff --git a/libpackagekit/pk-extra-obj.h b/libpackagekit/pk-extra-obj.h
deleted file mode 100644
index ad21f5d..0000000
--- a/libpackagekit/pk-extra-obj.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Copyright (C) 2007-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.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef __PK_EXTRA_OBJ_H
-#define __PK_EXTRA_OBJ_H
-
-#include <glib-object.h>
-#include "pk-package-id.h"
-
-G_BEGIN_DECLS
-
-/**
- * PkExtraObj:
- *
- * The cached structure for the extra fields from the metadata store
- */
-typedef struct {
- PkPackageId *id;
- gchar *icon;
- gchar *exec;
- gchar *summary; /* one line quick description */
-} PkExtraObj;
-
-PkExtraObj *pk_extra_obj_new (void);
-PkExtraObj *pk_extra_obj_new_from_package_id (const gchar *package_id);
-PkExtraObj *pk_extra_obj_new_from_package_id_summary (const gchar *package_id,
- const gchar *summary);
-gboolean pk_extra_obj_free (PkExtraObj *extra_obj);
-
-G_END_DECLS
-
-#endif /* __PK_EXTRA_OBJ_H */
diff --git a/libpackagekit/pk-extra.c b/libpackagekit/pk-extra.c
index c23f717..c769645 100644
--- a/libpackagekit/pk-extra.c
+++ b/libpackagekit/pk-extra.c
@@ -916,6 +916,7 @@ libst_extra (LibSelfTest *test)
libst_success (test, "%i get_localised_detail loops completed in %ims", i*5, libst_elapsed (test));
g_object_unref (extra);
+ g_unlink ("extra.db");
libst_end (test);
}
diff --git a/libpackagekit/pk-self-test.c b/libpackagekit/pk-self-test.c
index dff6ecd..62e225b 100644
--- a/libpackagekit/pk-self-test.c
+++ b/libpackagekit/pk-self-test.c
@@ -34,7 +34,6 @@ void libst_enum (LibSelfTest *test);
void libst_common (LibSelfTest *test);
void libst_enum_list (LibSelfTest *test);
void libst_extra (LibSelfTest *test);
-void libst_extra_obj (LibSelfTest *test);
void libst_client (LibSelfTest *test);
void libst_control (LibSelfTest *test);
void libst_task_list (LibSelfTest *test);
@@ -55,7 +54,6 @@ main (int argc, char **argv)
libst_package_list (&test);
libst_enum (&test);
libst_extra (&test);
- libst_extra_obj (&test);
libst_client (&test);
libst_control (&test);
libst_task_list (&test);
commit bf7d55b2092d29c03c76d36ac56ef43357e18144
Author: Valeriy Lyasotskiy <onestep at ukr.net>
Date: Sun Apr 13 23:05:03 2008 +0300
Fix compilation on 64-bit configurations
diff --git a/backends/alpm/pk-backend-alpm.c b/backends/alpm/pk-backend-alpm.c
index 2638d84..6746a28 100644
--- a/backends/alpm/pk-backend-alpm.c
+++ b/backends/alpm/pk-backend-alpm.c
@@ -402,7 +402,7 @@ backend_initialize (PkBackend *backend)
static void
backend_install_package (PkBackend *backend, const gchar *package_id)
{
- pk_debug ("hello %i", (int)backend);
+ pk_debug ("hello %i", GPOINTER_TO_INT (backend));
g_return_if_fail (backend != NULL);
//alpm_list_t *syncdbs = alpm_option_get_syncdbs ();
alpm_list_t *result = NULL;
commit a8a74f9a5bb2f3cf0f441619bc3d9c699b9ecd79
Author: Valeriy Lyasotskiy <onestep at ukr.net>
Date: Sun Apr 13 23:01:32 2008 +0300
Fix autoconf error
diff --git a/backends/alpm/pk-backend-alpm.c b/backends/alpm/pk-backend-alpm.c
index 26f8043..2638d84 100644
--- a/backends/alpm/pk-backend-alpm.c
+++ b/backends/alpm/pk-backend-alpm.c
@@ -383,7 +383,7 @@ backend_initialize (PkBackend *backend)
alpm_option_set_root("/");
alpm_option_set_dbpath("/var/lib/pacman");
alpm_option_add_cachedir("/var/cache/pacman/pkg");
- alpm_option_set_logfile("/var/log/pacman.log");
+ alpm_option_set_logfile("/var/log/pacman.log");
if (alpm_db_register_local () == NULL)
{
diff --git a/configure.ac b/configure.ac
index c3bcd0a..68b5afc 100755
--- a/configure.ac
+++ b/configure.ac
@@ -26,6 +26,7 @@ AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
AC_PROG_CC
+AC_PROG_CXX
AC_PROG_INSTALL
AC_ISC_POSIX
AC_HEADER_STDC
commit 31318d015367fc423d79b4f2398dff2972804962
Author: Richard Hughes <richard at hughsie.com>
Date: Sun Apr 13 14:31:06 2008 +0100
don't error out with 'Package is not installed' when geting requires of a not-installed package. Fixes rh#442221
diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index e210751..0804eb0 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -675,10 +675,6 @@ class PackageKitYumBackend(PackageKitBaseBackend):
for txmbr in self.yumbase.tsInfo:
if txmbr.po.name != pkg.name:
self._show_package(txmbr.po,INFO_INSTALLED)
- else:
- self.error(ERROR_PACKAGE_NOT_INSTALLED,"Package is not installed")
-
-
def _is_inst(self,pkg):
return self.yumbase.rpmdb.installed(po=pkg)
commit cf3ed2acb96cd938aec7b131f6a121c7557fe98f
Merge: 1c67f45... 8c729a6...
Author: Valeriy Lyasotskiy <onestep at ukr.net>
Date: Sun Apr 13 15:39:43 2008 +0300
Merge branch 'master' of git+ssh://onestep_ua@git.packagekit.org/srv/git/PackageKit
commit 1c67f45a5d10adb005783f7426d0c6a19dfb2938
Author: Valeriy Lyasotskiy <onestep at ukr.net>
Date: Sun Apr 13 15:36:13 2008 +0300
Changes related to new alpm
diff --git a/backends/alpm/pk-backend-alpm.c b/backends/alpm/pk-backend-alpm.c
index 889ad30..26f8043 100644
--- a/backends/alpm/pk-backend-alpm.c
+++ b/backends/alpm/pk-backend-alpm.c
@@ -366,6 +366,7 @@ backend_initialize (PkBackend *backend)
//return;
}
+/*
if (alpm_parse_config ("/etc/pacman.conf", NULL, "") != 0)
{
pk_backend_error_code (backend,
@@ -375,9 +376,16 @@ backend_initialize (PkBackend *backend)
backend_destroy (backend);
return;
}
+*/
+ // These are defaults
+ // TODO: Get real options from /etc/pacman.conf
+ alpm_option_set_root("/");
+ alpm_option_set_dbpath("/var/lib/pacman");
+ alpm_option_add_cachedir("/var/cache/pacman/pkg");
+ alpm_option_set_logfile("/var/log/pacman.log");
- if (alpm_db_register ("local") == NULL)
+ if (alpm_db_register_local () == NULL)
{
pk_backend_error_code (backend,
PK_ERROR_ENUM_FAILED_CONFIG_PARSING,
More information about the PackageKit-commit
mailing list