[packagekit] [PATCH] use resolve with pkcon update
S.Çağlar Onur
caglar at pardus.org.tr
Tue Oct 23 01:55:55 PDT 2007
Hi;
Following patch adds resolve support to pkcon so "pkcon update python" works as expected :)
client/pk-console.c | 20 +++++++++++++++++++-
1 files changed, 19 insertions(+), 1 deletions(-)
diff --git a/client/pk-console.c b/client/pk-console.c
index 0abe0e2..62d5fda 100644
--- a/client/pk-console.c
+++ b/client/pk-console.c
@@ -428,6 +428,24 @@ pk_console_remove_package (PkClient *client, const gchar *package)
}
/**
+ * pk_console_update_package:
+ **/
+static gboolean
+pk_console_update_package (PkClient *client, const gchar *package)
+{
+ gboolean ret;
+ gchar *package_id;
+ package_id = pk_console_perhaps_resolve (client, PK_FILTER_ENUM_INSTALLED, package);
+ if (package_id == NULL) {
+ g_print ("Could not find a package with that name to update\n");
+ return FALSE;
+ }
+ ret = pk_client_update_package (client, package_id);
+ g_free (package_id);
+ return ret;
+}
+
+/**
* pk_console_process_commands:
**/
static gboolean
@@ -501,7 +519,7 @@ pk_console_process_commands (PkClient *client, int argc, char *argv[], gboolean
g_set_error (error, 0, 0, "you need to specify a package to update");
return FALSE;
} else {
- wait = pk_client_update_package (client, value);
+ wait = pk_console_update_package (client, value);
}
} else if (strcmp (mode, "resolve") == 0) {
if (value == NULL) {
Cheers
--
S.Çağlar Onur <caglar at pardus.org.tr>
http://cekirdek.pardus.org.tr/~caglar/
Linux is like living in a teepee. No Windows, no Gates and an Apache in house!
More information about the PackageKit
mailing list