[PackageKit-commit] packagekit: Branch 'master' - 4 commits
Richard Hughes
hughsient at kemper.freedesktop.org
Fri May 9 05:07:55 PDT 2008
backends/apt/pk-backend-apt.c | 9 ++++---
backends/apt2/pk-backend-apt2.c | 2 -
backends/opkg/pk-backend-opkg.c | 41 +++++++++++++++++++++++++++++++++++-
backends/poldek/pk-backend-poldek.c | 8 +++----
backends/smart/pk-backend-smart.c | 20 ++++++++++++++---
configure.ac | 2 -
docs/html/img/assassin.png |binary
docs/html/pk-screenshots.html | 6 +++++
8 files changed, 73 insertions(+), 15 deletions(-)
New commits:
commit 651f86098dcc3f1e2e1a3817988293e786e3a437
Author: Thomas Wood <thomas at openedhand.com>
Date: Fri May 9 12:55:59 2008 +0100
opkg: implement GetDetails using new opkg api
diff --git a/backends/opkg/pk-backend-opkg.c b/backends/opkg/pk-backend-opkg.c
index 34193b0..bec9de8 100644
--- a/backends/opkg/pk-backend-opkg.c
+++ b/backends/opkg/pk-backend-opkg.c
@@ -554,6 +554,45 @@ backend_get_groups (PkBackend *backend)
PK_GROUP_ENUM_MAPS);
}
+/**
+ * backend_get_details:
+ */
+static gboolean
+backend_get_details_thread (PkBackend *backend)
+{
+ PkPackageId *pi;
+ const gchar *package_id;
+ opkg_package_t *pkg;
+ gchar *newid;
+
+ package_id = pk_backend_get_string (backend, "package_id");
+ pi = pk_package_id_new_from_string (package_id);
+ if (pi == NULL)
+ {
+ pk_backend_error_code (backend, PK_ERROR_ENUM_PACKAGE_ID_INVALID, "invalid package id");
+ pk_package_id_free (pi);
+ return FALSE;
+ }
+
+
+ pkg = opkg_find_package (opkg, pi->name, pi->version, pi->arch, pi->data);
+
+ newid = g_strdup_printf ("%s;%s;%s;%s", pkg->name, pkg->version, pkg->architecture, pkg->repository);
+
+ pk_backend_details (backend, newid, NULL, 0, pkg->description, pkg->url, pkg->size);
+
+ g_free (newid);
+ pk_package_id_free (pi);
+ pk_backend_finished (backend);
+ return TRUE;
+}
+
+static void
+backend_get_details (PkBackend *backend, const gchar *package_id)
+{
+ pk_backend_no_percentage_updates (backend);
+ pk_backend_thread_create (backend, backend_get_details_thread);
+}
PK_BACKEND_OPTIONS (
"opkg", /* description */
@@ -564,7 +603,7 @@ PK_BACKEND_OPTIONS (
backend_get_filters, /* get_filters */
NULL, /* cancel */
NULL, /* get_depends */
- NULL, /* get_details */
+ backend_get_details, /* get_details */
NULL, /* get_files */
NULL, /* get_packages */
NULL, /* get_repo_list */
diff --git a/configure.ac b/configure.ac
index 05682b3..24c7cde 100644
--- a/configure.ac
+++ b/configure.ac
@@ -535,7 +535,7 @@ if test x$enable_box = xyes; then
fi
if test x$enable_opkg = xyes; then
- PKG_CHECK_MODULES(OPKG, libopkg = 0.1.2)
+ PKG_CHECK_MODULES(OPKG, libopkg = 0.1.3)
AC_SUBST(OPKG_CFLAGS)
AC_SUBST(OPKG_LIBS)
fi
commit b406efc76c30223c4327686ce97bda5a2ab99f0d
Author: Marcin Banasiak <megabajt at pld-linux.org>
Date: Fri May 9 11:27:54 2008 +0200
poldek: build fix
diff --git a/backends/poldek/pk-backend-poldek.c b/backends/poldek/pk-backend-poldek.c
index 58731f1..fdc99d3 100644
--- a/backends/poldek/pk-backend-poldek.c
+++ b/backends/poldek/pk-backend-poldek.c
@@ -1724,7 +1724,7 @@ backend_install_packages_thread (PkBackend *backend)
struct poclidek_rcmd *rcmd;
gchar *command, *nvra;
struct vf_progress vf_progress;
- gchar **package_id;
+ gchar **package_ids;
pk_backend_set_uint (backend, "ts_type", TS_TYPE_ENUM_INSTALL);
package_ids = pk_backend_get_strv (backend, "package_ids");
@@ -1739,7 +1739,7 @@ backend_install_packages_thread (PkBackend *backend)
ts = poldek_ts_new (ctx, 0);
rcmd = poclidek_rcmd_new (cctx, ts);
- nvra = poldek_get_nvra_from_package_id (package_id);
+ nvra = poldek_get_nvra_from_package_id (package_ids[0]);
command = g_strdup_printf ("install %s", nvra);
pk_backend_set_status (backend, PK_STATUS_ENUM_DEP_RESOLVE);
@@ -1762,7 +1762,7 @@ backend_install_packages_thread (PkBackend *backend)
}
static void
-backend_install_packages (PkBackend *backend, gchar *package_ids)
+backend_install_packages (PkBackend *backend, gchar **package_ids)
{
if (!pk_backend_is_online (backend)) {
pk_backend_error_code (backend, PK_ERROR_ENUM_NO_NETWORK, "Cannot install package when offline!");
@@ -1863,7 +1863,7 @@ backend_remove_packages_thread (PkBackend *backend)
gchar *nvra, *command;
gchar **package_ids;
- package_ids = pk_backend_get_string (backend, "package_ids");
+ package_ids = pk_backend_get_strv (backend, "package_ids");
pb_load_packages (backend);
/* setup callbacks */
commit 3b0065878827462519badaddbd51b2877a4d2323
Author: Richard Hughes <richard at hughsie.com>
Date: Fri May 9 09:57:01 2008 +0100
review and fix up some of the other backend problems
diff --git a/backends/apt/pk-backend-apt.c b/backends/apt/pk-backend-apt.c
index 68bed36..f59cd88 100644
--- a/backends/apt/pk-backend-apt.c
+++ b/backends/apt/pk-backend-apt.c
@@ -25,6 +25,7 @@
#include <string.h>
#include <pk-backend.h>
#include <pk-backend-spawn.h>
+#include <pk-package-ids.h>
#include "pk-apt-search.h"
#include "config.h"
@@ -137,7 +138,7 @@ backend_install_packages (PkBackend *backend, gchar **package_ids)
gchar *package_ids_temp;
/* check network state */
- if (!pk_backend_is_online (backend) {
+ if (!pk_backend_is_online (backend)) {
pk_backend_error_code (backend, PK_ERROR_ENUM_NO_NETWORK, "Cannot install when offline");
pk_backend_finished (backend);
return;
@@ -156,7 +157,7 @@ static void
backend_refresh_cache (PkBackend *backend, gboolean force)
{
/* check network state */
- if (!pk_backend_is_online (backend) {
+ if (!pk_backend_is_online (backend)) {
pk_backend_error_code (backend, PK_ERROR_ENUM_NO_NETWORK, "Cannot refresh cache whilst offline");
pk_backend_finished (backend);
return;
@@ -181,12 +182,12 @@ backend_remove_packages (PkBackend *backend, gchar **package_ids, gboolean allow
* pk_backend_update_packages:
*/
static void
-backend_update_packages (PkBackend *backend, gchar **package_id)
+backend_update_packages (PkBackend *backend, gchar **package_ids)
{
gchar *package_ids_temp;
/* check network state */
- if (!pk_backend_is_online (backend) {
+ if (!pk_backend_is_online (backend)) {
pk_backend_error_code (backend, PK_ERROR_ENUM_NO_NETWORK, "Cannot install when offline");
pk_backend_finished (backend);
return;
diff --git a/backends/apt2/pk-backend-apt2.c b/backends/apt2/pk-backend-apt2.c
index 80f9afc..4f78ec4 100644
--- a/backends/apt2/pk-backend-apt2.c
+++ b/backends/apt2/pk-backend-apt2.c
@@ -128,7 +128,7 @@ backend_install_packages (PkBackend *backend, gchar **package_ids)
static void
backend_remove_packages (PkBackend *backend, gchar **package_ids, gboolean allow_deps, gboolean autoremove)
{
- pk_backend_dbus_remove_package (dbus, package_ids, allow_deps, autoremove);
+ pk_backend_dbus_remove_packages (dbus, package_ids, allow_deps, autoremove);
}
/**
diff --git a/backends/smart/pk-backend-smart.c b/backends/smart/pk-backend-smart.c
index 007212c..9ef891c 100644
--- a/backends/smart/pk-backend-smart.c
+++ b/backends/smart/pk-backend-smart.c
@@ -115,17 +115,29 @@ backend_install_packages (PkBackend *backend, gchar **package_ids)
}
/**
+ * pk_backend_bool_to_text:
+ */
+static const gchar *
+pk_backend_bool_to_text (gboolean value)
+{
+ if (value == TRUE) {
+ return "yes";
+ }
+ return "no";
+}
+
+/**
* backend_install_files:
*/
static void
backend_install_files (PkBackend *backend, gboolean trusted, gchar **full_paths)
{
- gchar *package_ids_temp;
+ gchar *full_paths_temp;
/* send the complete list as stdin */
- package_ids_temp = pk_package_ids_to_text (package_ids, "|");
- pk_backend_spawn_helper (spawn, "install-files.py", pk_backend_bool_to_text (trusted), full_paths, NULL);
- g_free (package_ids_temp);
+ full_paths_temp = pk_package_ids_to_text (full_paths, "|");
+ pk_backend_spawn_helper (spawn, "install-files.py", pk_backend_bool_to_text (trusted), full_paths_temp, NULL);
+ g_free (full_paths_temp);
}
/**
commit 7beed5b6cc5d918f958243abcaa52872d7a7c97c
Author: Richard Hughes <richard at hughsie.com>
Date: Fri May 9 09:56:37 2008 +0100
add an OpenMoko screenshot
diff --git a/docs/html/img/assassin.png b/docs/html/img/assassin.png
new file mode 100644
index 0000000..1903dae
Binary files /dev/null and b/docs/html/img/assassin.png differ
diff --git a/docs/html/pk-screenshots.html b/docs/html/pk-screenshots.html
index 902c87a..78bd01f 100644
--- a/docs/html/pk-screenshots.html
+++ b/docs/html/pk-screenshots.html
@@ -21,6 +21,7 @@
<ul>
<li><a href="#gnome">GNOME Screenshots</a></li>
<li><a href="#kde">KDE Screenshots</a></li>
+<li><a href="#moko">OpenMoko Screenshots</a></li>
</ul>
<h1><a name="gnome">GNOME Screenshots</a></h1>
@@ -93,6 +94,11 @@
<center><img src="img/pk-opensuse-updater.png" alt="[img]"/></center>
<p class="caption">OpenSuse Updater</p>
+<h1><a name="moko">OpenMoko Screenshots</a></h1>
+
+<center><img src="img/assassin.png" alt="[img]"/></center>
+<p class="caption">Assassin</p>
+
<p>Back to the <a href="index.html">main page</a></p>
<p class="footer">
More information about the PackageKit-commit
mailing list