[packagekit] packagekit: Branch 'master' - 20 commits
Richard Hughes
hughsient at kemper.freedesktop.org
Wed Oct 24 12:15:23 PDT 2007
backends/BACKENDS | 8 -
backends/pisi/helpers/pisiBackend.py | 7 -
backends/smart/helpers/get-updates.py | 19 ++
backends/smart/helpers/install.py | 20 ++
backends/smart/helpers/smartBackend.py | 73 ++++++++--
backends/smart/helpers/update-system.py | 19 ++
backends/smart/pk-backend-smart.c | 6
client/pk-monitor.c | 29 +++-
html/pk-download.html | 2
html/pk-faq.html | 30 ++++
libpackagekit/pk-client.c | 223 +++++++++++++++++---------------
libpackagekit/pk-client.h | 2
libpackagekit/pk-job-list.c | 12 -
src/pk-engine.c | 3
14 files changed, 316 insertions(+), 137 deletions(-)
New commits:
commit c89ef10321edffbb1a689d43ee1db79a05ce8b35
Merge: 41ebb26... 102d4b6...
Author: Richard Hughes <richard at hughsie.com>
Date: Wed Oct 24 19:57:20 2007 +0100
Merge branch 'master' of git+ssh://hughsie@git.packagekit.org/srv/git/PackageKit
commit 102d4b639fc9cfd56a4927a0ab5cc8609f3c8793
Author: Ken VanDine <ken at vandine.org>
Date: Wed Oct 24 14:54:27 2007 -0400
emit updates-changed when PK_ROLE_ENUM_REFRESH_CACHE
diff --git a/src/pk-engine.c b/src/pk-engine.c
index 11cbaa7..f11a823 100644
--- a/src/pk-engine.c
+++ b/src/pk-engine.c
@@ -532,7 +532,8 @@ pk_engine_finished_cb (PkBackend *backend, PkExitEnum exit, PkEngine *engine)
/* could the update list have changed? */
if (role == PK_ROLE_ENUM_UPDATE_SYSTEM ||
- role == PK_ROLE_ENUM_UPDATE_PACKAGE) {
+ role == PK_ROLE_ENUM_UPDATE_PACKAGE ||
+ role == PK_ROLE_ENUM_REFRESH_CACHE) {
pk_debug ("emitting updates-changed tid:%s", item->tid);
g_signal_emit (engine, signals [PK_ENGINE_UPDATES_CHANGED], 0, item->tid);
}
commit 41ebb2663d9fe9cf96dd3d5a97bcb9df2dd7600f
Author: Richard Hughes <richard at hughsie.com>
Date: Wed Oct 24 19:24:53 2007 +0100
use a promiscuous client to get the errors and completions
diff --git a/client/pk-monitor.c b/client/pk-monitor.c
index e65da20..93500a0 100644
--- a/client/pk-monitor.c
+++ b/client/pk-monitor.c
@@ -30,6 +30,7 @@
#include <pk-debug.h>
#include <pk-common.h>
+#include <pk-client.h>
#include <pk-task-list.h>
#include <pk-connection.h>
@@ -46,9 +47,22 @@ pk_monitor_task_list_changed_cb (PkTaskList *tlist, gpointer data)
* pk_monitor_error_code_cb:
**/
static void
-pk_monitor_error_code_cb (PkTaskList *tlist, PkErrorCodeEnum error_code, const gchar *details, gpointer data)
+pk_monitor_error_code_cb (PkClient *client, PkErrorCodeEnum error_code, const gchar *details, gpointer data)
{
- g_print ("Error: %s : %s\n", pk_error_enum_to_text (error_code), details);
+ gchar *tid = pk_client_get_tid (client);
+ g_print ("%s\tError: %s, %s\n", tid, pk_error_enum_to_text (error_code), details);
+ g_free (tid);
+}
+
+/**
+ * pk_monitor_finished_cb:
+ **/
+static void
+pk_monitor_finished_cb (PkClient *client, PkExitEnum exit, guint runtime, gpointer data)
+{
+ gchar *tid = pk_client_get_tid (client);
+ g_print ("%s\tFinished: %s, %ims\n", tid, pk_exit_enum_to_text (exit), runtime);
+ g_free (tid);
}
/**
@@ -67,6 +81,7 @@ int
main (int argc, char *argv[])
{
PkTaskList *tlist;
+ PkClient *client;
gboolean ret;
GMainLoop *loop;
PkConnection *pconnection;
@@ -110,11 +125,16 @@ main (int argc, char *argv[])
connected = pk_connection_valid (pconnection);
pk_debug ("connected=%i", connected);
+ client = pk_client_new ();
+ pk_client_set_promiscuous (client, TRUE);
+ g_signal_connect (client, "finished",
+ G_CALLBACK (pk_monitor_finished_cb), NULL);
+ g_signal_connect (client, "error-code",
+ G_CALLBACK (pk_monitor_error_code_cb), NULL);
+
tlist = pk_task_list_new ();
g_signal_connect (tlist, "task-list-changed",
G_CALLBACK (pk_monitor_task_list_changed_cb), NULL);
- g_signal_connect (tlist, "error-code",
- G_CALLBACK (pk_monitor_error_code_cb), NULL);
pk_debug ("refreshing task list");
ret = pk_task_list_refresh (tlist);
@@ -125,6 +145,7 @@ main (int argc, char *argv[])
g_main_loop_run (loop);
+ g_object_unref (client);
g_object_unref (tlist);
g_object_unref (pconnection);
commit 15328a38568093a9119a89e6e697718dc1f987c3
Author: Richard Hughes <richard at hughsie.com>
Date: Wed Oct 24 19:23:57 2007 +0100
make returning from unintersting signals quicker - and also save the last tid for promiscous mode
diff --git a/libpackagekit/pk-client.c b/libpackagekit/pk-client.c
index 3d8a687..05db45d 100644
--- a/libpackagekit/pk-client.c
+++ b/libpackagekit/pk-client.c
@@ -56,6 +56,7 @@ struct PkClientPrivate
gboolean use_buffer;
gboolean promiscuous;
gchar *tid;
+ gchar *tid_promiscuous;
PkPackageList *package_list;
PkConnection *pconnection;
PkPolkitClient *polkit;
@@ -130,6 +131,10 @@ pk_client_set_promiscuous (PkClient *client, gboolean enabled)
gchar *
pk_client_get_tid (PkClient *client)
{
+ /* return the last thing */
+ if (client->priv->promiscuous == TRUE) {
+ return g_strdup (client->priv->tid_promiscuous);
+ }
return g_strdup (client->priv->tid);
}
@@ -261,9 +266,20 @@ pk_client_get_error_name (GError *error)
static gboolean
pk_client_should_proxy (PkClient *client, const gchar *tid)
{
+ /* are we promiscuous? */
if (client->priv->promiscuous == TRUE) {
+ g_free (client->priv->tid_promiscuous);
+ client->priv->tid_promiscuous = g_strdup (tid);
return TRUE;
}
+
+ /* check to see if we have been assigned yet */
+ if (client->priv->tid == NULL) {
+ /* silently fail to avoid cluttering up the logs */
+ return FALSE;
+ }
+
+ /* are we the right on? */
if (pk_transaction_id_equal (tid, client->priv->tid) == TRUE) {
return TRUE;
}
@@ -285,21 +301,18 @@ pk_client_finished_cb (DBusGProxy *proxy,
g_return_if_fail (client != NULL);
g_return_if_fail (PK_IS_CLIENT (client));
- /* check to see if we have been assigned yet */
- if (client->priv->tid == NULL) {
- pk_debug ("ignoring tid:%s as we are not yet assigned", tid);
+ /* not us, ignore */
+ if (pk_client_should_proxy (client, tid) == FALSE) {
return;
}
- if (pk_client_should_proxy (client, tid) == TRUE) {
- exit = pk_exit_enum_from_text (exit_text);
- pk_debug ("emit finished %s, %i", exit_text, runtime);
+ exit = pk_exit_enum_from_text (exit_text);
+ pk_debug ("emit finished %s, %i", exit_text, runtime);
- /* only this instance is finished, and do it before the signal so we can reset */
- client->priv->is_finished = TRUE;
+ /* only this instance is finished, and do it before the signal so we can reset */
+ client->priv->is_finished = TRUE;
- g_signal_emit (client , signals [PK_CLIENT_FINISHED], 0, exit, runtime);
- }
+ g_signal_emit (client , signals [PK_CLIENT_FINISHED], 0, exit, runtime);
}
/**
@@ -313,17 +326,14 @@ pk_client_progress_changed_cb (DBusGProxy *proxy, const gchar *tid,
g_return_if_fail (client != NULL);
g_return_if_fail (PK_IS_CLIENT (client));
- /* check to see if we have been assigned yet */
- if (client->priv->tid == NULL) {
- pk_debug ("ignoring tid:%s as we are not yet assigned", tid);
+ /* not us, ignore */
+ if (pk_client_should_proxy (client, tid) == FALSE) {
return;
}
- if (pk_client_should_proxy (client, tid) == TRUE) {
- pk_debug ("emit progress-changed %i, %i, %i, %i", percentage, subpercentage, elapsed, remaining);
- g_signal_emit (client , signals [PK_CLIENT_PROGRESS_CHANGED], 0,
- percentage, subpercentage, elapsed, remaining);
- }
+ pk_debug ("emit progress-changed %i, %i, %i, %i", percentage, subpercentage, elapsed, remaining);
+ g_signal_emit (client , signals [PK_CLIENT_PROGRESS_CHANGED], 0,
+ percentage, subpercentage, elapsed, remaining);
}
/**
@@ -340,17 +350,16 @@ pk_client_transaction_status_changed_cb (DBusGProxy *proxy,
g_return_if_fail (client != NULL);
g_return_if_fail (PK_IS_CLIENT (client));
- /* check to see if we have been assigned yet */
- if (client->priv->tid == NULL) {
- pk_debug ("ignoring tid:%s as we are not yet assigned", tid);
+ /* not us, ignore */
+ if (pk_client_should_proxy (client, tid) == FALSE) {
return;
}
status = pk_status_enum_from_text (status_text);
- if (pk_client_should_proxy (client, tid) == TRUE) {
- pk_debug ("emit transaction-status-changed %i", status);
- g_signal_emit (client , signals [PK_CLIENT_TRANSACTION_STATUS_CHANGED], 0, status);
- }
+
+ pk_debug ("emit transaction-status-changed %s", status_text);
+ g_signal_emit (client , signals [PK_CLIENT_TRANSACTION_STATUS_CHANGED], 0, status);
+
client->priv->last_status = status;
}
@@ -369,22 +378,19 @@ pk_client_package_cb (DBusGProxy *proxy,
g_return_if_fail (client != NULL);
g_return_if_fail (PK_IS_CLIENT (client));
- /* check to see if we have been assigned yet */
- if (client->priv->tid == NULL) {
- pk_debug ("ignoring tid:%s as we are not yet assigned", tid);
+ /* not us, ignore */
+ if (pk_client_should_proxy (client, tid) == FALSE) {
return;
}
- if (pk_client_should_proxy (client, tid) == TRUE) {
- pk_debug ("emit package %s, %s, %s", info_text, package_id, summary);
- info = pk_info_enum_from_text (info_text);
- g_signal_emit (client , signals [PK_CLIENT_PACKAGE], 0, info, package_id, summary);
+ pk_debug ("emit package %s, %s, %s", info_text, package_id, summary);
+ info = pk_info_enum_from_text (info_text);
+ g_signal_emit (client , signals [PK_CLIENT_PACKAGE], 0, info, package_id, summary);
- /* cache */
- if (client->priv->use_buffer == TRUE) {
- pk_debug ("adding to cache array package %i, %s, %s", info, package_id, summary);
- pk_package_list_add (client->priv->package_list, info, package_id, summary);
- }
+ /* cache */
+ if (client->priv->use_buffer == TRUE) {
+ pk_debug ("adding to cache array package %i, %s, %s", info, package_id, summary);
+ pk_package_list_add (client->priv->package_list, info, package_id, summary);
}
}
@@ -416,17 +422,14 @@ pk_client_transaction_cb (DBusGProxy *proxy,
g_return_if_fail (client != NULL);
g_return_if_fail (PK_IS_CLIENT (client));
- /* check to see if we have been assigned yet */
- if (client->priv->tid == NULL) {
- pk_debug ("ignoring tid:%s as we are not yet assigned", tid);
+ /* not us, ignore */
+ if (pk_client_should_proxy (client, tid) == FALSE) {
return;
}
- if (pk_client_should_proxy (client, tid) == TRUE) {
- role = pk_role_enum_from_text (role_text);
- pk_debug ("emitting transaction %s, %s, %i, %s, %i, %s", old_tid, timespec, succeeded, role_text, duration, data);
- g_signal_emit (client, signals [PK_CLIENT_TRANSACTION], 0, old_tid, timespec, succeeded, role, duration, data);
- }
+ role = pk_role_enum_from_text (role_text);
+ pk_debug ("emitting transaction %s, %s, %i, %s, %i, %s", old_tid, timespec, succeeded, role_text, duration, data);
+ g_signal_emit (client, signals [PK_CLIENT_TRANSACTION], 0, old_tid, timespec, succeeded, role, duration, data);
}
/**
@@ -446,18 +449,15 @@ pk_client_update_detail_cb (DBusGProxy *proxy,
g_return_if_fail (client != NULL);
g_return_if_fail (PK_IS_CLIENT (client));
- /* check to see if we have been assigned yet */
- if (client->priv->tid == NULL) {
- pk_debug ("ignoring tid:%s as we are not yet assigned", tid);
+ /* not us, ignore */
+ if (pk_client_should_proxy (client, tid) == FALSE) {
return;
}
- if (pk_client_should_proxy (client, tid) == TRUE) {
- pk_debug ("emit update-detail %s, %s, %s, %s, %s, %s",
- package_id, updates, obsoletes, url, restart, update_text);
- g_signal_emit (client , signals [PK_CLIENT_UPDATE_DETAIL], 0,
- package_id, updates, obsoletes, url, restart, update_text);
- }
+ pk_debug ("emit update-detail %s, %s, %s, %s, %s, %s",
+ package_id, updates, obsoletes, url, restart, update_text);
+ g_signal_emit (client , signals [PK_CLIENT_UPDATE_DETAIL], 0,
+ package_id, updates, obsoletes, url, restart, update_text);
}
/**
@@ -479,19 +479,16 @@ pk_client_description_cb (DBusGProxy *proxy,
g_return_if_fail (client != NULL);
g_return_if_fail (PK_IS_CLIENT (client));
- /* check to see if we have been assigned yet */
- if (client->priv->tid == NULL) {
- pk_debug ("ignoring tid:%s as we are not yet assigned", tid);
+ /* not us, ignore */
+ if (pk_client_should_proxy (client, tid) == FALSE) {
return;
}
- if (pk_client_should_proxy (client, tid) == TRUE) {
- group = pk_group_enum_from_text (group_text);
- pk_debug ("emit description %s, %s, %i, %s, %s, %ld, %s",
- package_id, licence, group, description, url, (long int) size, filelist);
- g_signal_emit (client , signals [PK_CLIENT_DESCRIPTION], 0,
- package_id, licence, group, description, url, size, filelist);
- }
+ group = pk_group_enum_from_text (group_text);
+ pk_debug ("emit description %s, %s, %i, %s, %s, %ld, %s",
+ package_id, licence, group, description, url, (long int) size, filelist);
+ g_signal_emit (client , signals [PK_CLIENT_DESCRIPTION], 0,
+ package_id, licence, group, description, url, size, filelist);
}
/**
@@ -506,18 +503,15 @@ pk_client_repo_signature_required_cb (DBusGProxy *proxy, const gchar *tid, const
g_return_if_fail (client != NULL);
g_return_if_fail (PK_IS_CLIENT (client));
- /* check to see if we have been assigned yet */
- if (client->priv->tid == NULL) {
- pk_debug ("ignoring tid:%s as we are not yet assigned", tid);
+ /* not us, ignore */
+ if (pk_client_should_proxy (client, tid) == FALSE) {
return;
}
- if (pk_client_should_proxy (client, tid) == TRUE) {
- pk_debug ("emit repo_signature_required tid:%s, %s, %s, %s, %s, %s, %s, %s",
- tid, repository_name, key_url, key_userid, key_id, key_fingerprint, key_timestamp, type_text);
- g_signal_emit (client, signals [PK_CLIENT_REPO_SIGNATURE_REQUIRED], 0,
- repository_name, key_url, key_userid, key_id, key_fingerprint, key_timestamp, type_text);
- }
+ pk_debug ("emit repo_signature_required tid:%s, %s, %s, %s, %s, %s, %s, %s",
+ tid, repository_name, key_url, key_userid, key_id, key_fingerprint, key_timestamp, type_text);
+ g_signal_emit (client, signals [PK_CLIENT_REPO_SIGNATURE_REQUIRED], 0,
+ repository_name, key_url, key_userid, key_id, key_fingerprint, key_timestamp, type_text);
}
/**
@@ -530,16 +524,13 @@ pk_client_repo_detail_cb (DBusGProxy *proxy, const gchar *tid, const gchar *repo
g_return_if_fail (client != NULL);
g_return_if_fail (PK_IS_CLIENT (client));
- /* check to see if we have been assigned yet */
- if (client->priv->tid == NULL) {
- pk_debug ("ignoring tid:%s as we are not yet assigned", tid);
+ /* not us, ignore */
+ if (pk_client_should_proxy (client, tid) == FALSE) {
return;
}
- if (pk_client_should_proxy (client, tid) == TRUE) {
- pk_debug ("emit repo-detail %s, %s, %i", repo_id, description, enabled);
- g_signal_emit (client, signals [PK_CLIENT_REPO_DETAIL], 0, repo_id, description, enabled);
- }
+ pk_debug ("emit repo-detail %s, %s, %i", repo_id, description, enabled);
+ g_signal_emit (client, signals [PK_CLIENT_REPO_DETAIL], 0, repo_id, description, enabled);
}
/**
@@ -556,17 +547,14 @@ pk_client_error_code_cb (DBusGProxy *proxy,
g_return_if_fail (client != NULL);
g_return_if_fail (PK_IS_CLIENT (client));
- /* check to see if we have been assigned yet */
- if (client->priv->tid == NULL) {
- pk_debug ("ignoring tid:%s as we are not yet assigned", tid);
+ /* not us, ignore */
+ if (pk_client_should_proxy (client, tid) == FALSE) {
return;
}
- if (pk_client_should_proxy (client, tid) == TRUE) {
- code = pk_error_enum_from_text (code_text);
- pk_debug ("emit error-code %i, %s", code, details);
- g_signal_emit (client , signals [PK_CLIENT_ERROR_CODE], 0, code, details);
- }
+ code = pk_error_enum_from_text (code_text);
+ pk_debug ("emit error-code %i, %s", code, details);
+ g_signal_emit (client , signals [PK_CLIENT_ERROR_CODE], 0, code, details);
}
/**
@@ -593,20 +581,17 @@ pk_client_require_restart_cb (DBusGProxy *proxy,
g_return_if_fail (client != NULL);
g_return_if_fail (PK_IS_CLIENT (client));
- /* check to see if we have been assigned yet */
- if (client->priv->tid == NULL) {
- pk_debug ("ignoring tid:%s as we are not yet assigned", tid);
+ /* not us, ignore */
+ if (pk_client_should_proxy (client, tid) == FALSE) {
return;
}
- if (pk_client_should_proxy (client, tid) == TRUE) {
- restart = pk_restart_enum_from_text (restart_text);
- pk_debug ("emit require-restart %i, %s", restart, details);
- g_signal_emit (client , signals [PK_CLIENT_REQUIRE_RESTART], 0, restart, details);
- if (restart > client->priv->require_restart) {
- client->priv->require_restart = restart;
- pk_debug ("restart status now %s", pk_restart_enum_to_text (restart));
- }
+ restart = pk_restart_enum_from_text (restart_text);
+ pk_debug ("emit require-restart %i, %s", restart, details);
+ g_signal_emit (client , signals [PK_CLIENT_REQUIRE_RESTART], 0, restart, details);
+ if (restart > client->priv->require_restart) {
+ client->priv->require_restart = restart;
+ pk_debug ("restart status now %s", pk_restart_enum_to_text (restart));
}
}
@@ -2291,6 +2276,7 @@ pk_client_init (PkClient *client)
client->priv = PK_CLIENT_GET_PRIVATE (client);
client->priv->tid = NULL;
+ client->priv->tid_promiscuous = NULL;
client->priv->use_buffer = FALSE;
client->priv->promiscuous = FALSE;
client->priv->last_status = PK_STATUS_ENUM_UNKNOWN;
@@ -2468,6 +2454,8 @@ pk_client_finalize (GObject *object)
g_free (client->priv->xcached_full_path);
g_free (client->priv->xcached_filter);
g_free (client->priv->xcached_search);
+ g_free (client->priv->tid);
+ g_free (client->priv->tid_promiscuous);
/* disconnect signal handlers */
dbus_g_proxy_disconnect_signal (client->priv->proxy, "Finished",
commit 4f957e4cf88b7138a84e2aa910f5c235fa670e0e
Author: S.ÃaÄlar Onur <caglar at pardus.org.tr>
Date: Wed Oct 24 21:07:19 2007 +0300
PiSi: Use API provided architecture name instead of hardcoding it into backend
diff --git a/backends/pisi/helpers/pisiBackend.py b/backends/pisi/helpers/pisiBackend.py
index 62793ad..94103c5 100644
--- a/backends/pisi/helpers/pisiBackend.py
+++ b/backends/pisi/helpers/pisiBackend.py
@@ -23,9 +23,6 @@ from packagekit.backend import *
class PackageKitPisiBackend(PackageKitBaseBackend):
- # Currently we only support i686
- arch = "i686"
-
def __init__(self, args):
PackageKitBaseBackend.__init__(self, args)
@@ -56,7 +53,7 @@ class PackageKitPisiBackend(PackageKitBaseBackend):
version = self.__get_package_version(pkg)
- id = self.get_package_id(pkg.name, version, self.arch, "")
+ id = self.get_package_id(pkg.name, version, pkg.architecture, "")
return self.package(id, status, pkg.summary)
def resolve(self, filter, package):
@@ -166,7 +163,7 @@ class PackageKitPisiBackend(PackageKitBaseBackend):
pkg = self.packagedb.get_package(package)
version = self.__get_package_version(pkg)
- id = self.get_package_id(pkg.name, version, self.arch, "")
+ id = self.get_package_id(pkg.name, version, pkg.architecture, "")
# Internal FIXME: PiSi must provide this information as a single API call :(
updates = [i for i in self.packagedb.get_package(package).history
commit 1e41f3fb9ee2f7ef363008de03b52c8cd9d6faef
Author: Richard Hughes <richard at hughsie.com>
Date: Wed Oct 24 18:43:46 2007 +0100
rename a signal id for completeness
diff --git a/libpackagekit/pk-job-list.c b/libpackagekit/pk-job-list.c
index 2ee83d5..f052446 100644
--- a/libpackagekit/pk-job-list.c
+++ b/libpackagekit/pk-job-list.c
@@ -54,7 +54,7 @@ struct PkJobListPrivate
};
typedef enum {
- PK_TRANSACTION_LIST_CHANGED,
+ PK_JOB_LIST_CHANGED,
PK_JOB_LIST_LAST_SIGNAL
} PkSignals;
@@ -155,7 +155,7 @@ pk_job_list_changed_cb (DBusGProxy *proxy,
}
jlist->priv->array = g_strdupv (array);
pk_debug ("emit transaction-list-changed");
- g_signal_emit (jlist , signals [PK_TRANSACTION_LIST_CHANGED], 0);
+ g_signal_emit (jlist , signals [PK_JOB_LIST_CHANGED], 0);
}
/**
@@ -168,7 +168,7 @@ pk_job_list_class_init (PkJobListClass *klass)
object_class->finalize = pk_job_list_finalize;
- signals [PK_TRANSACTION_LIST_CHANGED] =
+ signals [PK_JOB_LIST_CHANGED] =
g_signal_new ("transaction-list-changed",
G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
0, NULL, NULL, g_cclosure_marshal_VOID__VOID,
commit 745010247612437b7f6bcd1648e12f0b4ecc70cf
Author: Richard Hughes <richard at hughsie.com>
Date: Wed Oct 24 18:41:48 2007 +0100
allow PkClient to be set promiscuous, i.e. to report all activity
diff --git a/libpackagekit/pk-client.c b/libpackagekit/pk-client.c
index 981a672..3d8a687 100644
--- a/libpackagekit/pk-client.c
+++ b/libpackagekit/pk-client.c
@@ -54,6 +54,7 @@ struct PkClientPrivate
DBusGProxy *proxy;
gboolean is_finished;
gboolean use_buffer;
+ gboolean promiscuous;
gchar *tid;
PkPackageList *package_list;
PkConnection *pconnection;
@@ -101,11 +102,29 @@ G_DEFINE_TYPE (PkClient, pk_client, G_TYPE_OBJECT)
gboolean
pk_client_set_tid (PkClient *client, const gchar *tid)
{
+ if (client->priv->promiscuous == TRUE) {
+ pk_warning ("you can't set the tid on a promiscuous client");
+ return FALSE;
+ }
client->priv->tid = g_strdup (tid);
return TRUE;
}
/**
+ * pk_client_set_promiscuous:
+ **/
+gboolean
+pk_client_set_promiscuous (PkClient *client, gboolean enabled)
+{
+ if (client->priv->tid != NULL) {
+ pk_warning ("you can't set promiscuous on a tid client");
+ return FALSE;
+ }
+ client->priv->promiscuous = enabled;
+ return TRUE;
+}
+
+/**
* pk_client_get_tid:
**/
gchar *
@@ -237,6 +256,21 @@ pk_client_get_error_name (GError *error)
******************************************************************************/
/**
+ * pk_client_should_proxy:
+ */
+static gboolean
+pk_client_should_proxy (PkClient *client, const gchar *tid)
+{
+ if (client->priv->promiscuous == TRUE) {
+ return TRUE;
+ }
+ if (pk_transaction_id_equal (tid, client->priv->tid) == TRUE) {
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/**
* pk_client_finished_cb:
*/
static void
@@ -257,7 +291,7 @@ pk_client_finished_cb (DBusGProxy *proxy,
return;
}
- if (pk_transaction_id_equal (tid, client->priv->tid) == TRUE) {
+ if (pk_client_should_proxy (client, tid) == TRUE) {
exit = pk_exit_enum_from_text (exit_text);
pk_debug ("emit finished %s, %i", exit_text, runtime);
@@ -285,7 +319,7 @@ pk_client_progress_changed_cb (DBusGProxy *proxy, const gchar *tid,
return;
}
- if (pk_transaction_id_equal (tid, client->priv->tid) == TRUE) {
+ if (pk_client_should_proxy (client, tid) == TRUE) {
pk_debug ("emit progress-changed %i, %i, %i, %i", percentage, subpercentage, elapsed, remaining);
g_signal_emit (client , signals [PK_CLIENT_PROGRESS_CHANGED], 0,
percentage, subpercentage, elapsed, remaining);
@@ -313,7 +347,7 @@ pk_client_transaction_status_changed_cb (DBusGProxy *proxy,
}
status = pk_status_enum_from_text (status_text);
- if (pk_transaction_id_equal (tid, client->priv->tid) == TRUE) {
+ if (pk_client_should_proxy (client, tid) == TRUE) {
pk_debug ("emit transaction-status-changed %i", status);
g_signal_emit (client , signals [PK_CLIENT_TRANSACTION_STATUS_CHANGED], 0, status);
}
@@ -341,7 +375,7 @@ pk_client_package_cb (DBusGProxy *proxy,
return;
}
- if (pk_transaction_id_equal (tid, client->priv->tid) == TRUE) {
+ if (pk_client_should_proxy (client, tid) == TRUE) {
pk_debug ("emit package %s, %s, %s", info_text, package_id, summary);
info = pk_info_enum_from_text (info_text);
g_signal_emit (client , signals [PK_CLIENT_PACKAGE], 0, info, package_id, summary);
@@ -388,7 +422,7 @@ pk_client_transaction_cb (DBusGProxy *proxy,
return;
}
- if (pk_transaction_id_equal (tid, client->priv->tid) == TRUE) {
+ if (pk_client_should_proxy (client, tid) == TRUE) {
role = pk_role_enum_from_text (role_text);
pk_debug ("emitting transaction %s, %s, %i, %s, %i, %s", old_tid, timespec, succeeded, role_text, duration, data);
g_signal_emit (client, signals [PK_CLIENT_TRANSACTION], 0, old_tid, timespec, succeeded, role, duration, data);
@@ -418,7 +452,7 @@ pk_client_update_detail_cb (DBusGProxy *proxy,
return;
}
- if (pk_transaction_id_equal (tid, client->priv->tid) == TRUE) {
+ if (pk_client_should_proxy (client, tid) == TRUE) {
pk_debug ("emit update-detail %s, %s, %s, %s, %s, %s",
package_id, updates, obsoletes, url, restart, update_text);
g_signal_emit (client , signals [PK_CLIENT_UPDATE_DETAIL], 0,
@@ -451,7 +485,7 @@ pk_client_description_cb (DBusGProxy *proxy,
return;
}
- if (pk_transaction_id_equal (tid, client->priv->tid) == TRUE) {
+ if (pk_client_should_proxy (client, tid) == TRUE) {
group = pk_group_enum_from_text (group_text);
pk_debug ("emit description %s, %s, %i, %s, %s, %ld, %s",
package_id, licence, group, description, url, (long int) size, filelist);
@@ -478,7 +512,7 @@ pk_client_repo_signature_required_cb (DBusGProxy *proxy, const gchar *tid, const
return;
}
- if (pk_transaction_id_equal (tid, client->priv->tid) == TRUE) {
+ if (pk_client_should_proxy (client, tid) == TRUE) {
pk_debug ("emit repo_signature_required tid:%s, %s, %s, %s, %s, %s, %s, %s",
tid, repository_name, key_url, key_userid, key_id, key_fingerprint, key_timestamp, type_text);
g_signal_emit (client, signals [PK_CLIENT_REPO_SIGNATURE_REQUIRED], 0,
@@ -502,7 +536,7 @@ pk_client_repo_detail_cb (DBusGProxy *proxy, const gchar *tid, const gchar *repo
return;
}
- if (pk_transaction_id_equal (tid, client->priv->tid) == TRUE) {
+ if (pk_client_should_proxy (client, tid) == TRUE) {
pk_debug ("emit repo-detail %s, %s, %i", repo_id, description, enabled);
g_signal_emit (client, signals [PK_CLIENT_REPO_DETAIL], 0, repo_id, description, enabled);
}
@@ -528,7 +562,7 @@ pk_client_error_code_cb (DBusGProxy *proxy,
return;
}
- if (pk_transaction_id_equal (tid, client->priv->tid) == TRUE) {
+ if (pk_client_should_proxy (client, tid) == TRUE) {
code = pk_error_enum_from_text (code_text);
pk_debug ("emit error-code %i, %s", code, details);
g_signal_emit (client , signals [PK_CLIENT_ERROR_CODE], 0, code, details);
@@ -565,7 +599,7 @@ pk_client_require_restart_cb (DBusGProxy *proxy,
return;
}
- if (pk_transaction_id_equal (tid, client->priv->tid) == TRUE) {
+ if (pk_client_should_proxy (client, tid) == TRUE) {
restart = pk_restart_enum_from_text (restart_text);
pk_debug ("emit require-restart %i, %s", restart, details);
g_signal_emit (client , signals [PK_CLIENT_REQUIRE_RESTART], 0, restart, details);
@@ -2258,6 +2292,7 @@ pk_client_init (PkClient *client)
client->priv = PK_CLIENT_GET_PRIVATE (client);
client->priv->tid = NULL;
client->priv->use_buffer = FALSE;
+ client->priv->promiscuous = FALSE;
client->priv->last_status = PK_STATUS_ENUM_UNKNOWN;
client->priv->require_restart = PK_RESTART_ENUM_NONE;
client->priv->role = PK_ROLE_ENUM_UNKNOWN;
diff --git a/libpackagekit/pk-client.h b/libpackagekit/pk-client.h
index 2cd993b..21040b3 100644
--- a/libpackagekit/pk-client.h
+++ b/libpackagekit/pk-client.h
@@ -56,6 +56,8 @@ PkClient *pk_client_new (void);
gboolean pk_client_set_tid (PkClient *client,
const gchar *tid);
+gboolean pk_client_set_promiscuous (PkClient *client,
+ gboolean enabled);
gchar *pk_client_get_tid (PkClient *client);
gboolean pk_client_set_use_buffer (PkClient *client,
commit d3993d5bee613b546ae433f37ff9e806732e947d
Author: Richard Hughes <richard at hughsie.com>
Date: Wed Oct 24 18:30:24 2007 +0100
print the text in the debugging spew, not the enum integer
diff --git a/libpackagekit/pk-client.c b/libpackagekit/pk-client.c
index 19619ed..981a672 100644
--- a/libpackagekit/pk-client.c
+++ b/libpackagekit/pk-client.c
@@ -259,7 +259,7 @@ pk_client_finished_cb (DBusGProxy *proxy,
if (pk_transaction_id_equal (tid, client->priv->tid) == TRUE) {
exit = pk_exit_enum_from_text (exit_text);
- pk_debug ("emit finished %i, %i", exit, runtime);
+ pk_debug ("emit finished %s, %i", exit_text, runtime);
/* only this instance is finished, and do it before the signal so we can reset */
client->priv->is_finished = TRUE;
commit c6a5bf8d32c2a53aa4f533b5e3b8dae4d9af73ed
Author: James Bowes <jbowes at dangerouslyinc.com>
Date: Wed Oct 24 13:22:01 2007 -0400
Update faq to for latest smart status.
diff --git a/html/pk-faq.html b/html/pk-faq.html
index 277ed79..f746a39 100644
--- a/html/pk-faq.html
+++ b/html/pk-faq.html
@@ -27,13 +27,13 @@ this is the latest version of that file:
--------------------------------------------------------------------
resolve | | X | | X | | X | X |
refresh-cache | X | X | X | X | | | X |
-get-updates | X | X | | X | | | X |
-update-system | X | X | | X | | | X |
-search-name | X | X | X | X | X | | |
+get-updates | X | X | | X | | X | X |
+update-system | X | X | | X | | X | X |
+search-name | X | X | X | X | X | X | |
search-details | | X | X | X | | | |
search-file | | X | | X | | | |
search-group | | | | | | | |
-install-package | X | X | | X | X | | X |
+install-package | X | X | | X | X | X | X |
install-file | | X | | X | | | |
remove-package | X | X | | X | X | X | X |
update-package | | | | X | | | X |
commit e7b8a404938f79c5fc67ae7a5c97fa75d139cb02
Author: James Bowes <jbowes at dangerouslyinc.com>
Date: Wed Oct 24 11:26:23 2007 -0400
Update pk-download.html for smart status.
diff --git a/html/pk-download.html b/html/pk-download.html
index 71b9dd5..f5f0beb 100644
--- a/html/pk-download.html
+++ b/html/pk-download.html
@@ -96,7 +96,7 @@ For instance:
<li>box (50% complete)</li>
<li>apt (40% complete)</li>
<li>pacman/alpm (10% complete)</li>
-<li>smart (10% complete)</li>
+<li>smart (25% complete)</li>
<li>pisi (25% complete)</li>
</ul>
commit b16e9fa84367d9e830dcd385d87c348ed874893f
Author: James Bowes <jbowes at dangerouslyinc.com>
Date: Wed Oct 24 11:19:55 2007 -0400
Update BACKENDS file for smart status
diff --git a/backends/BACKENDS b/backends/BACKENDS
index 81e6cad..145b8c3 100644
--- a/backends/BACKENDS
+++ b/backends/BACKENDS
@@ -4,13 +4,13 @@ Current status of the backends
--------------------------------------------------------------------
resolve | | X | | X | | X | X |
refresh-cache | X | X | X | X | | | X |
-get-updates | X | X | | X | | Â Â | X |
-update-system | X | X | | X | | | X |
-search-name | X | X | X | X | X | | |
+get-updates | X | X | | X | | Â Â X | X |
+update-system | X | X | | X | | X | X |
+search-name | X | X | X | X | X | X | |
search-details | | X | X | X | | | |
search-file | | X | | X | | | |
search-group | | | | | | | |
-install-package | X | X | | X | X | | X |
+install-package | X | X | | X | X | X | X |
install-file | | X | | X | | | |
remove-package | X | X | | X | X | X | X |
update-package | | | | X | | | X |
commit 32cf0d7ef1651673536a6e7d9ef52ed6947175f3
Author: James Bowes <jbowes at dangerouslyinc.com>
Date: Wed Oct 24 11:13:04 2007 -0400
smart: Implement get-updates.
diff --git a/backends/smart/helpers/get-updates.py b/backends/smart/helpers/get-updates.py
new file mode 100755
index 0000000..88c7bf7
--- /dev/null
+++ b/backends/smart/helpers/get-updates.py
@@ -0,0 +1,19 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2007 Richard Hughes <richard at hughsie.com>
+# Copyright (C) 2007 James Bowes <jbowes at dangerouslyinc.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.
+
+import sys
+
+from smartBackend import PackageKitSmartBackend
+
+backend = PackageKitSmartBackend(sys.argv[1:])
+backend.get_updates()
+sys.exit(0)
diff --git a/backends/smart/helpers/smartBackend.py b/backends/smart/helpers/smartBackend.py
index 1436cf3..c830214 100644
--- a/backends/smart/helpers/smartBackend.py
+++ b/backends/smart/helpers/smartBackend.py
@@ -18,7 +18,7 @@
import smart
from packagekit.backend import PackageKitBaseBackend, INFO_INSTALLED, \
- INFO_AVAILABLE
+ INFO_AVAILABLE, INFO_NORMAL
class PackageKitSmartBackend(PackageKitBaseBackend):
@@ -79,6 +79,20 @@ class PackageKitSmartBackend(PackageKitBaseBackend):
trans.run()
self.ctrl.commitTransaction(trans, confirm=False)
+ def get_updates(self):
+ cache = self.ctrl.getCache()
+ trans = smart.transaction.Transaction(self.ctrl.getCache(),
+ smart.transaction.PolicyUpgrade)
+
+ for package in cache.getPackages():
+ if package.installed:
+ trans.enqueue(package, smart.transaction.UPGRADE)
+
+ trans.run()
+ for (package, op) in trans.getChangeSet().items():
+ if op == smart.transaction.INSTALL:
+ self._show_package(package, status=INFO_NORMAL)
+
def resolve(self, filters, packagename):
ratio, results, suggestions = self.ctrl.search(packagename)
for result in results:
@@ -93,16 +107,18 @@ class PackageKitSmartBackend(PackageKitBaseBackend):
for package in packages:
self._show_package(package)
- def _show_package(self, package):
- if package.installed:
- status = INFO_INSTALLED
- else:
- status = INFO_AVAILABLE
+ def _show_package(self, package, status=None):
+ if not status:
+ if package.installed:
+ status = INFO_INSTALLED
+ else:
+ status = INFO_AVAILABLE
version, arch = package.version.split('@')
for loader in package.loaders:
channel = loader.getChannel()
+ info = loader.getInfo(package)
self.package(self.get_package_id(package.name, version, arch,
- channel.getAlias()), status, None)
+ channel.getAlias()), status, info.getSummary())
def _process_search_results(self, results):
packages = []
diff --git a/backends/smart/pk-backend-smart.c b/backends/smart/pk-backend-smart.c
index 3934d80..a16daa5 100644
--- a/backends/smart/pk-backend-smart.c
+++ b/backends/smart/pk-backend-smart.c
@@ -37,7 +37,7 @@ PK_BACKEND_OPTIONS (
NULL, /* get_description */
NULL, /* get_requires */
NULL, /* get_update_detail */
- NULL, /* get_updates */
+ pk_backend_python_get_updates, /* get_updates */
pk_backend_python_install_package, /* install_package */
NULL, /* install_file */
NULL, /* refresh_cache */
commit 93d87044390d01091cfe9bd3ed62a1274ac2a362
Author: James Bowes <jbowes at dangerouslyinc.com>
Date: Wed Oct 24 00:26:22 2007 -0400
smart: remove unneeded calls to trans.getPolicy()
diff --git a/backends/smart/helpers/smartBackend.py b/backends/smart/helpers/smartBackend.py
index 4fcaa27..1436cf3 100644
--- a/backends/smart/helpers/smartBackend.py
+++ b/backends/smart/helpers/smartBackend.py
@@ -45,7 +45,6 @@ class PackageKitSmartBackend(PackageKitBaseBackend):
package = available[0]
trans = smart.transaction.Transaction(self.ctrl.getCache(),
smart.transaction.PolicyInstall)
- trans.getPolicy()
trans.enqueue(package, smart.transaction.INSTALL)
trans.run()
self.ctrl.commitTransaction(trans, confirm=False)
@@ -64,7 +63,6 @@ class PackageKitSmartBackend(PackageKitBaseBackend):
package = installed[0]
trans = smart.transaction.Transaction(self.ctrl.getCache(),
smart.transaction.PolicyRemove)
- trans.getPolicy()
trans.enqueue(package, smart.transaction.REMOVE)
trans.run()
self.ctrl.commitTransaction(trans, confirm=False)
commit 93aadde5a71877237214b65b962fba383bde3618
Author: James Bowes <jbowes at dangerouslyinc.com>
Date: Wed Oct 24 00:23:19 2007 -0400
smart: emit no-percentage-updates before loading the cache
diff --git a/backends/smart/helpers/smartBackend.py b/backends/smart/helpers/smartBackend.py
index abf040b..4fcaa27 100644
--- a/backends/smart/helpers/smartBackend.py
+++ b/backends/smart/helpers/smartBackend.py
@@ -25,13 +25,13 @@ class PackageKitSmartBackend(PackageKitBaseBackend):
def __init__(self, args):
PackageKitBaseBackend.__init__(self, args)
+ # FIXME: Only pulsing progress for now.
+ self.percentage(None)
+
self.ctrl = smart.init()
self.ctrl.reloadChannels()
self.ctrl.getCache()
- # FIXME: Only pulsing progress for now.
- self.percentage(None)
-
def install(self, packageid):
idparts = packageid.split(';')
packagestring = "%s-%s@%s" % (idparts[0], idparts[1], idparts[2])
commit 2d48efc9b7e57e56c2a7b455dc9bc3f807e05e4d
Author: James Bowes <jbowes at dangerouslyinc.com>
Date: Wed Oct 24 00:21:35 2007 -0400
smart: Implement update-system.
diff --git a/backends/smart/helpers/smartBackend.py b/backends/smart/helpers/smartBackend.py
index b6291e6..abf040b 100644
--- a/backends/smart/helpers/smartBackend.py
+++ b/backends/smart/helpers/smartBackend.py
@@ -69,6 +69,18 @@ class PackageKitSmartBackend(PackageKitBaseBackend):
trans.run()
self.ctrl.commitTransaction(trans, confirm=False)
+ def update_system(self):
+ cache = self.ctrl.getCache()
+ trans = smart.transaction.Transaction(self.ctrl.getCache(),
+ smart.transaction.PolicyUpgrade)
+
+ for package in cache.getPackages():
+ if package.installed:
+ trans.enqueue(package, smart.transaction.UPGRADE)
+
+ trans.run()
+ self.ctrl.commitTransaction(trans, confirm=False)
+
def resolve(self, filters, packagename):
ratio, results, suggestions = self.ctrl.search(packagename)
for result in results:
diff --git a/backends/smart/helpers/update-system.py b/backends/smart/helpers/update-system.py
new file mode 100755
index 0000000..6ba5c29
--- /dev/null
+++ b/backends/smart/helpers/update-system.py
@@ -0,0 +1,19 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2007 Richard Hughes <richard at hughsie.com>
+# Copyright (C) 2007 James Bowes <jbowes at dangerouslyinc.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.
+
+import sys
+
+from smartBackend import PackageKitSmartBackend
+
+backend = PackageKitSmartBackend(sys.argv[1:])
+backend.update_system()
+sys.exit(0)
diff --git a/backends/smart/pk-backend-smart.c b/backends/smart/pk-backend-smart.c
index 41eb8bd..3934d80 100644
--- a/backends/smart/pk-backend-smart.c
+++ b/backends/smart/pk-backend-smart.c
@@ -49,7 +49,7 @@ PK_BACKEND_OPTIONS (
NULL, /* search_group */
pk_backend_python_search_name, /* search_name */
NULL, /* update_package */
- NULL, /* update_system */
+ pk_backend_python_update_system, /* update_system */
NULL, /* get_repo_list */
NULL, /* repo_enable */
NULL /* repo_set_data */
commit 4c68afe899afdfae09ec6fb26a1c4f4498c09ea6
Author: James Bowes <jbowes at dangerouslyinc.com>
Date: Wed Oct 24 00:09:39 2007 -0400
smart: implement install-package
diff --git a/backends/smart/helpers/install.py b/backends/smart/helpers/install.py
new file mode 100755
index 0000000..d1c8c7b
--- /dev/null
+++ b/backends/smart/helpers/install.py
@@ -0,0 +1,20 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2007 Richard Hughes <richard at hughsie.com>
+# Copyright (C) 2007 James Bowes <jbowes at dangerouslyinc.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.
+
+import sys
+
+from smartBackend import PackageKitSmartBackend
+
+package = sys.argv[1]
+backend = PackageKitSmartBackend(sys.argv[1:])
+backend.install(package)
+sys.exit(0)
diff --git a/backends/smart/helpers/smartBackend.py b/backends/smart/helpers/smartBackend.py
index f71a368..b6291e6 100644
--- a/backends/smart/helpers/smartBackend.py
+++ b/backends/smart/helpers/smartBackend.py
@@ -32,6 +32,24 @@ class PackageKitSmartBackend(PackageKitBaseBackend):
# FIXME: Only pulsing progress for now.
self.percentage(None)
+ def install(self, packageid):
+ idparts = packageid.split(';')
+ packagestring = "%s-%s@%s" % (idparts[0], idparts[1], idparts[2])
+ ratio, results, suggestions = self.ctrl.search(packagestring)
+
+ packages = self._process_search_results(results)
+
+ available = [package for package in packages if not package.installed]
+ if len(available) != 1:
+ return
+ package = available[0]
+ trans = smart.transaction.Transaction(self.ctrl.getCache(),
+ smart.transaction.PolicyInstall)
+ trans.getPolicy()
+ trans.enqueue(package, smart.transaction.INSTALL)
+ trans.run()
+ self.ctrl.commitTransaction(trans, confirm=False)
+
def remove(self, allowdeps, packageid):
idparts = packageid.split(';')
diff --git a/backends/smart/pk-backend-smart.c b/backends/smart/pk-backend-smart.c
index 7e7e072..41eb8bd 100644
--- a/backends/smart/pk-backend-smart.c
+++ b/backends/smart/pk-backend-smart.c
@@ -38,7 +38,7 @@ PK_BACKEND_OPTIONS (
NULL, /* get_requires */
NULL, /* get_update_detail */
NULL, /* get_updates */
- NULL, /* install_package */
+ pk_backend_python_install_package, /* install_package */
NULL, /* install_file */
NULL, /* refresh_cache */
pk_backend_python_remove_package, /* remove_package */
commit 9384dd6195eeec7fe6a854524d53b4ec92a44a5c
Author: James Bowes <jbowes at dangerouslyinc.com>
Date: Tue Oct 23 23:51:43 2007 -0400
smart: don't try to remove non-installed packages.
diff --git a/backends/smart/helpers/smartBackend.py b/backends/smart/helpers/smartBackend.py
index 68a0e3a..f71a368 100644
--- a/backends/smart/helpers/smartBackend.py
+++ b/backends/smart/helpers/smartBackend.py
@@ -40,9 +40,10 @@ class PackageKitSmartBackend(PackageKitBaseBackend):
packages = self._process_search_results(results)
- if len(packages) != 1:
+ installed = [package for package in packages if package.installed]
+ if len(installed) != 1:
return
- package = packages[0]
+ package = installed[0]
trans = smart.transaction.Transaction(self.ctrl.getCache(),
smart.transaction.PolicyRemove)
trans.getPolicy()
commit fa7f7e63896d2e62b1bef5aa2b8e327cf82ccaff
Author: James Bowes <jbowes at dangerouslyinc.com>
Date: Tue Oct 23 23:45:57 2007 -0400
smart: return correct repo for search and resolve
diff --git a/backends/smart/helpers/smartBackend.py b/backends/smart/helpers/smartBackend.py
index 2b6565b..68a0e3a 100644
--- a/backends/smart/helpers/smartBackend.py
+++ b/backends/smart/helpers/smartBackend.py
@@ -70,8 +70,10 @@ class PackageKitSmartBackend(PackageKitBaseBackend):
else:
status = INFO_AVAILABLE
version, arch = package.version.split('@')
- self.package(self.get_package_id(package.name, version, arch,
- "installed"), status, None)
+ for loader in package.loaders:
+ channel = loader.getChannel()
+ self.package(self.get_package_id(package.name, version, arch,
+ channel.getAlias()), status, None)
def _process_search_results(self, results):
packages = []
commit 044d2c5c8892853851ec11555933537a9394770f
Author: Richard Hughes <richard at hughsie.com>
Date: Wed Oct 24 18:14:28 2007 +0100
it's not an warning case if pk isn't active, as we just trivially start it - kill a warning in libpackagekit
diff --git a/libpackagekit/pk-job-list.c b/libpackagekit/pk-job-list.c
index 18aeb28..2ee83d5 100644
--- a/libpackagekit/pk-job-list.c
+++ b/libpackagekit/pk-job-list.c
@@ -113,7 +113,7 @@ pk_job_list_refresh (PkJobList *jlist)
G_TYPE_INVALID,
G_TYPE_STRV, &array,
G_TYPE_INVALID);
- if (error) {
+ if (error != NULL) {
pk_debug ("ERROR: %s", error->message);
g_error_free (error);
}
@@ -213,7 +213,7 @@ pk_job_list_init (PkJobList *jlist)
/* check dbus connections, exit if not valid */
jlist->priv->connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
- if (error) {
+ if (error != NULL) {
pk_warning ("%s", error->message);
g_error_free (error);
g_error ("This program cannot start until you start the dbus system service.");
@@ -229,7 +229,7 @@ pk_job_list_init (PkJobList *jlist)
if (pk_connection_valid (jlist->priv->pconnection)) {
pk_job_list_connect (jlist);
} else {
- pk_warning ("no PK instance on the bus");
+ pk_debug ("no PK instance on the bus yet");
}
/* get a connection */
commit 14258fecf75a7bde04323530a98a5b51bb02258b
Author: Richard Hughes <richard at hughsie.com>
Date: Wed Oct 24 17:43:57 2007 +0100
add a question I get asked all the time....
diff --git a/html/pk-faq.html b/html/pk-faq.html
index d016814..277ed79 100644
--- a/html/pk-faq.html
+++ b/html/pk-faq.html
@@ -17,6 +17,36 @@
<h1>Frequently asked questions</h1>
+<h3>How complete is backend ${FOO}?</h3>
+<p>
+Backends are updated all the time, so it's best to see the BACKENDS file in git -
+this is the latest version of that file:
+</p>
+<pre>
+ | conary | yum | apt | box | alpm | smart | pisi |
+--------------------------------------------------------------------
+resolve | | X | | X | | X | X |
+refresh-cache | X | X | X | X | | | X |
+get-updates | X | X | | X | | | X |
+update-system | X | X | | X | | | X |
+search-name | X | X | X | X | X | | |
+search-details | | X | X | X | | | |
+search-file | | X | | X | | | |
+search-group | | | | | | | |
+install-package | X | X | | X | X | | X |
+install-file | | X | | X | | | |
+remove-package | X | X | | X | X | X | X |
+update-package | | | | X | | | X |
+get-depends | | X | | X | | | X |
+get-requires | X | | | X | | | X |
+get-description | X | X | X | X | | | X |
+get-update-detail | | | | | | | |
+get-repo-list | | X | | | X | | X |
+repo-enable | | X | | | | | |
+repo-set-data | | | | | | | |
+cancel-transaction| | | | | | | |
+</pre>
+
<h3>What if the backend package manager doesn't support percentage updates?</h3>
<p>
You don't have to have a backend that supports percentage updates.
More information about the PackageKit
mailing list