Blob Blame History Raw
commit 78a591b9942afa19f6e21ac987a70af8a9faa05b
Author: Richard Hughes <richard@hughsie.com>
Date:   Tue Nov 10 20:47:25 2009 +0000

    cnf: when we search for available files, use our preferred arch. Fixes rh#534169

diff --git a/contrib/command-not-found/pk-command-not-found.c b/contrib/command-not-found/pk-command-not-found.c
index ee16e43..88b7da7 100644
--- a/contrib/command-not-found/pk-command-not-found.c
+++ b/contrib/command-not-found/pk-command-not-found.c
@@ -413,7 +413,9 @@ pk_cnf_find_available (const gchar *cmd)
 		values[i] = g_build_filename (prefixes[i], cmd, NULL);
 
 	/* do search */
-	filters = pk_bitfield_from_enums (PK_FILTER_ENUM_NOT_INSTALLED, PK_FILTER_ENUM_NEWEST, -1);
+	filters = pk_bitfield_from_enums (PK_FILTER_ENUM_NOT_INSTALLED,
+					  PK_FILTER_ENUM_NEWEST,
+					  PK_FILTER_ENUM_ARCH, -1);
 	results = pk_client_search_file (PK_CLIENT(task), filters, values, cancellable,
 					 (PkProgressCallback) pk_cnf_progress_cb, NULL, &error);
 	if (results == NULL) {
commit 12bafbe62e16dcd07f1573807629d830199a868d
Author: Richard Hughes <richard@hughsie.com>
Date:   Thu Nov 5 10:34:25 2009 +0000

    cnf: handle the error condition where the package name would be invalid. Fixes rh#533014

diff --git a/contrib/command-not-found/pk-command-not-found.c b/contrib/command-not-found/pk-command-not-found.c
index 3b91e15..4e3f4b3 100644
--- a/contrib/command-not-found/pk-command-not-found.c
+++ b/contrib/command-not-found/pk-command-not-found.c
@@ -752,6 +752,10 @@ main (int argc, char *argv[])
 	/* only search using PackageKit if configured to do so */
 	} else if (config->software_source_search) {
 		package_ids = pk_cnf_find_available (argv[1]);
+		if (package_ids == NULL) {
+			g_print ("\n");
+			goto out;
+		}
 		len = g_strv_length (package_ids);
 		if (len == 1) {
 			parts = pk_package_id_split (package_ids[0]);
commit fec9a2ace5bbe7d3656c9ea12d6d9713cb15fa3f
Author: Richard Hughes <richard@hughsie.com>
Date:   Tue Oct 20 08:55:05 2009 +0100

    cnf: don't exit before we try to search if no alternatives were found