[PackageKit-commit] packagekit: Branch 'master' - 16 commits

Richard Hughes hughsient at kemper.freedesktop.org
Thu Mar 5 06:09:28 PST 2009


 backends/conary/XMLCache.py                    |   38 
 backends/conary/conaryBackend.py               |   23 
 backends/yum/yumBackend.py                     |   94 +
 contrib/app-install/.gitignore                 |    4 
 contrib/app-install/Makefile.am                |   22 
 contrib/app-install/README                     |    5 
 contrib/app-install/pk-app-install-add.c       |  363 ++-----
 contrib/app-install/pk-app-install-common.h    |    9 
 contrib/app-install/pk-app-install-create.c    |    3 
 contrib/app-install/pk-app-install-generate.c  |  643 +++++++++----
 contrib/app-install/pk-app-install-remove.c    |   54 -
 data/tests/test.catalog                        |    4 
 docs/app-install-v1.draft                      |   22 
 lib/packagekit-glib/pk-client.c                |   11 
 lib/packagekit-qt/src/CMakeLists.txt           |    2 
 po/pa.po                                       | 1179 +++++++++++++++++++------
 src/org.freedesktop.PackageKit.Transaction.xml |    2 
 src/pk-time.c                                  |    2 
 18 files changed, 1665 insertions(+), 815 deletions(-)

New commits:
commit ca9daa802ab4abddbc25c464676c01c4a2ec8941
Author: Richard Hughes <richard at hughsie.com>
Date:   Thu Mar 5 13:28:39 2009 +0000

    trivial: more app-install hacking, now everything half-works

diff --git a/contrib/app-install/.gitignore b/contrib/app-install/.gitignore
index b4df60c..603e341 100644
--- a/contrib/app-install/.gitignore
+++ b/contrib/app-install/.gitignore
@@ -3,5 +3,9 @@
 *.o
 pk-app-install-create
 pk-app-install-remove
+pk-app-install-add
+pk-app-install-generate
 *.db
+*.sh
+dist
 
diff --git a/contrib/app-install/Makefile.am b/contrib/app-install/Makefile.am
index 2d67173..834aa4b 100644
--- a/contrib/app-install/Makefile.am
+++ b/contrib/app-install/Makefile.am
@@ -4,16 +4,20 @@ AUTOMAKE_OPTIONS = 1.7
 INCLUDES =						\
 	$(GLIB_CFLAGS)					\
 	$(GIO_CFLAGS)					\
+	$(DBUS_CFLAGS)					\
 	$(SQLITE_CFLAGS)				\
 	-DPACKAGE_LOCALE_DIR=\"$(localedir)\"		\
 	-DSYSCONFDIR=\""$(sysconfdir)"\" 		\
-	-DDATADIR=\""$(datadir)"\" 		\
+	-DDATADIR=\""$(datadir)"\" 			\
+	-DLOCALSTATEDIR=\""$(localstatedir)"\" 		\
 	-DEGG_LOG_FILE=\""$(PK_LOG_DIR)/PackageKit"\"	\
 	-DEGG_VERBOSE="\"PK_VERBOSE\""			\
 	-DEGG_LOGGING="\"PK_LOGGING\""			\
 	-DEGG_CONSOLE="\"PK_CONSOLE\""			\
 	-I$(top_srcdir)/lib
 
+PK_GLIB_LIBS = $(top_builddir)/lib/packagekit-glib/libpackagekit-glib.la
+
 noinst_PROGRAMS = pk-app-install-add pk-app-install-generate
 
 sbin_PROGRAMS = pk-app-install-create pk-app-install-remove
@@ -24,7 +28,7 @@ pk_app_install_create_SOURCES =				\
 	pk-app-install-create.c				\
 	pk-app-install-common.h				\
 	$(NULL)
-pk_app_install_create_LDADD = $(GLIB_LIBS) $(SQLITE_LIBS)
+pk_app_install_create_LDADD = $(GIO_LIBS) $(GLIB_LIBS) $(SQLITE_LIBS)
 pk_app_install_create_CFLAGS = $(WARNINGFLAGS_C)
 
 pk_app_install_remove_SOURCES =				\
@@ -51,6 +55,13 @@ pk_app_install_generate_SOURCES =			\
 	pk-app-install-generate.c			\
 	pk-app-install-common.h				\
 	$(NULL)
-pk_app_install_generate_LDADD = $(GLIB_LIBS) $(SQLITE_LIBS)
+pk_app_install_generate_LDADD = $(GIO_LIBS) $(GLIB_LIBS) $(SQLITE_LIBS) $(PK_GLIB_LIBS)
 pk_app_install_generate_CFLAGS = $(WARNINGFLAGS_C)
 
+install-data-hook:
+	if test -w $(DESTDIR)$(prefix)/; then \
+		mkdir -p $(DESTDIR)$(localstatedir)/lib/app-install/icons; \
+		mkdir -p $(DESTDIR)$(datadir)/app-install/icons; \
+		mkdir -p $(DESTDIR)$(datadir)/app-install/desktop; \
+	fi
+
diff --git a/contrib/app-install/README b/contrib/app-install/README
new file mode 100644
index 0000000..d69da4a
--- /dev/null
+++ b/contrib/app-install/README
@@ -0,0 +1,5 @@
+./pk-app-install-create --verbose
+./pk-app-install-generate --verbose --repo=fedora --outputdir=./dist/icons --cache=./dist/livna.sqldata
+./pk-app-install-add --verbose --repo=fedora --icondir=./dist/icons --source=./dist/livna.sqldata
+./pk-app-install-remove --verbose --repo=fedora --icondir=./dist/icons
+
diff --git a/contrib/app-install/pk-app-install-add.c b/contrib/app-install/pk-app-install-add.c
index 286b882..8172425 100644
--- a/contrib/app-install/pk-app-install-add.c
+++ b/contrib/app-install/pk-app-install-add.c
@@ -29,13 +29,7 @@
 #include "pk-app-install-common.h"
 #include "egg-debug.h"
 
-#if PK_BUILD_LOCAL
-#define PK_APP_INSTALL_DEFAULT_DATABASE "./desktop.db"
-#else
-#define PK_APP_INSTALL_DEFAULT_DATABASE DATADIR "/app-install/cache/desktop.db"
-#endif
-
-const gchar *icon_sizes[] = { "22x22", "24x24", "32x32", "48x48", "scalable", NULL };
+static const gchar *icon_sizes[] = { "22x22", "24x24", "32x32", "48x48", "scalable", NULL };
 
 /**
  * pk_app_install_add_get_number_sqlite_cb:
@@ -65,6 +59,7 @@ pk_app_install_add_copy_icons_sqlite_cb (void *data, gint argc, gchar **argv, gc
 	GFile *remote;
 	const gchar *icondir = (const gchar *) data;
 	gboolean ret;
+	gchar *icon_name_full;
 	GError *error = NULL;
 
 	for (i=0; i<(guint)argc; i++) {
@@ -78,14 +73,15 @@ pk_app_install_add_copy_icons_sqlite_cb (void *data, gint argc, gchar **argv, gc
 	if (application_id == NULL || icon_name == NULL)
 		goto out;
 
-	egg_debug ("removing icons for application: %s", application_id);
+	egg_debug ("copying icon %s for application: %s", icon_name, application_id);
+	icon_name_full = g_strdup_printf ("%s.png", icon_name);
 
 	/* copy all icon sizes if they exist */
 	for (i=0; icon_sizes[i] != NULL; i++) {
-		path = g_build_filename (icondir, icon_sizes[i], icon_name, NULL);
+		path = g_build_filename (icondir, icon_sizes[i], icon_name_full, NULL);
 		ret = g_file_test (path, G_FILE_TEST_EXISTS);
 		if (ret) {
-			dest = g_build_filename (PK_APP_INSTALL_DEFAULT_ICONDIR, icon_sizes[i], icon_name, NULL);
+			dest = g_build_filename (PK_APP_INSTALL_DEFAULT_ICONDIR, icon_sizes[i], icon_name_full, NULL);
 			egg_debug ("copying file %s to %s", path, dest);
 			file = g_file_new_for_path (path);
 			remote = g_file_new_for_path (dest);
@@ -97,9 +93,12 @@ pk_app_install_add_copy_icons_sqlite_cb (void *data, gint argc, gchar **argv, gc
 			g_object_unref (file);
 			g_object_unref (remote);
 			g_free (dest);
+		} else {
+			egg_debug ("failed to find icon %s", path);
 		}
 		g_free (path);
 	}
+	g_free (icon_name_full);
 out:
 	return 0;
 }
@@ -122,7 +121,7 @@ main (int argc, char *argv[])
 	gint rc;
 	guint number = 0;
 	gchar *statement;
-	gchar *contents;
+	gchar *contents = NULL;
 	gboolean ret;
 	GError *error = NULL;
 
@@ -156,6 +155,7 @@ main (int argc, char *argv[])
 	g_option_context_parse (context, &argc, &argv, NULL);
 	g_option_context_free (context);
 
+	g_type_init ();
 	egg_debug_init (verbose);
 
 	egg_debug ("cache=%s, source=%s, repo=%s, icondir=%s", cache, source, repo, icondir);
@@ -220,6 +220,14 @@ main (int argc, char *argv[])
 		goto out;
 	}
 
+	/* don't sync */
+	rc = sqlite3_exec (db, "PRAGMA synchronous=OFF", NULL, NULL, NULL);
+	if (rc) {
+		egg_warning ("Can't turn off sync: %s\n", sqlite3_errmsg (db));
+		retval = 1;
+		goto out;
+	}
+
 	/* copy all the applications and translations into remote db */
 	rc = sqlite3_exec (db, contents, NULL, NULL, &error_msg);
 	if (rc != SQLITE_OK) {
diff --git a/contrib/app-install/pk-app-install-common.h b/contrib/app-install/pk-app-install-common.h
index f74710c..704b8a3 100644
--- a/contrib/app-install/pk-app-install-common.h
+++ b/contrib/app-install/pk-app-install-common.h
@@ -22,12 +22,9 @@
 #ifndef __PK_APP_INSTALL_COMMON_H
 #define __PK_APP_INSTALL_COMMON_H
 
-#if PK_BUILD_LOCAL
-#define PK_APP_INSTALL_DEFAULT_DATABASE		"./desktop.db"
-#define PK_APP_INSTALL_DEFAULT_ICONDIR		"./icons"
-#else
-#define PK_APP_INSTALL_DEFAULT_DATABASE		DATADIR "/app-install/cache/desktop.db"
+#define PK_APP_INSTALL_DEFAULT_DATABASE		LOCALSTATEDIR "/lib/app-install/desktop.db"
 #define PK_APP_INSTALL_DEFAULT_ICONDIR		DATADIR "/app-install/icons"
-#endif
+#define PK_APP_INSTALL_DEFAULT_APPICONDIR	DATADIR "/icons/hicolor/"
+#define PK_APP_INSTALL_DEFAULT_APPDIR		"/usr/share/applications"
 
 #endif /* __PK_APP_INSTALL_COMMON_H */
diff --git a/contrib/app-install/pk-app-install-create.c b/contrib/app-install/pk-app-install-create.c
index fada8dd..df06ce6 100644
--- a/contrib/app-install/pk-app-install-create.c
+++ b/contrib/app-install/pk-app-install-create.c
@@ -101,7 +101,7 @@ main (int argc, char *argv[])
 		statement = "CREATE TABLE applications ("
 			    "application_id TEXT primary key,"
 			    "package_name TEXT,"
-			    "group_id TEXT,"
+			    "categories TEXT,"
 			    "repo_id TEXT,"
 			    "icon_name TEXT,"
 			    "application_name TEXT,"
diff --git a/contrib/app-install/pk-app-install-generate.c b/contrib/app-install/pk-app-install-generate.c
index 68764b2..97ac05f 100644
--- a/contrib/app-install/pk-app-install-generate.c
+++ b/contrib/app-install/pk-app-install-generate.c
@@ -24,198 +24,346 @@
 #include <string.h>
 #include <glib/gi18n.h>
 #include <sqlite3.h>
+#include <gio/gio.h>
+#include <packagekit-glib/packagekit.h>
 
+#include "pk-app-install-common.h"
 #include "egg-debug.h"
 
-#if PK_BUILD_LOCAL
-#define PK_APP_INSTALL_DEFAULT_DATABASE "./desktop.db"
-#else
-#define PK_APP_INSTALL_DEFAULT_DATABASE DATADIR "/app-install/cache/desktop.db"
-#endif
-
-#if 0
+static const gchar *icon_sizes[] = { "22x22", "24x24", "32x32", "48x48", "scalable", NULL };
+static PkDesktop *desktop;
 
 /**
- * pk_app_install_create:
+ * pk_app_install_generate_create_icon_directories:
  **/
 static gboolean
-pk_app_install_create (const gchar *cache)
+pk_app_install_generate_create_icon_directories (const gchar *directory)
 {
-	gboolean ret = TRUE;
-	gboolean create_file;
-	const gchar *statement;
-	sqlite3 *db = NULL;
-	gint rc;
-
-	/* if the database file was not installed (or was nuked) recreate it */
-	create_file = g_file_test (cache, G_FILE_TEST_EXISTS);
-	if (create_file == TRUE) {
-		egg_warning ("already exists");
-		goto out;
+	gboolean ret;
+	GError *error = NULL;
+	GFile *file;
+	gchar *path;
+	guint i;
+
+	for (i=0; icon_sizes[i] != NULL; i++) {
+		path = g_build_filename (directory, icon_sizes[i], NULL);
+		ret = g_file_test (path, G_FILE_TEST_IS_DIR);
+		if (!ret) {
+			egg_debug ("creating %s", path);
+			file = g_file_new_for_path (path);
+			ret = g_file_make_directory (file, NULL, &error);
+			if (!ret) {
+				egg_warning ("cannot create %s: %s", path, error->message);
+				g_clear_error (&error);
+			}
+			g_object_unref (file);
+		}
+		g_free (path);
 	}
+	return ret;
+}
 
-	egg_debug ("exists: %i", create_file);
-
-	/* open database */
-	rc = sqlite3_open (cache, &db);
-	if (rc) {
-		egg_warning ("Can't open database: %s\n", sqlite3_errmsg (db));
-		ret = FALSE;
+/**
+ * pk_app_install_generate_get_desktop_files:
+ **/
+static GPtrArray *
+pk_app_install_generate_get_desktop_files (const gchar *directory)
+{
+	GPtrArray *files = NULL;
+	GError *error = NULL;
+	const gchar *filename;
+	GDir *dir;
+
+	dir = g_dir_open (directory, 0, &error);
+	if (dir == NULL) {
+		egg_warning ("cannot open directory %s: %s", directory, error->message);
+		g_error_free (error);
 		goto out;
 	}
 
-	/* don't sync */
-	statement = "PRAGMA synchronous=OFF";
-	rc = sqlite3_exec (db, statement, NULL, NULL, NULL);
-	if (rc) {
-		egg_warning ("Can't turn off sync: %s\n", sqlite3_errmsg (db));
-		ret = FALSE;
-		goto out;
+	files = g_ptr_array_new ();
+	filename = g_dir_read_name (dir);
+	while (filename != NULL) {
+		if (g_str_has_suffix (filename, ".desktop"))
+			g_ptr_array_add (files, g_build_filename (directory, filename, NULL));
+		filename = g_dir_read_name (dir);
 	}
+out:
+	g_dir_close (dir);
+	return files;
+}
 
-	egg_debug ("create");
-	if (create_file == FALSE) {
-		statement = "CREATE TABLE general ("
-			    "application_id TEXT primary key,"
-			    "package_name TEXT,"
-			    "group_id TEXT,"
-			    "repo_name TEXT,"
-			    "application_name TEXT,"
-			    "application_summary TEXT);";
-		rc = sqlite3_exec (db, statement, NULL, NULL, NULL);
-		if (rc) {
-			egg_warning ("Can't create general table: %s\n", sqlite3_errmsg (db));
-			ret = FALSE;
-			goto out;
-		}
-		statement = "CREATE TABLE localised ("
-			    "application_id TEXT primary key,"
-			    "application_name TEXT,"
-			    "application_summary TEXT,"
-			    "locale TEXT);";
-		rc = sqlite3_exec (db, statement, NULL, NULL, NULL);
-		if (rc) {
-			egg_warning ("Can't create localised table: %s\n", sqlite3_errmsg (db));
-			ret = FALSE;
-			goto out;
-		}
-	}
 
-out:
-	if (db != NULL)
-		sqlite3_close (db);
-	return ret;
+typedef struct {
+	gchar	*key;
+	gchar	*value;
+	gchar	*locale;
+} PkDesktopData;
+
+/**
+ * pk_app_install_generate_desktop_data_free:
+ **/
+static void
+pk_app_install_generate_desktop_data_free (PkDesktopData *data)
+{
+	g_free (data->key);
+	g_free (data->value);
+	g_free (data->locale);
+	g_free (data);
 }
 
 /**
- * pk_app_install_remove_icons_sqlite_cb:
+ * pk_app_install_generate_get_desktop_data:
  **/
-static gint
-pk_app_install_remove_icons_sqlite_cb (void *data, gint argc, gchar **argv, gchar **col_name)
+static GPtrArray *
+pk_app_install_generate_get_desktop_data (const gchar *filename)
 {
-	gint i;
-	gchar *col;
-	gchar *value;
-	const gchar *application_id = NULL;
-	gchar *path;
-	gchar *filename;
-	const gchar *icondir = (const gchar *) data;
-
-	for (i=0; i<argc; i++) {
-		col = col_name[i];
-		value = argv[i];
-		if (g_strcmp0 (col, "application_id") == 0)
-			application_id = value;
-	}
-	if (application_id == NULL)
+	gboolean ret;
+	GError *error = NULL;
+	GPtrArray *data = NULL;
+	gchar *contents = NULL;
+	gchar **lines;
+	gchar **parts;
+	guint i, len;
+	PkDesktopData *obj;
+
+	/* get all the contents */
+	ret = g_file_get_contents (filename, &contents, NULL, &error);
+	if (!ret) {
+		egg_warning ("cannot read source file: %s", error->message);
+		g_error_free (error);
 		goto out;
+	}
 
-	egg_warning ("application_id=%s", application_id);
-	filename = g_strdup_printf ("%s.png", application_id);
-	path = g_build_filename (icondir, "48x48", filename, NULL);
-
-//	g_unlink (path);
-	egg_warning ("path=%s", path);
-
-	g_free (filename);
-	g_free (path);
+	data = g_ptr_array_new ();
+
+	/* split lines and extract data */
+	lines = g_strsplit (contents, "\n", -1);
+	for (i=0; lines[i] != NULL; i++) {
+		parts = g_strsplit_set (lines[i], "=[]", -1);
+		len = g_strv_length (parts);
+		if (len == 2) {
+			obj = g_new0 (PkDesktopData, 1);
+			obj->key = g_strdup (parts[0]);
+			obj->value = g_strdup (parts[1]);
+			g_ptr_array_add (data, obj);
+		} else if (len == 4) {
+			obj = g_new0 (PkDesktopData, 1);
+			obj->key = g_strdup (parts[0]);
+			obj->locale = g_strdup (parts[1]);
+			obj->value = g_strdup (parts[3]);
+			g_ptr_array_add (data, obj);
+		}
+		g_strfreev (parts);
+	}
+	g_strfreev (lines);
 out:
-	return 0;
+	return data;
 }
 
 /**
- * pk_app_install_remove:
+ * pk_app_install_generate_get_value_for_locale:
  **/
-static gboolean
-pk_app_install_remove (const gchar *cache, const gchar *icondir, const gchar *repo)
+static gchar *
+pk_app_install_generate_get_value_for_locale (GPtrArray *data, const gchar *key, const gchar *locale)
 {
-	gboolean ret = TRUE;
-	gchar *statement = NULL;
-	sqlite3 *db = NULL;
-	gchar *error_msg;
-	gint rc;
-
-	/* open database */
-	rc = sqlite3_open (cache, &db);
-	if (rc) {
-		egg_warning ("Can't open database: %s\n", sqlite3_errmsg (db));
-		ret = FALSE;
-		goto out;
+	guint i;
+	gchar *value = NULL;
+	const PkDesktopData *obj;
+
+	/* find data matching key name and locale */
+	for (i=0; i<data->len; i++) {
+		obj = g_ptr_array_index (data, i);
+		if (g_strcmp0 (key, obj->key) == 0 && g_strcmp0 (locale, obj->locale) == 0) {
+			value = g_strdup (obj->value);
+			break;
+		}
 	}
+	return value;
+}
 
-	/* remove icons */
-	if (icondir != NULL) {
-		statement = g_strdup_printf ("SELECT application_id FROM general WHERE repo_name = '%s'", repo);
-		rc = sqlite3_exec (db, statement, pk_app_install_remove_icons_sqlite_cb, (void*) icondir, &error_msg);
-		g_free (statement);
-		if (rc != SQLITE_OK) {
-			egg_warning ("SQL error: %s\n", error_msg);
-			sqlite3_free (error_msg);
-			return 0;
+/**
+ * pk_app_install_generate_get_locales:
+ **/
+static GPtrArray *
+pk_app_install_generate_get_locales (GPtrArray *data)
+{
+	guint i, j;
+	GPtrArray *locales;
+	const PkDesktopData *obj;
+
+	/* find data matching key name and locale */
+	locales = g_ptr_array_new ();
+	for (i=0; i<data->len; i++) {
+		obj = g_ptr_array_index (data, i);
+
+		/* no point */
+		if (obj->locale == NULL)
+			continue;
+
+		/* is already in locale list */
+		for (j=0; j<locales->len; j++) {
+			if (g_strcmp0 (obj->locale, g_ptr_array_index (locales, j)) == 0)
+				break;
 		}
+		/* not already there */
+		if (j == locales->len)
+			g_ptr_array_add (locales, g_strdup (obj->locale));
 	}
+	return locales;
+}
 
-	/* delete from localised (localised has no repo_name, so key off general) */
-	statement = g_strdup_printf ("DELETE FROM localised WHERE EXISTS ( "
-				      "SELECT general.application_id FROM general WHERE "
-				      "general.application_id = general.application_id AND general.repo_name = '%s')", repo);
-//	statement = g_strdup_printf ("SELECT general.application_id FROM general WHERE general.application_id == general.application_id AND general.repo_name == '%s'", repo);
-	rc = sqlite3_exec (db, statement, NULL, NULL, NULL);
-	if (rc) {
-		egg_warning ("Can't remove rows: %s\n", sqlite3_errmsg (db));
-		ret = FALSE;
-		goto out;
+/**
+ * pk_app_install_generate_get_package_for_file:
+ **/
+static gchar *
+pk_app_install_generate_get_package_for_file (const gchar *filename)
+{
+	gchar *package;
+	GError *error = NULL;
+
+	/* get package providing file */
+	package = pk_desktop_get_package_for_file (desktop, filename, &error);
+	if (package == NULL) {
+		egg_warning ("failed to get package for %s: %s", filename, error->message);
+		g_error_free (error);
 	}
-	egg_debug ("%i removals from localised", sqlite3_changes (db));
-	g_free (statement);
-
-	/* delete from general */
-	statement = g_strdup_printf ("DELETE FROM general WHERE repo_name = '%s'", repo);
-	rc = sqlite3_exec (db, statement, NULL, NULL, NULL);
-	if (rc) {
-		egg_warning ("Can't remove rows: %s\n", sqlite3_errmsg (db));
-		ret = FALSE;
-		goto out;
+	return package;
+}
+
+/**
+ * pk_app_install_generate_get_application_id:
+ **/
+static gchar *
+pk_app_install_generate_get_application_id (const gchar *filename)
+{
+	gchar *find;
+	gchar *application_id;
+
+	find = g_strrstr (filename, "/");
+	application_id = g_strdup (find+1);
+	find = g_strrstr (application_id, ".");
+	*find = '\0';
+	return application_id;
+}
+
+/**
+ * pk_app_install_generate_applications_sql:
+ **/
+static gchar *
+pk_app_install_generate_applications_sql (GPtrArray *data, const gchar *repo, const gchar *package, const gchar *application_id)
+{
+	GString *sql;
+	gchar *name = NULL;
+	gchar *comment = NULL;
+	gchar *icon_name = NULL;
+	gchar *categories = NULL;
+	gchar *escaped;
+
+	sql = g_string_new ("");
+	name = pk_app_install_generate_get_value_for_locale (data, "Name", NULL);
+	icon_name = pk_app_install_generate_get_value_for_locale (data, "Icon", NULL);
+	comment = pk_app_install_generate_get_value_for_locale (data, "Comment", NULL);
+	categories = pk_app_install_generate_get_value_for_locale (data, "Categories", NULL);
+
+	/* remove invalid icons */
+	if (icon_name != NULL &&
+	    (g_str_has_prefix (icon_name, "/") ||
+	     g_str_has_suffix (icon_name, ".png"))) {
+		g_free (icon_name);
+		icon_name = NULL;
 	}
-	egg_debug ("%i removals from general", sqlite3_changes (db));
-	g_free (statement);
-
-	/* reclaim memory */
-	statement = g_strdup ("VACUUM");
-	rc = sqlite3_exec (db, statement, NULL, NULL, NULL);
-	if (rc) {
-		egg_warning ("Can't vacuum: %s\n", sqlite3_errmsg (db));
-		ret = FALSE;
-		goto out;
+
+	egg_debug ("application_id=%s, name=%s, comment=%s, icon=%s, categories=%s", application_id, name, comment, icon_name, categories);
+
+	/* append the application data to the sql string */
+	escaped = sqlite3_mprintf ("INSERT INTO applications (application_id, package_name, categories, "
+				   "repo_id, icon_name, application_name, application_summary) "
+				   "VALUES (%Q, %Q, %Q, %Q, %Q, %Q, %Q);",
+				   application_id, package, categories, repo, icon_name, name, comment);
+	g_string_append_printf (sql, "%s\n", escaped);
+
+	sqlite3_free (escaped);
+	g_free (name);
+	g_free (comment);
+	g_free (icon_name);
+	g_free (categories);
+	return g_string_free (sql, FALSE);
+}
+
+/**
+ * pk_app_install_generate_translations_sql:
+ **/
+static gchar *
+pk_app_install_generate_translations_sql (GPtrArray *data, GPtrArray *locales, const gchar *application_id)
+{
+	GString *sql;
+	gchar *name = NULL;
+	gchar *comment = NULL;
+	gchar *escaped;
+	const gchar *locale;
+	guint i;
+
+	sql = g_string_new ("");
+	for (i=0; i<locales->len; i++) {
+		locale = g_ptr_array_index (locales, i);
+		name = pk_app_install_generate_get_value_for_locale (data, "Name", locale);
+		comment = pk_app_install_generate_get_value_for_locale (data, "Comment", locale);
+
+		/* append the application data to the sql string */
+		escaped = sqlite3_mprintf ("INSERT INTO translations (application_id, application_name, application_summary, locale) "
+					   "VALUES (%Q, %Q, %Q, %Q);", application_id, name, comment, locale);
+		g_string_append_printf (sql, "%s\n", escaped);
+
+		sqlite3_free (escaped);
+		g_free (name);
+		g_free (comment);
 	}
 
-out:
-	g_free (statement);
-	if (db != NULL)
-		sqlite3_close (db);
-	return ret;
+	return g_string_free (sql, FALSE);
+}
+
+/**
+ * pk_app_install_generate_copy_icons:
+ **/
+static gboolean
+pk_app_install_generate_copy_icons (const gchar *directory, const gchar *icon_name)
+{
+	gboolean ret;
+	GError *error = NULL;
+	GFile *file;
+	GFile *remote;
+	gchar *dest;
+	gchar *iconpath;
+	gchar *icon_name_full;
+	guint i;
+
+	/* copy all icon sizes if they exist */
+	icon_name_full = g_strdup_printf ("%s.png", icon_name);
+	for (i=0; icon_sizes[i] != NULL; i++) {
+		iconpath = g_build_filename (PK_APP_INSTALL_DEFAULT_APPICONDIR, icon_sizes[i], "apps", icon_name_full, NULL);
+		ret = g_file_test (iconpath, G_FILE_TEST_EXISTS);
+		if (ret) {
+			dest = g_build_filename (directory, icon_sizes[i], icon_name_full, NULL);
+			egg_debug ("copying file %s to %s", iconpath, dest);
+			file = g_file_new_for_path (iconpath);
+			remote = g_file_new_for_path (dest);
+			ret = g_file_copy (file, remote, G_FILE_COPY_TARGET_DEFAULT_PERMS | G_FILE_COPY_OVERWRITE, NULL, NULL, NULL, &error);
+			if (!ret) {
+				egg_warning ("cannot copy %s: %s", dest, error->message);
+				g_clear_error (&error);
+			}
+			g_object_unref (file);
+			g_object_unref (remote);
+			g_free (dest);
+		} else {
+			egg_debug ("does not exist: %s, so not copying", iconpath);
+		}
+		g_free (iconpath);
+	}
+	g_free (icon_name_full);
+	return TRUE;
 }
-#endif
 
 /**
  * main:
@@ -231,6 +379,13 @@ main (int argc, char *argv[])
 	gchar *applicationdir = NULL;
 	gchar *icondir = NULL;
 	gchar *outputdir = NULL;
+	gboolean ret;
+	GError *error = NULL;
+	const gchar *filename;
+	GString *string = NULL;
+	GPtrArray *files = NULL;
+	GPtrArray *data;
+	guint k;
 
 	const GOptionEntry options[] = {
 		{ "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose,
@@ -265,7 +420,15 @@ main (int argc, char *argv[])
 	g_option_context_parse (context, &argc, &argv, NULL);
 	g_option_context_free (context);
 
+	g_type_init ();
 	egg_debug_init (verbose);
+	desktop = pk_desktop_new ();
+	ret = pk_desktop_open_database (desktop, &error);
+	if (!ret) {
+		egg_warning ("cannot open database: %s", error->message);
+		g_error_free (error);
+		goto out;
+	}
 
 	/* use default */
 	if (cache == NULL) {
@@ -273,47 +436,125 @@ main (int argc, char *argv[])
 		cache = g_strdup (PK_APP_INSTALL_DEFAULT_DATABASE);
 	}
 
+	/* things we require */
 	if (repo == NULL) {
 		egg_warning ("A repo name is required");
 		retval = 1;
 		goto out;
 	}
-	if (applicationdir == NULL) {
-		egg_warning ("A applicationdir filename is required");
+	if (outputdir == NULL) {
+		egg_warning ("A icon output directory is required");
 		retval = 1;
 		goto out;
 	}
-	if (!g_file_test (applicationdir, G_FILE_TEST_EXISTS)) {
+
+	/* use defaults */
+	if (applicationdir == NULL) {
+		egg_debug ("applicationdir not specified, using %s", PK_APP_INSTALL_DEFAULT_APPDIR);
+		applicationdir = g_strdup (PK_APP_INSTALL_DEFAULT_APPDIR);
+	}
+	if (icondir == NULL) {
+		egg_debug ("icondir not specified, using %s", PK_APP_INSTALL_DEFAULT_APPICONDIR);
+		icondir = g_strdup (PK_APP_INSTALL_DEFAULT_APPICONDIR);
+	}
+
+	/* check directories exist */
+	if (!g_file_test (applicationdir, G_FILE_TEST_IS_DIR)) {
 		egg_warning ("The applicationdir filename '%s' could not be found", applicationdir);
 		retval = 1;
 		goto out;
 	}
-	if (icondir == NULL || !g_file_test (icondir, G_FILE_TEST_IS_DIR)) {
-		egg_warning ("The icon directory '%s' could not be found", icondir);
+	if (!g_file_test (icondir, G_FILE_TEST_IS_DIR)) {
+		egg_warning ("The icondir filename '%s' could not be found", icondir);
 		retval = 1;
 		goto out;
 	}
-	if (outputdir == NULL || !g_file_test (outputdir, G_FILE_TEST_IS_DIR)) {
+	if (!g_file_test (outputdir, G_FILE_TEST_IS_DIR)) {
 		egg_warning ("The icon output directory '%s' could not be found", outputdir);
 		retval = 1;
 		goto out;
 	}
 
-// generate the sub directories in the outputdir if they dont exist
-// get a list of files in applicationdir
-// for each file, extract SQL data
-// append the sql to a GString
-// copy the icons
-// write the GString to disk
-
+	/* just dump them */
 	egg_warning ("cache=%s, applicationdir=%s, repo=%s, icondir=%s, outputdir=%s", cache, applicationdir, repo, icondir, outputdir);
 
+	/* generate the sub directories in the outputdir if they dont exist */
+	pk_app_install_generate_create_icon_directories (outputdir);
+
+	/* use this to dump the data */
+	string = g_string_new ("/* auto generated today */\n");
+
+	/* get a list of desktop files in applicationdir */
+	files = pk_app_install_generate_get_desktop_files (applicationdir);
+
+	for (k=0; k<files->len; k++) {
+		gchar *sql;
+		gchar *package;
+		gchar *application_id;
+		gchar *icon_name;
+		GPtrArray *locales;
+
+		filename = g_ptr_array_index (files, k);
+		egg_debug ("filename: %s", filename);
+
+		/* get package name */
+		package = pk_app_install_generate_get_package_for_file (filename);
+		if (package == NULL)
+			continue;
+
+		/* get app-id */
+		application_id = pk_app_install_generate_get_application_id (filename);
+
+		/* extract data */
+		data = pk_app_install_generate_get_desktop_data (filename);
+
+		/* form application SQL */
+		sql = pk_app_install_generate_applications_sql (data, repo, package, application_id);
+		g_string_append_printf (string, "%s", sql);
+
+		/* get list of locales in this file */
+		locales = pk_app_install_generate_get_locales (data);
+
+		/* form translations SQL */
+		sql = pk_app_install_generate_translations_sql (data, locales, application_id);
+		g_string_append_printf (string, "%s\n", sql);
+
+		/* copy icons */
+		icon_name = pk_app_install_generate_get_value_for_locale (data, "Icon", NULL);
+		if (icon_name != NULL)
+			pk_app_install_generate_copy_icons (outputdir, icon_name);
+
+		/* free temp data */
+		g_ptr_array_foreach (locales, (GFunc) g_free, NULL);
+		g_ptr_array_free (locales, TRUE);
+		g_ptr_array_foreach (data, (GFunc) pk_app_install_generate_desktop_data_free, NULL);
+		g_ptr_array_free (data, TRUE);
+		g_free (icon_name);
+		g_free (sql);
+		g_free (package);
+		g_free (application_id);
+	}
+
+	/* save to disk */
+	ret = g_file_set_contents (cache, string->str, -1, &error);
+	if (!ret) {
+		egg_warning ("cannot write data file: %s", error->message);
+		g_error_free (error);
+		goto out;
+	}
+	egg_debug ("saved to %s", cache);
+
 out:
+	if (string != NULL)
+		g_string_free (string, TRUE);
+	g_ptr_array_foreach (files, (GFunc) g_free, NULL);
+	g_ptr_array_free (files, TRUE);
 	g_free (cache);
 	g_free (repo);
 	g_free (applicationdir);
 	g_free (icondir);
 	g_free (outputdir);
+	g_object_unref (desktop);
 	return 0;
 }
 
diff --git a/contrib/app-install/pk-app-install-remove.c b/contrib/app-install/pk-app-install-remove.c
index 30f3502..3753b13 100644
--- a/contrib/app-install/pk-app-install-remove.c
+++ b/contrib/app-install/pk-app-install-remove.c
@@ -159,6 +159,14 @@ main (int argc, char *argv[])
 		goto out;
 	}
 
+	/* don't sync */
+	rc = sqlite3_exec (db, "PRAGMA synchronous=OFF", NULL, NULL, NULL);
+	if (rc) {
+		egg_warning ("Can't turn off sync: %s\n", sqlite3_errmsg (db));
+		retval = 1;
+		goto out;
+	}
+
 	/* remove icons */
 	statement = g_strdup_printf ("SELECT application_id, icon_name FROM applications WHERE repo_id = '%s'", repo);
 	rc = sqlite3_exec (db, statement, pk_app_install_remove_icons_sqlite_cb, (void*) icondir, &error_msg);
commit f617fdc664cc282390483790f7ba186645944061
Author: Richard Hughes <richard at hughsie.com>
Date:   Wed Mar 4 17:42:00 2009 +0000

    trivial: spend some more time on the app-install code, nothing that really works yet

diff --git a/contrib/app-install/Makefile.am b/contrib/app-install/Makefile.am
index 9d39362..2d67173 100644
--- a/contrib/app-install/Makefile.am
+++ b/contrib/app-install/Makefile.am
@@ -3,6 +3,7 @@ AUTOMAKE_OPTIONS = 1.7
 
 INCLUDES =						\
 	$(GLIB_CFLAGS)					\
+	$(GIO_CFLAGS)					\
 	$(SQLITE_CFLAGS)				\
 	-DPACKAGE_LOCALE_DIR=\"$(localedir)\"		\
 	-DSYSCONFDIR=\""$(sysconfdir)"\" 		\
@@ -32,7 +33,7 @@ pk_app_install_remove_SOURCES =				\
 	pk-app-install-remove.c				\
 	pk-app-install-common.h				\
 	$(NULL)
-pk_app_install_remove_LDADD = $(GLIB_LIBS) $(SQLITE_LIBS)
+pk_app_install_remove_LDADD = $(GIO_LIBS) $(GLIB_LIBS) $(SQLITE_LIBS)
 pk_app_install_remove_CFLAGS = $(WARNINGFLAGS_C)
 
 pk_app_install_add_SOURCES =				\
@@ -41,7 +42,7 @@ pk_app_install_add_SOURCES =				\
 	pk-app-install-add.c				\
 	pk-app-install-common.h				\
 	$(NULL)
-pk_app_install_add_LDADD = $(GLIB_LIBS) $(SQLITE_LIBS)
+pk_app_install_add_LDADD = $(GIO_LIBS) $(GLIB_LIBS) $(SQLITE_LIBS)
 pk_app_install_add_CFLAGS = $(WARNINGFLAGS_C)
 
 pk_app_install_generate_SOURCES =			\
diff --git a/contrib/app-install/pk-app-install-add.c b/contrib/app-install/pk-app-install-add.c
index 357ab74..286b882 100644
--- a/contrib/app-install/pk-app-install-add.c
+++ b/contrib/app-install/pk-app-install-add.c
@@ -24,7 +24,9 @@
 #include <string.h>
 #include <glib/gi18n.h>
 #include <sqlite3.h>
+#include <gio/gio.h>
 
+#include "pk-app-install-common.h"
 #include "egg-debug.h"
 
 #if PK_BUILD_LOCAL
@@ -33,195 +35,73 @@
 #define PK_APP_INSTALL_DEFAULT_DATABASE DATADIR "/app-install/cache/desktop.db"
 #endif
 
+const gchar *icon_sizes[] = { "22x22", "24x24", "32x32", "48x48", "scalable", NULL };
+
 /**
- * pk_app_install_create:
+ * pk_app_install_add_get_number_sqlite_cb:
  **/
-static gboolean
-pk_app_install_create (const gchar *cache)
+static gint
+pk_app_install_add_get_number_sqlite_cb (void *data, gint argc, gchar **argv, gchar **col_name)
 {
-	gboolean ret = TRUE;
-	gboolean create_file;
-	const gchar *statement;
-	sqlite3 *db = NULL;
-	gint rc;
-
-	/* if the database file was not installed (or was nuked) recreate it */
-	create_file = g_file_test (cache, G_FILE_TEST_EXISTS);
-	if (create_file == TRUE) {
-		egg_warning ("already exists");
-		goto out;
-	}
-
-	egg_debug ("exists: %i", create_file);
-
-	/* open database */
-	rc = sqlite3_open (cache, &db);
-	if (rc) {
-		egg_warning ("Can't open database: %s\n", sqlite3_errmsg (db));
-		ret = FALSE;
-		goto out;
-	}
-
-	/* don't sync */
-	statement = "PRAGMA synchronous=OFF";
-	rc = sqlite3_exec (db, statement, NULL, NULL, NULL);
-	if (rc) {
-		egg_warning ("Can't turn off sync: %s\n", sqlite3_errmsg (db));
-		ret = FALSE;
-		goto out;
-	}
-
-	egg_debug ("create");
-	if (create_file == FALSE) {
-		statement = "CREATE TABLE general ("
-			    "application_id TEXT primary key,"
-			    "package_name TEXT,"
-			    "group_id TEXT,"
-			    "repo_name TEXT,"
-			    "application_name TEXT,"
-			    "application_summary TEXT);";
-		rc = sqlite3_exec (db, statement, NULL, NULL, NULL);
-		if (rc) {
-			egg_warning ("Can't create general table: %s\n", sqlite3_errmsg (db));
-			ret = FALSE;
-			goto out;
-		}
-		statement = "CREATE TABLE localised ("
-			    "application_id TEXT primary key,"
-			    "application_name TEXT,"
-			    "application_summary TEXT,"
-			    "locale TEXT);";
-		rc = sqlite3_exec (db, statement, NULL, NULL, NULL);
-		if (rc) {
-			egg_warning ("Can't create localised table: %s\n", sqlite3_errmsg (db));
-			ret = FALSE;
-			goto out;
-		}
-	}
-
-out:
-	if (db != NULL)
-		sqlite3_close (db);
-	return ret;
+	guint *number = (guint *) data;
+	(*number)++;
+	return 0;
 }
 
 /**
- * pk_app_install_remove_icons_sqlite_cb:
+ * pk_app_install_add_copy_icons_sqlite_cb:
  **/
 static gint
-pk_app_install_remove_icons_sqlite_cb (void *data, gint argc, gchar **argv, gchar **col_name)
+pk_app_install_add_copy_icons_sqlite_cb (void *data, gint argc, gchar **argv, gchar **col_name)
 {
-	gint i;
+	guint i;
 	gchar *col;
 	gchar *value;
 	const gchar *application_id = NULL;
+	const gchar *icon_name = NULL;
 	gchar *path;
-	gchar *filename;
+	gchar *dest;
+	GFile *file;
+	GFile *remote;
 	const gchar *icondir = (const gchar *) data;
+	gboolean ret;
+	GError *error = NULL;
 
-	for (i=0; i<argc; i++) {
+	for (i=0; i<(guint)argc; i++) {
 		col = col_name[i];
 		value = argv[i];
 		if (g_strcmp0 (col, "application_id") == 0)
 			application_id = value;
+		else if (g_strcmp0 (col, "icon_name") == 0)
+			icon_name = value;
 	}
-	if (application_id == NULL)
-		goto out;
-
-	egg_warning ("application_id=%s", application_id);
-	filename = g_strdup_printf ("%s.png", application_id);
-	path = g_build_filename (icondir, "48x48", filename, NULL);
-
-//	g_unlink (path);
-	egg_warning ("path=%s", path);
-
-	g_free (filename);
-	g_free (path);
-out:
-	return 0;
-}
-
-/**
- * pk_app_install_remove:
- **/
-static gboolean
-pk_app_install_remove (const gchar *cache, const gchar *icondir, const gchar *repo)
-{
-	gboolean ret = TRUE;
-	gchar *statement = NULL;
-	sqlite3 *db = NULL;
-	gchar *error_msg;
-	gint rc;
-
-	/* open database */
-	rc = sqlite3_open (cache, &db);
-	if (rc) {
-		egg_warning ("Can't open database: %s\n", sqlite3_errmsg (db));
-		ret = FALSE;
+	if (application_id == NULL || icon_name == NULL)
 		goto out;
-	}
 
-	/* remove icons */
-	if (icondir != NULL) {
-		statement = g_strdup_printf ("SELECT application_id FROM general WHERE repo_name = '%s'", repo);
-		rc = sqlite3_exec (db, statement, pk_app_install_remove_icons_sqlite_cb, (void*) icondir, &error_msg);
-		g_free (statement);
-		if (rc != SQLITE_OK) {
-			egg_warning ("SQL error: %s\n", error_msg);
-			sqlite3_free (error_msg);
-			return 0;
+	egg_debug ("removing icons for application: %s", application_id);
+
+	/* copy all icon sizes if they exist */
+	for (i=0; icon_sizes[i] != NULL; i++) {
+		path = g_build_filename (icondir, icon_sizes[i], icon_name, NULL);
+		ret = g_file_test (path, G_FILE_TEST_EXISTS);
+		if (ret) {
+			dest = g_build_filename (PK_APP_INSTALL_DEFAULT_ICONDIR, icon_sizes[i], icon_name, NULL);
+			egg_debug ("copying file %s to %s", path, dest);
+			file = g_file_new_for_path (path);
+			remote = g_file_new_for_path (dest);
+			ret = g_file_copy (file, remote, G_FILE_COPY_TARGET_DEFAULT_PERMS, NULL, NULL, NULL, &error);
+			if (!ret) {
+				egg_warning ("cannot copy %s: %s", path, error->message);
+				g_clear_error (&error);
+			}
+			g_object_unref (file);
+			g_object_unref (remote);
+			g_free (dest);
 		}
+		g_free (path);
 	}
-
-	/* delete from localised (localised has no repo_name, so key off general) */
-	statement = g_strdup_printf ("DELETE FROM localised WHERE EXISTS ( "
-				      "SELECT general.application_id FROM general WHERE "
-				      "general.application_id = general.application_id AND general.repo_name = '%s')", repo);
-//	statement = g_strdup_printf ("SELECT general.application_id FROM general WHERE general.application_id == general.application_id AND general.repo_name == '%s'", repo);
-	rc = sqlite3_exec (db, statement, NULL, NULL, NULL);
-	if (rc) {
-		egg_warning ("Can't remove rows: %s\n", sqlite3_errmsg (db));
-		ret = FALSE;
-		goto out;
-	}
-	egg_debug ("%i removals from localised", sqlite3_changes (db));
-	g_free (statement);
-
-	/* delete from general */
-	statement = g_strdup_printf ("DELETE FROM general WHERE repo_name = '%s'", repo);
-	rc = sqlite3_exec (db, statement, NULL, NULL, NULL);
-	if (rc) {
-		egg_warning ("Can't remove rows: %s\n", sqlite3_errmsg (db));
-		ret = FALSE;
-		goto out;
-	}
-	egg_debug ("%i removals from general", sqlite3_changes (db));
-	g_free (statement);
-
-	/* reclaim memory */
-	statement = g_strdup ("VACUUM");
-	rc = sqlite3_exec (db, statement, NULL, NULL, NULL);
-	if (rc) {
-		egg_warning ("Can't vacuum: %s\n", sqlite3_errmsg (db));
-		ret = FALSE;
-		goto out;
-	}
-
 out:
-	g_free (statement);
-	if (db != NULL)
-		sqlite3_close (db);
-	return ret;
-}
-
-/**
- * pk_app_install_add:
- **/
-static gboolean
-pk_app_install_add (const gchar *cache, const gchar *icondir, const gchar *repo, const gchar *source)
-{
-	egg_warning ("cache=%s, source=%s, repo=%s, icondir=%s", cache, source, repo, icondir);
-	return TRUE;
+	return 0;
 }
 
 /**
@@ -233,18 +113,22 @@ main (int argc, char *argv[])
 	gboolean verbose = FALSE;
 	GOptionContext *context;
 	gint retval = 0;
-	gchar *action = NULL;
 	gchar *cache = NULL;
 	gchar *repo = NULL;
 	gchar *source = NULL;
 	gchar *icondir = NULL;
+	sqlite3 *db = NULL;
+	gchar *error_msg;
+	gint rc;
+	guint number = 0;
+	gchar *statement;
+	gchar *contents;
+	gboolean ret;
+	GError *error = NULL;
 
 	const GOptionEntry options[] = {
 		{ "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose,
 		  _("Show extra debugging information"), NULL },
-		{ "action", 'c', 0, G_OPTION_ARG_STRING, &action,
-		  /* TRANSLATORS: the action is non-localised */
-		  _("The action, one of 'create', 'add', or 'remove'"), NULL},
 		{ "cache", 'c', 0, G_OPTION_ARG_STRING, &cache,
 		  /* TRANSLATORS: if we are specifing a out-of-tree database */
 		  _("Main cache file to use (if not specififed, default is used)"), NULL},
@@ -282,60 +166,85 @@ main (int argc, char *argv[])
 		cache = g_strdup (PK_APP_INSTALL_DEFAULT_DATABASE);
 	}
 
-	if (g_strcmp0 (action, "create") == 0) {
-		pk_app_install_create (cache);
-	} else if (g_strcmp0 (action, "add") == 0) {
-		if (repo == NULL) {
-			egg_warning ("A repo name is required");
-			retval = 1;
-			goto out;
-		}
-		if (source == NULL) {
-			egg_warning ("A source filename is required");
-			retval = 1;
-			goto out;
-		}
-		if (!g_file_test (source, G_FILE_TEST_EXISTS)) {
-			egg_warning ("The source filename '%s' could not be found", source);
-			retval = 1;
-			goto out;
-		}
-		if (icondir == NULL || !g_file_test (icondir, G_FILE_TEST_IS_DIR)) {
-			egg_warning ("The icon directory '%s' could not be found", icondir);
-			retval = 1;
-			goto out;
-		}
-		pk_app_install_add (cache, icondir, repo, source);
-	} else if (g_strcmp0 (action, "remove") == 0) {
-		if (repo == NULL) {
-			egg_warning ("A repo name is required");
-			retval = 1;
-			goto out;
-		}
-		if (icondir == NULL || !g_file_test (icondir, G_FILE_TEST_IS_DIR)) {
-			egg_warning ("The icon directory '%s' could not be found", icondir);
-			retval = 1;
-			goto out;
-		}
-		pk_app_install_remove (cache, icondir, repo);
-	} else if (g_strcmp0 (action, "generate") == 0) {
-		if (repo == NULL) {
-			egg_warning ("A repo name is required");
-			retval = 1;
-			goto out;
-		}
-		if (icondir == NULL || !g_file_test (icondir, G_FILE_TEST_IS_DIR)) {
-			egg_warning ("The icon directory '%s' could not be found", icondir);
-			retval = 1;
-			goto out;
-		}
-		pk_app_install_remove (cache, icondir, repo);
-	} else {
-		egg_warning ("An action is required");
+	if (repo == NULL) {
+		egg_warning ("A repo name is required");
+		retval = 1;
+		goto out;
+	}
+	if (source == NULL) {
+		egg_warning ("A source filename is required");
+		retval = 1;
+		goto out;
+	}
+	if (!g_file_test (source, G_FILE_TEST_EXISTS)) {
+		egg_warning ("The source filename '%s' could not be found", source);
+		retval = 1;
+		goto out;
+	}
+	if (icondir == NULL || !g_file_test (icondir, G_FILE_TEST_IS_DIR)) {
+		egg_warning ("The icon directory '%s' could not be found", icondir);
 		retval = 1;
+		goto out;
+	}
+
+	/* check that there are no existing entries from this repo */
+	rc = sqlite3_open (cache, &db);
+	if (rc) {
+		egg_warning ("Can't open database: %s\n", sqlite3_errmsg (db));
+		retval = 1;
+		goto out;
+	}
+
+	/* check that there are no existing entries from this repo */
+	statement = g_strdup_printf ("SELECT application_id FROM applications WHERE repo_id = '%s'", repo);
+	rc = sqlite3_exec (db, statement, pk_app_install_add_get_number_sqlite_cb, (void*) &number, &error_msg);
+	g_free (statement);
+	if (rc != SQLITE_OK) {
+		egg_warning ("SQL error: %s\n", error_msg);
+		sqlite3_free (error_msg);
+		retval = 1;
+		goto out;
+	}
+
+	/* already have data for this repo */
+	if (number > 0) {
+		egg_warning ("There are already %i entries for repo_id=%s", number, repo);
+		goto out;
+	}
+
+	/* get all the sql from the source file */
+	ret = g_file_get_contents (source, &contents, NULL, &error);
+	if (!ret) {
+		egg_warning ("cannot read source file: %s", error->message);
+		g_error_free (error);
+		goto out;
+	}
+
+	/* copy all the applications and translations into remote db */
+	rc = sqlite3_exec (db, contents, NULL, NULL, &error_msg);
+	if (rc != SQLITE_OK) {
+		egg_warning ("SQL error: %s\n", error_msg);
+		sqlite3_free (error_msg);
+		retval = 1;
+		goto out;
+	}
+	egg_debug ("%i additions to the database", sqlite3_changes (db));
+
+	/* copy all the icons */
+	statement = g_strdup_printf ("SELECT application_id, icon_name FROM applications WHERE repo_id = '%s'", repo);
+	rc = sqlite3_exec (db, statement, pk_app_install_add_copy_icons_sqlite_cb, (void*) icondir, &error_msg);
+	g_free (statement);
+	if (rc != SQLITE_OK) {
+		egg_warning ("SQL error: %s\n", error_msg);
+		sqlite3_free (error_msg);
+		retval = 1;
+		goto out;
 	}
 
 out:
+	if (db != NULL)
+		sqlite3_close (db);
+	g_free (contents);
 	g_free (cache);
 	g_free (repo);
 	g_free (source);
diff --git a/contrib/app-install/pk-app-install-create.c b/contrib/app-install/pk-app-install-create.c
index db2c86e..fada8dd 100644
--- a/contrib/app-install/pk-app-install-create.c
+++ b/contrib/app-install/pk-app-install-create.c
@@ -103,6 +103,7 @@ main (int argc, char *argv[])
 			    "package_name TEXT,"
 			    "group_id TEXT,"
 			    "repo_id TEXT,"
+			    "icon_name TEXT,"
 			    "application_name TEXT,"
 			    "application_summary TEXT);";
 		rc = sqlite3_exec (db, statement, NULL, NULL, NULL);
diff --git a/contrib/app-install/pk-app-install-generate.c b/contrib/app-install/pk-app-install-generate.c
index 357ab74..68764b2 100644
--- a/contrib/app-install/pk-app-install-generate.c
+++ b/contrib/app-install/pk-app-install-generate.c
@@ -33,6 +33,8 @@
 #define PK_APP_INSTALL_DEFAULT_DATABASE DATADIR "/app-install/cache/desktop.db"
 #endif
 
+#if 0
+
 /**
  * pk_app_install_create:
  **/
@@ -213,16 +215,7 @@ out:
 		sqlite3_close (db);
 	return ret;
 }
-
-/**
- * pk_app_install_add:
- **/
-static gboolean
-pk_app_install_add (const gchar *cache, const gchar *icondir, const gchar *repo, const gchar *source)
-{
-	egg_warning ("cache=%s, source=%s, repo=%s, icondir=%s", cache, source, repo, icondir);
-	return TRUE;
-}
+#endif
 
 /**
  * main:
@@ -233,29 +226,29 @@ main (int argc, char *argv[])
 	gboolean verbose = FALSE;
 	GOptionContext *context;
 	gint retval = 0;
-	gchar *action = NULL;
 	gchar *cache = NULL;
 	gchar *repo = NULL;
-	gchar *source = NULL;
+	gchar *applicationdir = NULL;
 	gchar *icondir = NULL;
+	gchar *outputdir = NULL;
 
 	const GOptionEntry options[] = {
 		{ "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose,
 		  _("Show extra debugging information"), NULL },
-		{ "action", 'c', 0, G_OPTION_ARG_STRING, &action,
-		  /* TRANSLATORS: the action is non-localised */
-		  _("The action, one of 'create', 'add', or 'remove'"), NULL},
 		{ "cache", 'c', 0, G_OPTION_ARG_STRING, &cache,
 		  /* TRANSLATORS: if we are specifing a out-of-tree database */
 		  _("Main cache file to use (if not specififed, default is used)"), NULL},
-		{ "source", 's', 0, G_OPTION_ARG_STRING, &source,
-		  /* TRANSLATORS: the source database, typically used for adding */
+		{ "applicationdir", 's', 0, G_OPTION_ARG_STRING, &applicationdir,
+		  /* TRANSLATORS: the applicationdir database, typically used for adding */
 		  _("Source cache file to add to the main database"), NULL},
 		{ "icondir", 'i', 0, G_OPTION_ARG_STRING, &icondir,
 		  /* TRANSLATORS: the icon directory */
 		  _("Icon directory"), NULL},
+		{ "outputdir", 'i', 0, G_OPTION_ARG_STRING, &outputdir,
+		  /* TRANSLATORS: the output directory */
+		  _("Icon directory"), NULL},
 		{ "repo", 'n', 0, G_OPTION_ARG_STRING, &repo,
-		  /* TRANSLATORS: the repo of the software source, e.g. fedora */
+		  /* TRANSLATORS: the repo of the software applicationdir, e.g. fedora */
 		  _("Name of the remote repo"), NULL},
 		{ NULL}
 	};
@@ -274,72 +267,53 @@ main (int argc, char *argv[])
 
 	egg_debug_init (verbose);
 
-	egg_debug ("cache=%s, source=%s, repo=%s, icondir=%s", cache, source, repo, icondir);
-
 	/* use default */
 	if (cache == NULL) {
 		egg_debug ("cache not specified, using %s", PK_APP_INSTALL_DEFAULT_DATABASE);
 		cache = g_strdup (PK_APP_INSTALL_DEFAULT_DATABASE);
 	}
 
-	if (g_strcmp0 (action, "create") == 0) {
-		pk_app_install_create (cache);
-	} else if (g_strcmp0 (action, "add") == 0) {
-		if (repo == NULL) {
-			egg_warning ("A repo name is required");
-			retval = 1;
-			goto out;
-		}
-		if (source == NULL) {
-			egg_warning ("A source filename is required");
-			retval = 1;
-			goto out;
-		}
-		if (!g_file_test (source, G_FILE_TEST_EXISTS)) {
-			egg_warning ("The source filename '%s' could not be found", source);
-			retval = 1;
-			goto out;
-		}
-		if (icondir == NULL || !g_file_test (icondir, G_FILE_TEST_IS_DIR)) {
-			egg_warning ("The icon directory '%s' could not be found", icondir);
-			retval = 1;
-			goto out;
-		}
-		pk_app_install_add (cache, icondir, repo, source);
-	} else if (g_strcmp0 (action, "remove") == 0) {
-		if (repo == NULL) {
-			egg_warning ("A repo name is required");
-			retval = 1;
-			goto out;
-		}
-		if (icondir == NULL || !g_file_test (icondir, G_FILE_TEST_IS_DIR)) {
-			egg_warning ("The icon directory '%s' could not be found", icondir);
-			retval = 1;
-			goto out;
-		}
-		pk_app_install_remove (cache, icondir, repo);
-	} else if (g_strcmp0 (action, "generate") == 0) {
-		if (repo == NULL) {
-			egg_warning ("A repo name is required");
-			retval = 1;
-			goto out;
-		}
-		if (icondir == NULL || !g_file_test (icondir, G_FILE_TEST_IS_DIR)) {
-			egg_warning ("The icon directory '%s' could not be found", icondir);
-			retval = 1;
-			goto out;
-		}
-		pk_app_install_remove (cache, icondir, repo);
-	} else {
-		egg_warning ("An action is required");
+	if (repo == NULL) {
+		egg_warning ("A repo name is required");
+		retval = 1;
+		goto out;
+	}
+	if (applicationdir == NULL) {
+		egg_warning ("A applicationdir filename is required");
+		retval = 1;
+		goto out;
+	}
+	if (!g_file_test (applicationdir, G_FILE_TEST_EXISTS)) {
+		egg_warning ("The applicationdir filename '%s' could not be found", applicationdir);
+		retval = 1;
+		goto out;
+	}
+	if (icondir == NULL || !g_file_test (icondir, G_FILE_TEST_IS_DIR)) {
+		egg_warning ("The icon directory '%s' could not be found", icondir);
+		retval = 1;
+		goto out;
+	}
+	if (outputdir == NULL || !g_file_test (outputdir, G_FILE_TEST_IS_DIR)) {
+		egg_warning ("The icon output directory '%s' could not be found", outputdir);
 		retval = 1;
+		goto out;
 	}
 
+// generate the sub directories in the outputdir if they dont exist
+// get a list of files in applicationdir
+// for each file, extract SQL data
+// append the sql to a GString
+// copy the icons
+// write the GString to disk
+
+	egg_warning ("cache=%s, applicationdir=%s, repo=%s, icondir=%s, outputdir=%s", cache, applicationdir, repo, icondir, outputdir);
+
 out:
 	g_free (cache);
 	g_free (repo);
-	g_free (source);
+	g_free (applicationdir);
 	g_free (icondir);
+	g_free (outputdir);
 	return 0;
 }
 
diff --git a/contrib/app-install/pk-app-install-remove.c b/contrib/app-install/pk-app-install-remove.c
index 2ce8b71..30f3502 100644
--- a/contrib/app-install/pk-app-install-remove.c
+++ b/contrib/app-install/pk-app-install-remove.c
@@ -23,43 +23,61 @@
 
 #include <string.h>
 #include <glib/gi18n.h>
+#include <glib/gstdio.h>
 #include <sqlite3.h>
+#include <gio/gio.h>
 
 #include "pk-app-install-common.h"
 #include "egg-debug.h"
 
+const gchar *icon_sizes[] = { "22x22", "24x24", "32x32", "48x48", "scalable", NULL };
+
 /**
  * pk_app_install_remove_icons_sqlite_cb:
  **/
 static gint
 pk_app_install_remove_icons_sqlite_cb (void *data, gint argc, gchar **argv, gchar **col_name)
 {
-	gint i;
+	guint i;
 	gchar *col;
 	gchar *value;
 	const gchar *application_id = NULL;
+	const gchar *icon_name = NULL;
 	gchar *path;
-	gchar *filename;
 	const gchar *icondir = (const gchar *) data;
+	GFile *file;
+	gboolean ret;
+	GError *error = NULL;
 
-	for (i=0; i<argc; i++) {
+	for (i=0; i<(guint)argc; i++) {
 		col = col_name[i];
 		value = argv[i];
 		if (g_strcmp0 (col, "application_id") == 0)
 			application_id = value;
+		else if (g_strcmp0 (col, "icon_name") == 0)
+			icon_name = value;
 	}
-	if (application_id == NULL)
+	if (application_id == NULL || icon_name == NULL)
 		goto out;
 
-	egg_warning ("application_id=%s", application_id);
-	filename = g_strdup_printf ("%s.png", application_id);
-	path = g_build_filename (icondir, "48x48", filename, NULL);
-
-//	g_unlink (path);
-	egg_warning ("path=%s", path);
-
-	g_free (filename);
-	g_free (path);
+	egg_debug ("removing icons for application: %s", application_id);
+
+	/* delete all icon sizes */
+	for (i=0; icon_sizes[i] != NULL; i++) {
+		path = g_build_filename (icondir, icon_sizes[i], icon_name, NULL);
+		ret = g_file_test (path, G_FILE_TEST_EXISTS);
+		if (ret) {
+			egg_debug ("removing file %s", path);
+			file = g_file_new_for_path (path);
+			ret = g_file_delete (file, NULL, &error);
+			if (!ret) {
+				egg_warning ("cannot delete %s: %s", path, error->message);
+				g_clear_error (&error);
+			}
+			g_object_unref (file);
+		}
+		g_free (path);
+	}
 out:
 	return 0;
 }
@@ -142,7 +160,7 @@ main (int argc, char *argv[])
 	}
 
 	/* remove icons */
-	statement = g_strdup_printf ("SELECT application_id FROM applications WHERE repo_id = '%s'", repo);
+	statement = g_strdup_printf ("SELECT application_id, icon_name FROM applications WHERE repo_id = '%s'", repo);
 	rc = sqlite3_exec (db, statement, pk_app_install_remove_icons_sqlite_cb, (void*) icondir, &error_msg);
 	g_free (statement);
 	if (rc != SQLITE_OK) {
diff --git a/docs/app-install-v1.draft b/docs/app-install-v1.draft
index 65252fd..437c5b6 100644
--- a/docs/app-install-v1.draft
+++ b/docs/app-install-v1.draft
@@ -30,12 +30,19 @@ this out of band is that we do not need to using PackageKit for lots of small
 searches, and can query on the native DE groups using a fast .
 
 * This specification is designed around a single sqlite database
-* Applications must ship a 48x48 PNG format icon if one is provided.
+* Applications must ship a 48x48 icon if one is provided.
   Other sizes can optionally provided, although this is not recommended.
 * Applications should not ship extra data in the database. Functionality will
   be increased in future versions of the standard and the database format will
   be expanded.
 
+The interchange format is native SQL, rather than a compressed database.
+This is so the information can be verified, rather than just shipping a
+'binary blob' of a database file. This file is usually very well compressed in
+packages or tar.gz archives.
+
+This also allows using a database such as MySQL or postgresql if required.
+
 == Future ==
 
 Data currently being considered is popularity (from popcon and mugshot) and
@@ -88,20 +95,25 @@ STRING application_id (name of the desktop file, with no extension)
 STRING package_name (the package name, e.g. 'nautilus')
 STRING categories (Categories from desktop file, _not_ PK groups or PK categories)
 STRING repo_id (for adding and removal)
+STRING icon_name (local filename with extension, e.g. "totem-pl.png". This is required so that local theme can override upstream icon)
 STRING application_name (Name in desktop file)
 STRING application_summary (Comment in desktop file)
 
-icon_name is not needed as it will be renamed to ${application_id}.png
-
 == Possible Commands ==
 pk-app-install-create --cache=/usr/share/app-install/cache/desktop.db
 pk-app-install-add --repo=livna --source=./livna/desktop.db --icondir=./livna/icons --cache=/usr/share/app-install/cache/desktop.db
 pk-app-install-remove --repo=livna --icondir=/usr/share/app-install/icons --cache=/usr/share/app-install/cache/desktop.db
-* need to do the latter then former in a spec file on upgrade
+
+What to do in packages:
+PackageKit(install):	pk-app-install-create
+livna-release(install):	pk-app-install-add --repo=livna --source=/usr/share/livna-release/desktop.sqldata --icondir=/usr/share/livna-release/icons
+livna-release(removal):	pk-app-install-remove --repo=livna
+livna-release(upgrade): pk-app-install-remove --repo=livna
+livna-release(upgrade): pk-app-install-add --repo=livna --source=/usr/share/livna-release/desktop.sqldata --icondir=/usr/share/livna-release/icons
 
 all distro specific stuff to live in backends/, but typically:
 yum-app-install-generate --name=livna --cache=~/livna-apps.db
-pk-app-install-generate --repo=livna --desktopdir=/usr/share/icons --icondir=/usr/share/icons --outputdir=./icons
+pk-app-install-generate --repo=livna --applicationdir=/usr/share/applications --icondir=/usr/share/icons --outputdir=./icons --cache=./desktop.sqldata
 
 
 == Open questions ===
commit 277ffd0d53f4dea578afb3be8aa0116f0ebdfa64
Author: Daniel Nicoletti <dantti85-pk at yahoo.com.br>
Date:   Wed Mar 4 12:27:39 2009 -0300

    Updating QPackageKit version to 0.4.1

diff --git a/lib/packagekit-qt/src/CMakeLists.txt b/lib/packagekit-qt/src/CMakeLists.txt
index 81417c4..c463a78 100644
--- a/lib/packagekit-qt/src/CMakeLists.txt
+++ b/lib/packagekit-qt/src/CMakeLists.txt
@@ -34,7 +34,7 @@ set( lib_SRCS
 QT4_AUTOMOC(${lib_SRCS})
 
 add_library(packagekit-qt SHARED ${lib_SRCS})
-set_target_properties( packagekit-qt PROPERTIES VERSION 2.0 SOVERSION 2 )
+set_target_properties( packagekit-qt PROPERTIES VERSION 4.1 SOVERSION 0 )
 
 target_link_libraries(packagekit-qt
   ${QT_QTCORE_LIBRARY}
commit 71731ea05da4eed010b6e7ec2b0dbbd6f6c3f331
Author: Richard Hughes <richard at hughsie.com>
Date:   Wed Mar 4 10:26:35 2009 +0000

    trivial: relax a check in the unit tests to deal with floating point imprecision

diff --git a/src/pk-time.c b/src/pk-time.c
index 57663bf..ad7ab1b 100644
--- a/src/pk-time.c
+++ b/src/pk-time.c
@@ -432,7 +432,7 @@ pk_time_test (EggTest *test)
 		value += 10;
 	}
 	value = pk_time_get_remaining (self);
-	if (value > 1199 && value < 1201)
+	if (value >= 1199 && value <= 1201)
 		egg_test_success (test, NULL);
 	else
 		egg_test_failed (test, "got %i", value);
commit e7f24dae48b74d4307918b91dda65ed3e3859438
Author: Richard Hughes <richard at hughsie.com>
Date:   Wed Mar 4 10:24:14 2009 +0000

    yum: output a Details::size value of zero if the file is in cache

diff --git a/backends/yum/yumBackend.py b/backends/yum/yumBackend.py
index f4db0e5..e33779f 100755
--- a/backends/yum/yumBackend.py
+++ b/backends/yum/yumBackend.py
@@ -1953,8 +1953,13 @@ class PackageKitYumBackend(PackageKitBaseBackend, PackagekitPackage):
         else:
             desc = ''
 
+        # if we are remote and in the cache, our size is zero
+        size = pkg.size
+        if pkg.repo.id != 'installed' and pkg.verifyLocalPkg():
+            size = 0
+
         group = self.comps.get_group(pkg.name)
-        self.details(package_id, pkg.license, group, desc, pkg.url, pkg.size)
+        self.details(package_id, pkg.license, group, desc, pkg.url, size)
 
     def get_files(self, package_ids):
         try:
commit 5933391413f967bec8448fc6bd91a8d260ac4305
Author: Richard Hughes <richard at hughsie.com>
Date:   Wed Mar 4 10:23:16 2009 +0000

    feature: clarify in the spec that a Details::size value of zero of a non-installed file indicates it's in cache and doesn't need to be downloaded

diff --git a/src/org.freedesktop.PackageKit.Transaction.xml b/src/org.freedesktop.PackageKit.Transaction.xml
index 6651c79..8ce2d15 100644
--- a/src/org.freedesktop.PackageKit.Transaction.xml
+++ b/src/org.freedesktop.PackageKit.Transaction.xml
@@ -1468,6 +1468,8 @@
             <doc:para>
               The size of the package in bytes. This should be the size of the entire package file,
               not the size of the files installed on the system.
+              If the package is not installed, and already downloaded and
+              present in the package manager cache, then this value should be set to zero.
             </doc:para>
           </doc:summary>
         </doc:doc>
commit 9749e9e6968ddf2fc8784583b503b96f13a4d220
Author: Richard Hughes <richard at hughsie.com>
Date:   Wed Mar 4 10:21:47 2009 +0000

    trivial: print the error name, not code in the debugging output

diff --git a/lib/packagekit-glib/pk-client.c b/lib/packagekit-glib/pk-client.c
index 29e364d..c293677 100644
--- a/lib/packagekit-glib/pk-client.c
+++ b/lib/packagekit-glib/pk-client.c
@@ -891,7 +891,7 @@ pk_client_error_code_cb (DBusGProxy  *proxy,
 	g_return_if_fail (PK_IS_CLIENT (client));
 
 	code = pk_error_enum_from_text (code_text);
-	egg_debug ("emit error-code %i, %s", code, details);
+	egg_debug ("emit error-code %s, %s", pk_error_enum_to_text (code), details);
 	g_signal_emit (client , signals [PK_CLIENT_ERROR_CODE], 0, code, details);
 }
 
commit 6c7642939e7befd765d39ef54aa384585f73a15e
Author: Richard Hughes <richard at hughsie.com>
Date:   Wed Mar 4 10:13:47 2009 +0000

    bugfix: fix the self test by using actual provides in the catalog file

diff --git a/data/tests/test.catalog b/data/tests/test.catalog
index bedb9d5..8a9e7f7 100644
--- a/data/tests/test.catalog
+++ b/data/tests/test.catalog
@@ -2,13 +2,13 @@
 
 # Just a package on all versions of fedora that can provide the dependency.
 # If there are multiple packages then the user will be asked to choose
-InstallProvides(fedora)=audio/QCELP
+InstallProvides(fedora)=image/bmp
 
 # Just for Fedora 9, install two development files
 InstallPackages(fedora-9.90)=ocaml-json-wheel-devel
 
 # On any distro, install the package with this file
-InstallFiles=/usr/bin/kpowersave
+InstallFiles=/usr/bin/kate
 
 # For each architecture on Fedora 8, install one of the two different files
 InstallFiles(fedora-8-i686)=/usr/lib/pango/1.6.0/modules/pango-arabic-fc.so
commit 61cde496aa4dd73cfa7d4e614c6a361868e26198
Author: Richard Hughes <richard at hughsie.com>
Date:   Wed Mar 4 10:02:32 2009 +0000

    yum: support the 'any' provide search

diff --git a/backends/yum/yumBackend.py b/backends/yum/yumBackend.py
index b6f7e69..f4db0e5 100755
--- a/backends/yum/yumBackend.py
+++ b/backends/yum/yumBackend.py
@@ -650,6 +650,30 @@ class PackageKitYumBackend(PackageKitBaseBackend, PackagekitPackage):
         package_list = pkgfilter.post_process()
         self._show_package_list(package_list)
 
+    def _get_provides_query(self, provides_type, search):
+        # gets a list of provides
+
+        # old standard
+        if search.startswith("gstreamer0.10("):
+            return [ search ]
+
+        # new standard
+        if provides_type == PROVIDES_CODEC:
+            return [ "gstreamer0.10(%s)" % search ]
+        if provides_type == PROVIDES_FONT:
+            return [ "font(%s)" % search ]
+        if provides_type == PROVIDES_MIMETYPE:
+            return [ "mimehandler(%s)" % search ]
+        if provides_type == PROVIDES_ANY:
+            provides = []
+            provides.append(self._get_provides_query(PROVIDES_CODEC, search)[0])
+            provides.append(self._get_provides_query(PROVIDES_FONT, search)[0])
+            provides.append(self._get_provides_query(PROVIDES_MIMETYPE, search)[0])
+            return provides
+
+        # not supported
+        raise PkError(ERROR_NOT_SUPPORTED, "this backend does not support '%s' provides" % provides_type)
+
     def what_provides(self, filters, provides_type, search):
         '''
         Implement the {backend}-what-provides functionality
@@ -663,45 +687,36 @@ class PackageKitYumBackend(PackageKitBaseBackend, PackagekitPackage):
         fltlist = filters.split(';')
         pkgfilter = YumFilter(fltlist)
 
-        # guess
-        if provides_type == PROVIDES_ANY and search.startswith(":"):
-            provides_type = PROVIDES_FONT
-
-        # old standard
-        if search.startswith("gstreamer0.10("):
-            provide = search
-        elif provides_type == PROVIDES_CODEC:
-            provide = "gstreamer0.10(%s)" % search
-        elif provides_type == PROVIDES_FONT:
-            provide = "font(%s)" % search
-        elif provides_type == PROVIDES_MIMETYPE:
-            provide = "mimehandler(%s)" % search
-        else:
-            self.error(ERROR_NOT_SUPPORTED, "this backend does not support %s provides" % provides_type, exit=False)
-            return
-
-        # Check installed for file
         try:
-            pkgs = self.yumbase.rpmdb.searchProvides(provide)
-        except Exception, e:
-            self.error(ERROR_INTERNAL_ERROR, _format_str(traceback.format_exc()))
-        pkgfilter.add_installed(pkgs)
+            provides = self._get_provides_query(provides_type, search)
+        except PkError, e:
+            self.error(e.code, e.details, exit=False)
+        else:
+            # there may be multiple provide strings
+            for provide in provides:
+                # Check installed packages for provide
+                try:
+                    pkgs = self.yumbase.rpmdb.searchProvides(provide)
+                except Exception, e:
+                    self.error(ERROR_INTERNAL_ERROR, _format_str(traceback.format_exc()))
+                else:
+                    pkgfilter.add_installed(pkgs)
 
-        if not FILTER_INSTALLED in fltlist:
-            # Check available for file
-            try:
-                pkgs = self.yumbase.pkgSack.searchProvides(provide)
-            except yum.Errors.RepoError, e:
-                self.error(ERROR_NO_CACHE, _to_unicode(e), exit=False)
-                return
-            except Exception, e:
-                self.error(ERROR_INTERNAL_ERROR, _format_str(traceback.format_exc()))
-            else:
-                pkgfilter.add_available(pkgs)
+                    if not FILTER_INSTALLED in fltlist:
+                        # Check available packages for provide
+                        try:
+                            pkgs = self.yumbase.pkgSack.searchProvides(provide)
+                        except yum.Errors.RepoError, e:
+                            self.error(ERROR_NO_CACHE, _to_unicode(e), exit=False)
+                            return
+                        except Exception, e:
+                            self.error(ERROR_INTERNAL_ERROR, _format_str(traceback.format_exc()))
+                        else:
+                            pkgfilter.add_available(pkgs)
 
-        # we couldn't do this when generating the list
-        package_list = pkgfilter.post_process()
-        self._show_package_list(package_list)
+                    # we couldn't do this when generating the list
+                    package_list = pkgfilter.post_process()
+                    self._show_package_list(package_list)
 
     def get_categories(self):
         '''
commit 0984d82dc4612ee29c45aba9335a9a0e9277defb
Author: Richard Hughes <richard at hughsie.com>
Date:   Wed Mar 4 09:35:09 2009 +0000

    trivial: add a self check ensuring client does not set cancel role

diff --git a/lib/packagekit-glib/pk-client.c b/lib/packagekit-glib/pk-client.c
index cd9751d..29e364d 100644
--- a/lib/packagekit-glib/pk-client.c
+++ b/lib/packagekit-glib/pk-client.c
@@ -4691,6 +4691,7 @@ pk_client_test (EggTest *test)
 	guint i;
 	gchar *file;
 	PkPackageList *list;
+	PkRoleEnum role;
 
 	if (!egg_test_start (test, "PkClient"))
 		return;
@@ -4927,6 +4928,14 @@ pk_client_test (EggTest *test)
 		g_error_free (error);
 	}
 
+	/************************************************************/
+	egg_test_title (test, "ensure task still has correct role after cancel");
+	pk_client_get_role (client, &role, NULL, NULL);
+	if (role == PK_ROLE_ENUM_SEARCH_NAME)
+		egg_test_success (test, "did not cancel finished task");
+	else
+		egg_test_failed (test, "role was %s", pk_role_enum_to_text (role));
+
 	g_object_unref (client);
 	g_object_unref (client_copy);
 
commit 2024754025955b8bd366b187374fd0114fafe5e7
Author: A S Alam <aalam at redhat.com>
Date:   Wed Mar 4 01:16:38 2009 +0000

    updating file for Punjabi
    
    Transmitted-via: Transifex (translate.fedoraproject.org)

diff --git a/po/pa.po b/po/pa.po
index 53e1039..c3cce84 100644
--- a/po/pa.po
+++ b/po/pa.po
@@ -1,407 +1,1024 @@
+# translation of packagekit.master.po to Punjabi
 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
 # This file is distributed under the same license as the PACKAGE package.
 #
-# Amanpreet Singh Alam <aalam at users.sf.net>, 2008.
+# Amanpreet Singh Alam <aalam at users.sf.net>, 2008, 2009.
 msgid ""
 msgstr ""
 "Project-Id-Version: packagekit.master\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-11-09 12:10+0000\n"
-"PO-Revision-Date: 2008-12-03 06:54+0530\n"
+"POT-Creation-Date: 2009-03-03 11:42+0000\n"
+"PO-Revision-Date: 2009-03-04 06:37+0530\n"
 "Last-Translator: Amanpreet Singh Alam <aalam at users.sf.net>\n"
-"Language-Team: Punjabi/Panjabi <punjabi-l10n at users.sf.net>\n"
+"Language-Team: Punjabi <punjabi-users at lists.sf.net>\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"X-Generator: Lokalize 0.2\n"
-"Plural-Forms: nplurals=2; plural=n != 1;\n"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:1
-msgid "Accept EULA"
-msgstr "EULA ਮਨਜ਼ੂਰ"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:2
-msgid "Authentication is required to accept a EULA"
-msgstr "ਪਰਮਾਣਕਿਤਾ ਲਈ EULA ਮਨਜ਼ੂਰ ਕਰਨਾ ਲਾਜ਼ਮੀ"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:3
-msgid "Authentication is required to change software source parameters"
-msgstr "ਸਾਫਟਵੇਅਰ ਸਰੋਤ ਬਦਲਣ ਲਈ ਪਰਮਾਣਕਿਤਾ ਲਾਜ਼ਮੀ ਹੈ"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:4
-msgid "Authentication is required to install a local file"
-msgstr "ਇੱਕ ਲੋਕਲ ਫਾਇਲ ਇੰਸਟਾਲ ਕਰਨ ਲਈ ਪਰਮਾਣਕਿਤਾ ਲਾਜ਼ਮੀ ਹੈ"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:5
-msgid "Authentication is required to install a package"
-msgstr "ਇੱਕ ਪੈਕੇਜ ਇੰਸਟਾਲ ਕਰਨ ਲਈ ਪਰਮਾਣਕਿਤਾ ਲਾਜ਼ਮੀ ਹੈ"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:6
-msgid "Authentication is required to install a security signature"
-msgstr "ਇੱਕ ਸੁਰੱਖਿਆ ਅੱਪਡੇਟ ਲਈ ਪਰਮਾਣਕਿਤਾ ਲਾਜ਼ਮੀ ਹੈ"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:7
-msgid "Authentication is required to refresh the package lists"
-msgstr "ਪੈਕੇਜ ਲਿਸਟ ਤਾਜ਼ਾ ਕਰਨ ਲਈ ਪਰਮਾਣਕਿਤਾ ਲਾਜ਼ਮੀ ਹੈ"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:8
-msgid "Authentication is required to remove packages"
-msgstr "ਪੈਕੇਜ ਹਟਾਉਣ ਵਾਸਤੇ ਪਰਮਾਣਕਿਤਾ ਲਾਜ਼ਮੀ ਹੈ"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:9
-msgid "Authentication is required to rollback a transaction"
-msgstr "ਇੱਕ ਟਰਾਂਜ਼ਿਸ਼ਨ ਵਾਪਸ ਲੈਣ ਲਈ ਪਰਮਾਣਕਿਤਾ ਲਾਜ਼ਮੀ ਹੈ"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:10
-msgid "Authentication is required to update all packages"
-msgstr "ਸਭ ਪੈਕੇਜ ਅੱਪਡੇਟ ਕਰਨ ਲਈ ਪਰਮਾਣਕਿਤਾ ਲਾਜ਼ਮੀ ਹੈ"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:11
-msgid "Authentication is required to update packages"
-msgstr "ਪੈਕੇਜ ਅੱਪਡੇਟ ਕਰਨ ਲਈ ਪਰਮਾਣਕਿਤਾ ਲਾਜ਼ਮੀ ਹੈ"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:12
-msgid "Change software source parameters"
-msgstr "ਸਾਫਟਵੇਅਰ ਸਰੋਤ ਪੈਰਾਮੀਟਰ ਬਦਲੋ"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:13
-msgid "Further authentication is required to install an untrusted local file"
-msgstr "ਇੱਕ ਬੇਭਰੋਸੇਯੋਗ ਲੋਕਲ ਫਾਇਲ ਇੰਸਟਾਲ ਕਰਨ ਲਈ ਹੋਰ ਪਰਮਾਣਕਿਤਾ ਦੀ ਲੋੜ ਹੈ"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:14
-msgid "Install local file"
-msgstr "ਲੋਕਲ ਫਾਇਲ ਇੰਸਟਾਲ ਕਰੋ"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:15
-msgid "Install package"
-msgstr "ਪੈਕੇਜ ਇੰਸਟਾਲ ਕਰੋ"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:16
-msgid "Install security signature"
-msgstr "ਸੁਰੱਖਿਆ ਦਸਤਖਤ ਇੰਸਟਾਲ ਕਰੋ"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:17
-msgid "Install untrusted local file"
-msgstr "ਬੇਭਰੋਸੇਯੋਗ ਲੋਕਲ ਫਾਇਲ ਇੰਸਟਾਲ ਕਰੋ"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:18
-msgid "Refresh package lists"
-msgstr "ਪੈਕੇਜ ਲਿਸਟ ਤਾਜ਼ਾ ਕਰੋ"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:19
-msgid "Remove package"
-msgstr "ਪੈਕੇਜ ਹਟਾਓ"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:20
-msgid "Rollback to a previous transaction"
-msgstr "ਇੱਕ ਪਿਛਲੀ ਟਰਾਂਜ਼ਿਸ਼ਨ ਵਾਪਸ ਲਵੋ"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:21
-msgid "Update all packages"
-msgstr "ਸਭ ਪੈਕੇਜ ਅੱਪਡੇਟ ਕਰੋ"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:22
-msgid "Update package"
-msgstr "ਪੈਕੇਜ ਅੱਪਡੇਟ ਕਰੋ"
-
-#: ../client/pk-console.c:224
-msgid "Update detail"
-msgstr "ਅੱਪਡੇਟ ਵੇਰਵਾ"
+"X-Generator: KBabel 1.11.4\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. TRANSLATORS: this is an atomic transaction
+#: ../client/pk-console.c:234
+msgid "Transaction"
+msgstr "ਸੰਚਾਰ"
+
+#. TRANSLATORS: this is the time the transaction was started in system timezone
+#: ../client/pk-console.c:236
+msgid "System time"
+msgstr "ਸਿਸਟਮ ਸਮਾਂ"
+
+#. TRANSLATORS: this is if the transaction succeeded or not
+#: ../client/pk-console.c:238
+msgid "Succeeded"
+msgstr "ਸਫ਼ਲ"
+
+#. TRANSLATORS: if the repo is enabled
+#: ../client/pk-console.c:238 ../client/pk-console.c:405
+msgid "True"
+msgstr "ਸਹੀਂ"
+
+#: ../client/pk-console.c:238 ../client/pk-console.c:405
+msgid "False"
+msgstr "ਗਲਤ"
+
+#. TRANSLATORS: this is the transactions role, e.g. "update-system"
+#: ../client/pk-console.c:240
+msgid "Role"
+msgstr "ਰੋਲ"
+
+#. TRANSLATORS: this is The duration of the transaction
+#: ../client/pk-console.c:245
+msgid "Duration"
+msgstr "ਅੰਤਰਾਲ"
+
+#: ../client/pk-console.c:245
+msgid "(seconds)"
+msgstr "(ਸਕਿੰਟ)"
+
+#. TRANSLATORS: this is The command line used to do the action
+#: ../client/pk-console.c:249
+msgid "Command line"
+msgstr "ਕਮਾਂਡ ਲਾਈਨ"
+
+#. TRANSLATORS: this is the user ID of the user that started the action
+#: ../client/pk-console.c:251
+msgid "User ID"
+msgstr "ਯੂਜ਼ਰ ID"
+
+#. TRANSLATORS: this is the username, e.g. hughsie
+#: ../client/pk-console.c:258
+msgid "Username"
+msgstr "ਯੂਜ਼ਰ ਨਾਂ"
+
+#. TRANSLATORS: this is the users real name, e.g. "Richard Hughes"
+#: ../client/pk-console.c:262
+msgid "Real name"
+msgstr "ਅਸਲੀ ਨਾਂ"
+
+#: ../client/pk-console.c:270
+msgid "Affected packages:"
+msgstr "ਪ੍ਰਭਾਵਿਤ ਪੈਕੇਜ:"
+
+#: ../client/pk-console.c:272
+msgid "Affected packages: None"
+msgstr "ਪ੍ਰਭਾਵਿਤ ਪੈਕੇਜ: ਕੋਈ ਨਹੀਂ"
+
+#. TRANSLATORS: this is the distro, e.g. Fedora 10
+#: ../client/pk-console.c:297
+msgid "Distribution"
+msgstr "ਵੰਡ"
+
+#. TRANSLATORS: this is type of update, stable or testing
+#: ../client/pk-console.c:299
+msgid "Type"
+msgstr "ਕਿਸਮ"
+
+#. TRANSLATORS: this is any summary text describing the upgrade
+#. TRANSLATORS: this is the summary of the group
+#: ../client/pk-console.c:301 ../client/pk-console.c:324
+msgid "Summary"
+msgstr "ਸੰਖੇਪ"
+
+#. TRANSLATORS: this is the group category name
+#: ../client/pk-console.c:313
+msgid "Category"
+msgstr "ਸ੍ਰੇਣੀ"
+
+#. TRANSLATORS: this is group identifier
+#: ../client/pk-console.c:315
+msgid "ID"
+msgstr "ID"
+
+#. TRANSLATORS: this is the parent group
+#: ../client/pk-console.c:318
+msgid "Parent"
+msgstr "ਮੋਢੀ"
+
+#. TRANSLATORS: this is the name of the parent group
+#: ../client/pk-console.c:321
+msgid "Name"
+msgstr "ਨਾਂ"
+
+#. TRANSLATORS: this is preferred icon for the group
+#: ../client/pk-console.c:327
+msgid "Icon"
+msgstr "ਆਈਕਾਨ"
+
+#. TRANSLATORS: this is a header for the package that can be updated
+#: ../client/pk-console.c:342
+msgid "Details about the update:"
+msgstr "ਅੱਪਡੇਟ ਬਾਰੇ ਵੇਰਵਾ:"
+
+#. TRANSLATORS: details about the update, package name and version
+#: ../client/pk-console.c:344
+msgid "Package"
+msgstr "ਪੈਕੇਜ"
+
+#. TRANSLATORS: details about the update, any packages that this update updates
+#: ../client/pk-console.c:347
+msgid "Updates"
+msgstr "ਅੱਪਡੇਟ"
+
+#. TRANSLATORS: details about the update, any packages that this update obsoletes
+#: ../client/pk-console.c:351
+msgid "Obsoletes"
+msgstr "ਬਰਤਰਫ਼"
+
+#. TRANSLATORS: details about the update, the vendor URLs
+#: ../client/pk-console.c:355
+msgid "Vendor"
+msgstr "ਵੇਂਡਰ"
+
+#. TRANSLATORS: details about the update, the bugzilla URLs
+#: ../client/pk-console.c:359
+msgid "Bugzilla"
+msgstr "ਬੱਗਜ਼ੀਲਾ"
+
+#. TRANSLATORS: details about the update, the CVE URLs
+#: ../client/pk-console.c:363
+msgid "CVE"
+msgstr "CVE"
+
+#. TRANSLATORS: details about the update, if the package requires a restart
+#: ../client/pk-console.c:367
+msgid "Restart"
+msgstr "ਮੁੜ-ਚਾਲੂ"
+
+#. TRANSLATORS: details about the update, any description of the update
+#: ../client/pk-console.c:371
+msgid "Update text"
+msgstr "ਅੱਪਡੇਟ ਪਾਠ"
+
+#. TRANSLATORS: details about the update, the changelog for the package
+#: ../client/pk-console.c:375
+msgid "Changes"
+msgstr "ਬਦਲਾਅ"
+
+#. TRANSLATORS: details about the update, the ongoing state of the update
+#: ../client/pk-console.c:379
+msgid "State"
+msgstr "ਹਾਲਤ"
+
+#. TRANSLATORS: details about the update, date the update was issued
+#: ../client/pk-console.c:384
+msgid "Issued"
+msgstr "ਜਾਰੀ ਕੀਤਾ"
+
+#. TRANSLATORS: details about the update, date the update was updated
+#: ../client/pk-console.c:389
+msgid "Updated"
+msgstr "ਅੱਪਡੇਟ ਕੀਤੇ"
+
+#: ../client/pk-console.c:476 ../client/pk-console.c:478
+msgid "Percentage"
+msgstr "ਫੀਸਦੀ"
+
+#: ../client/pk-console.c:478
+msgid "Unknown"
+msgstr "ਅਣਜਾਣ"
+
+#. TRANSLATORS: a package requires the system to be restarted
+#: ../client/pk-console.c:529
+msgid "System restart required by:"
+msgstr "ਸਿਸਟਮ ਮੁੜ-ਚਾਲੂ ਕਰਨ ਦੀ ਲੋੜ ਹੈ:"
+
+#. TRANSLATORS: a package requires the session to be restarted
+#: ../client/pk-console.c:532
+msgid "Session restart required:"
+msgstr "ਸਿਸਟਮ ਮੁੜ-ਚਾਲੂ ਕਰਨ ਦੀ ਲੋੜ:"
+
+#. TRANSLATORS: a package requires the application to be restarted
+#: ../client/pk-console.c:535
+msgid "Application restart required by:"
+msgstr "ਐਪਲੀਕੇਸ਼ਨ ਮੁੜ-ਚਾਲੂ ਕਰਨ ਦੀ ਲੋੜ ਹੈ:"
+
+#. TRANSLATORS: a package needs to restart they system
+#: ../client/pk-console.c:572
+msgid "Please restart the computer to complete the update."
+msgstr "ਅੱਪਡੇਟ ਨੂੰ ਪੂਰਾ ਕਰਨ ਵਾਸਤੇ ਕੰਪਿਊਟਰ ਮੁੜ-ਚਾਲੂ ਕਰੋ ਜੀ।"
+
+#. TRANSLATORS: a package needs to restart the session
+#: ../client/pk-console.c:575
+msgid "Please logout and login to complete the update."
+msgstr "ਅੱਪਡੇਟ ਨੂੰ ਪੂਰਾ ਕਰਨ ਵਾਸਤੇ ਲਾਗਆਉਟ ਕਰਕੇ ਲਾਗਇਨ ਕਰੋ ਜੀ।"
+
+#. TRANSLATORS: a package needs to restart the application
+#: ../client/pk-console.c:578
+msgid "Please restart the application as it is being used."
+msgstr "ਐਪਲੀਕੇਸ਼ਨ ਨੂੰ ਮੁੜ-ਚਾਲੂ ਕਰਨ ਦੀ ਲੋੜ ਹੈ, ਕਿਉਂਕਿ ਇਹ ਵਰਤੀ ਜਾ ਰਹੀ ਹੈ।"
+
+#. TRANSLATORS: The package is already installed on the system
+#: ../client/pk-console.c:691
+#, c-format
+msgid "The package %s is already installed"
+msgstr "ਪੈਕੇਜ %s ਪਹਿਲਾਂ ਹੀ ਇੰਸਟਾਲ ਹੈ"
 
-#: ../client/pk-console.c:425
-msgid "A system restart is required"
-msgstr "ਸਿਸਟਮ ਮੁੜ-ਚਾਲੂ ਕਰਨ ਦੀ ਲੋੜ ਹੈ"
+#. TRANSLATORS: The package name was not found in any software sources. The detailed error follows
+#: ../client/pk-console.c:699
+#, c-format
+msgid "The package %s could not be installed: %s"
+msgstr "ਪੈਕੇਜ %s ਇੰਸਟਾਲ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਿਆ: %s"
+
+#. TRANSLATORS: There was a programming error that shouldn't happen. The detailed error follows
+#: ../client/pk-console.c:724 ../client/pk-console.c:751
+#: ../client/pk-console.c:847 ../client/pk-console.c:964
+#: ../client/pk-tools-common.c:62 ../client/pk-tools-common.c:81
+#: ../client/pk-tools-common.c:89
+#, c-format
+msgid "Internal error: %s"
+msgstr "ਅੰਦਰੂਨੀ ਗਲਤੀ: %s"
 
-#: ../client/pk-console.c:427
-msgid "A logout and login is required"
-msgstr "ਲਾਗ-ਆਉਟ ਅਤੇ ਲਾਗਇਨ ਕਰਨ ਦੀ ਲੋੜ ਹੈ"
+#. TRANSLATORS: There was an error installing the packages. The detailed error follows
+#: ../client/pk-console.c:732 ../client/pk-console.c:1360
+#, c-format
+msgid "This tool could not install the packages: %s"
+msgstr "ਇਹ ਟੂਲ ਪੈਕੇਜ ਇੰਸਟਾਲ ਨਹੀਂ ਕਰ ਸਕਿਆ: %s"
 
-#: ../client/pk-console.c:429
-msgid "An application restart is required"
-msgstr "ਇੱਕ ਐਪਲੀਕੇਸ਼ਨ ਮੁੜ-ਚਾਲੂ ਕਰਨ ਦੀ ਲੋੜ ਹੈ"
+#. TRANSLATORS: There was an error installing the files. The detailed error follows
+#: ../client/pk-console.c:759
+#, c-format
+msgid "This tool could not install the files: %s"
+msgstr "ਇਹ ਟੂਲ ਫਾਇਲਾਂ ਇੰਸਟਾਲ ਨਹੀਂ ਕਰ ਸਕਿਆ: %s"
 
-#: ../client/pk-console.c:474
+#. TRANSLATORS: The package name was not found in the installed list. The detailed error follows
+#: ../client/pk-console.c:815
 #, c-format
-msgid "Please enter a number from 1 to %i: "
-msgstr "1 ਤੋਂ %i ਤੱਕ ਨੰਬਰ ਦਿਓ ਜੀ:"
+msgid "This tool could not remove %s: %s"
+msgstr "ਇਹ ਟੂਲ %s ਨੂੰ ਹਟਾ ਨਹੀਂ ਸਕਿਆ: %s"
 
-#: ../client/pk-console.c:524
-msgid "Could not find a package match"
-msgstr "ਇੱਕ ਰਲਦਾ ਪੈਕੇਜ ਨਹੀਂ ਲੱਭਿਆ ਜਾ ਸਕਿਆ"
+#. TRANSLATORS: There was an error removing the packages. The detailed error follows
+#: ../client/pk-console.c:838 ../client/pk-console.c:876
+#: ../client/pk-console.c:909
+#, c-format
+msgid "This tool could not remove the packages: %s"
+msgstr "ਇਹ ਟੂਲ ਪੈਕੇਜ ਹਟਾ ਨਹੀਂ ਸਕਿਆ: %s"
+
+#. TRANSLATORS: When removing, we might have to remove other dependencies
+#: ../client/pk-console.c:888
+msgid "The following packages have to be removed:"
+msgstr "ਅੱਗੇ ਦਿੱਤੇ ਪੈਕੇਜਾਂ ਨੂੰ ਹਟਾਇਆ ਜਾਵੇਗਾ:"
+
+#. TRANSLATORS: We are checking if it's okay to remove a list of packages
+#: ../client/pk-console.c:895
+msgid "Proceed removing additional packages?"
+msgstr "ਹੋਰ ਪੈਕੇਜ ਹਟਾਉਣ ਨਾਲ ਜਾਰੀ ਰੱਖਣਾ ਹੈ?"
+
+#. TRANSLATORS: We did not remove any packages
+#: ../client/pk-console.c:900
+msgid "The package removal was canceled!"
+msgstr "ਪੈਕੇਜ ਹਟਾਉਣ ਨੂੰ ਰੱਦ ਕੀਤਾ ਗਿਆ!"
+
+#. TRANSLATORS: The package name was not found in any software sources
+#: ../client/pk-console.c:941
+#, c-format
+msgid "This tool could not download the package %s as it could not be found"
+msgstr "ਇਹ ਟੂਲ ਪੈਕੇਜ %s ਡਾਊਨਲੋਡ ਨਹੀਂ ਕਰ ਸਕਿਆ, ਕਿਉਂਕਿ ਇਹ ਨਹੀਂ ਲੱਭਿਆ"
 
-#: ../client/pk-console.c:538
-msgid "There are multiple package matches"
-msgstr "ਕਈ ਰਲਦੇ ਪੈਕੇਜ ਲੱਭੇ ਹਨ"
+#. TRANSLATORS: Could not download the packages for some reason. The detailed error follows
+#: ../client/pk-console.c:972
+#, c-format
+msgid "This tool could not download the packages: %s"
+msgstr "ਇਹ ਟੂਲ ਪੈਕੇਜ ਡਾਊਨਲੋਡ ਨਹੀਂ ਕਰ ਸਕਿਆ: %s"
 
-#. find out what package the user wants to use
-#: ../client/pk-console.c:545
-msgid "Please enter the package number: "
-msgstr "ਪੈਕੇਜ ਨੰਬਰ ਦਿਓ ਜੀ:"
+#. TRANSLATORS: There was an error getting the list of files for the package. The detailed error follows
+#: ../client/pk-console.c:999 ../client/pk-console.c:1008
+#, c-format
+msgid "This tool could not update %s: %s"
+msgstr "ਇਹ ਟੂਲ %s ਅੱਪਡੇਟ ਨਹੀਂ ਕਰ ਸਕਿਆ: %s"
 
-#: ../client/pk-console.c:561
-msgid ""
-"Could not find a package with that name to install, or package already "
-"installed"
-msgstr "ਉਸ ਨਾਂ ਦਾ ਪੈਕੇਜ ਇੰਸਟਾਲ ਕਰਨ ਲਈ ਲੱਭਿਆ ਜਾਂ ਪਹਿਲਾਂ ਹੀ ਇੰਸਟਾਲ ਹੈ"
+#. TRANSLATORS: There was an error getting the list of files for the package. The detailed error follows
+#: ../client/pk-console.c:1030 ../client/pk-console.c:1038
+#, c-format
+msgid "This tool could not get the requirements for %s: %s"
+msgstr "ਇਹ ਟੂਲ %s ਲਈ ਲੋੜ ਨਹੀਂ ਲੈ ਸਕਿਆ: %s"
 
-#: ../client/pk-console.c:643
-msgid "Could not find a package with that name to remove"
-msgstr "ਉਸ ਨਾਂ ਦਾ ਪੈਕੇਜ ਹਟਾਉਣ ਲਈ ਲੱਭਿਆ ਨਹੀਂ ਜਾ ਸਕਿਆ"
+#. TRANSLATORS: There was an error getting the dependencies for the package. The detailed error follows
+#: ../client/pk-console.c:1060 ../client/pk-console.c:1068
+#, c-format
+msgid "This tool could not get the dependencies for %s: %s"
+msgstr "ਇਹ ਟੂਲ %s ਲਈ ਨਿਰਭਰਤਾ ਨਹੀਂ ਲੈ ਸਕਿਆ: %s"
 
-#: ../client/pk-console.c:683
-msgid "The following packages have to be removed"
-msgstr "ਹੇਠ ਦਿੱਤੇ ਪੈਕੇਜ ਹਟਾਏ ਜਾ ਚੁੱਕੇ ਹਨ"
+#. TRANSLATORS: There was an error getting the details about the package. The detailed error follows
+#: ../client/pk-console.c:1090 ../client/pk-console.c:1098
+#, c-format
+msgid "This tool could not get package details for %s: %s"
+msgstr "ਇਹ ਟੂਲ %s ਲਈ ਵੇਰਵਾ ਨਹੀਂ ਲੈ ਸਕਿਆ: %s"
 
-#. get user input
-#: ../client/pk-console.c:692
-msgid "Okay to remove additional packages?"
-msgstr "ਹੋਰ ਪੈਕੇਜ ਹਟਾਉਣ ਲਈ ਮਨਜ਼ੂਰੀ ਹੈ?"
+#. TRANSLATORS: The package name was not found in any software sources. The detailed error follows
+#: ../client/pk-console.c:1120
+#, c-format
+msgid "This tool could not find the files for %s: %s"
+msgstr "ਇਹ ਟੂਲ %s ਲਈ ਫਾਇਲਾਂ ਨਹੀਂ ਲੱਭ ਸਕਿਆ: %s"
 
-#: ../client/pk-console.c:696
-msgid "Cancelled!"
-msgstr "ਰੱਦ ਕੀਤਾ!"
+#. TRANSLATORS: There was an error getting the list of files for the package. The detailed error follows
+#: ../client/pk-console.c:1128
+#, c-format
+msgid "This tool could not get the file list for %s: %s"
+msgstr "ਇਹ ਟੂਲ %s ਲਈ ਫਾਇਲ ਲਿਸਟ ਨਹੀਂ ਲੈ ਸਕਿਆ: %s"
 
-#: ../client/pk-console.c:718
-msgid "Could not find a package with that name to update"
-msgstr "ਉਸ ਨਾਂ ਦਾ ਪੈਕੇਜ ਅੱਪਡੇਟ ਕਰਨ ਲਈ ਲੱਭਿਆ ਨਹੀਂ ਜਾ ਸਕਿਆ"
+#. TRANSLATORS: There was an error getting the list of packages. The filename follows
+#: ../client/pk-console.c:1150
+#, c-format
+msgid "File already exists: %s"
+msgstr "ਫਾਇਲ ਪਹਿਲਾਂ ਹੀ ਮੌਜੂਦ ਹੈ: %s"
+
+#. TRANSLATORS: follows a list of packages to install
+#: ../client/pk-console.c:1155 ../client/pk-console.c:1211
+#: ../client/pk-console.c:1286
+msgid "Getting package list"
+msgstr "ਪੈਕੇਜ ਲਿਸਟ ਲਈ ਜਾ ਰਹੀ ਹੈ"
+
+#. TRANSLATORS: There was an error getting the list of packages. The detailed error follows
+#: ../client/pk-console.c:1161 ../client/pk-console.c:1217
+#: ../client/pk-console.c:1292
+#, c-format
+msgid "This tool could not get package list: %s"
+msgstr "ਇਹ ਟੂਲ ਪੈਕੇਜ ਲਿਸਟ ਨਹੀਂ ਲਈ ਜਾ ਸਕੀ: %s"
 
-#: ../client/pk-console.c:736
-msgid "Could not find what packages require this package"
-msgstr "ਇਸ ਪੈਕੇਜ ਲਈ ਲੋੜੀਦਾ ਪੈਕੇਜ ਲੱਭਿਆ ਨਹੀਂ ਜਾ ਸਕਿਆ"
+#. TRANSLATORS: There was an error saving the list
+#: ../client/pk-console.c:1172
+msgid "Failed to save to disk"
+msgstr "ਡਿਸਕ ਉੱਤੇ ਸੰਭਾਲਣ ਲਈ ਫੇਲ੍ਹ ਹੈ"
 
-#: ../client/pk-console.c:754
-msgid "Could not get dependencies for this package"
-msgstr "ਇਸ ਪੈਕੇਜ ਲਈ ਨਿਰਭਰਤਾ ਲਈ ਨਹੀਂ ਜਾ ਸਕੀ"
+#. TRANSLATORS: There was an error getting the list. The filename follows
+#: ../client/pk-console.c:1206 ../client/pk-console.c:1281
+#, c-format
+msgid "File does not exist: %s"
+msgstr "ਫਾਇਲ ਮੌਜੂਦ ਨਹੀਂ: %s"
+
+#. TRANSLATORS: header to a list of packages newly added
+#: ../client/pk-console.c:1238
+msgid "Packages to add"
+msgstr "ਸ਼ਾਮਲ ਕਰਨ ਲਈ ਪੈਕੇਜ"
+
+#. TRANSLATORS: header to a list of packages removed
+#: ../client/pk-console.c:1246
+msgid "Packages to remove"
+msgstr "ਹਟਾਉਣ ਲਈ ਪੈਕੇਜ"
+
+#. TRANSLATORS: We didn't find any differences
+#: ../client/pk-console.c:1314
+msgid "No new packages need to be installed"
+msgstr "ਕੋਈ ਨਵਾਂ ਪੈਕੇਜ ਇੰਸਟਾਲ ਕਰਨ ਦੀ ਲੋੜ ਨਹੀਂ ਹੈ"
+
+#. TRANSLATORS: follows a list of packages to install
+#: ../client/pk-console.c:1320
+msgid "To install"
+msgstr "ਇੰਸਟਾਲ ਲਈ"
+
+#. TRANSLATORS: searching takes some time....
+#: ../client/pk-console.c:1332
+msgid "Searching for package: "
+msgstr "ਪੈਕੇਜ ਲਈ ਖੋਜ ਜਾਰੀ:"
+
+#. TRANSLATORS: package was not found -- this is the end of a string ended in ...
+#: ../client/pk-console.c:1336
+msgid "not found."
+msgstr "ਨਹੀਂ ਲੱਭਿਆ।"
+
+#. TRANSLATORS: We didn't find any packages to install
+#: ../client/pk-console.c:1347
+msgid "No packages can be found to install"
+msgstr "ਇੰਸਟਾਲ ਕਰਨ ਲਈ ਕੋਈ ਪੈਕੇਜ ਨਹੀਂ ਲੱਭਿਆ"
+
+#. TRANSLATORS: installing new packages from package list
+#: ../client/pk-console.c:1353
+msgid "Installing packages"
+msgstr "ਪੈਕੇਜ ਇੰਸਟਾਲ ਕੀਤੇ ਜਾ ਰਹੇ ਹਨ"
 
-#: ../client/pk-console.c:772
-msgid "Could not find details for this package"
-msgstr "ਇਸ ਪੈਕੇਜ ਲਈ ਵੇਰਵਾ ਲੱਭਿਆ ਨਹੀਂ ਜਾ ਸਕਿਆ"
+#. TRANSLATORS: The package name was not found in any software sources. The detailed error follows
+#: ../client/pk-console.c:1389
+#, c-format
+msgid "This tool could not find the update details for %s: %s"
+msgstr "ਇਹ ਟੂਲ %s ਲਈ ਅੱਪਡੇਟ ਵੇਰਵਾ ਨਹੀਂ ਲੱਭ ਸਕਿਆ: %s"
 
-#: ../client/pk-console.c:790
+#. TRANSLATORS: There was an error getting the details about the update for the package. The detailed error follows
+#: ../client/pk-console.c:1397
 #, c-format
-msgid "Could not find the files for this package"
-msgstr "ਇਸ ਪੈਕੇਜ ਲਈ ਫਾਇਲਾਂ ਲੱਭੀਆਂ ਨਹੀਂ ਜਾ ਸਕੀਆਂ"
+msgid "This tool could not get the update details for %s: %s"
+msgstr "ਇਹ ਟੂਲ %s ਲਈ ਅੱਪਡੇਟ ਵੇਰਵਾ ਨਹੀਂ ਲੈ ਸਕਿਆ: %s"
+
+#. TRANSLATORS: This was an unhandled error, and we don't have _any_ context
+#: ../client/pk-console.c:1443
+msgid "Error:"
+msgstr "ਗਲਤੀ:"
 
-#: ../client/pk-console.c:870
+#. TRANSLATORS: This a list of details about the package
+#: ../client/pk-console.c:1457
 msgid "Package description"
 msgstr "ਪੈਕੇਜ ਵੇਰਵਾ"
 
-#: ../client/pk-console.c:893
+#. TRANSLATORS: This a list files contained in the package
+#: ../client/pk-console.c:1491
 msgid "Package files"
 msgstr "ਪੈਕੇਜ ਫਾਇਲਾਂ"
 
-#: ../client/pk-console.c:901
+#. TRANSLATORS: This where the package has no files
+#: ../client/pk-console.c:1499
 msgid "No files"
 msgstr "ਕੋਈ ਫਾਇਲ ਨਹੀਂ"
 
-#. get user input
-#: ../client/pk-console.c:933
-msgid "Okay to import key?"
-msgstr "ਕੁੰਜੀ ਇੰਪੋਰਟ ਕਰਨ ਲਵਾਂ?"
-
-#: ../client/pk-console.c:936
-msgid "Did not import key"
-msgstr "ਕੁੰਜੀ ਇੰਪੋਰਟ ਨਾ ਕਰੋ"
-
-#. get user input
-#: ../client/pk-console.c:976
-msgid "Do you agree?"
-msgstr "ਕੀ ਤੁਸੀਂ ਸਹਿਮਤ ਹੋ?"
-
-#: ../client/pk-console.c:979
-msgid "Did not agree to licence, task will fail"
-msgstr "ਲਾਈਸੈਂਸ ਨਾਲ ਸਹਿਮਤ ਨਹੀਂ, ਕੰਮ ਪੂਰਾ ਨਹੀਂ ਹੋਵੇਗਾ"
-
-#: ../client/pk-console.c:1008
+#. TRANSLATORS: This a request for a GPG key signature from the backend, which the client will prompt for later
+#: ../client/pk-console.c:1522
+msgid "Repository signature required"
+msgstr "ਰਿਪੋਜ਼ਟਰੀ ਦਸਤਖਤ ਲੋੜੀਦੇ"
+
+#. TRANSLATORS: This a prompt asking the user to import the security key
+#: ../client/pk-console.c:1532
+msgid "Do you accept this signature?"
+msgstr "ਕੀ ਤੁਸੀਂ ਇਹ ਦਸਤਖਤ ਮਨਜ਼ੂਰ ਕਰਦੇ ਹੋ?"
+
+#. TRANSLATORS: This is where the user declined the security key
+#: ../client/pk-console.c:1536
+msgid "The signature was not accepted."
+msgstr "ਦਸਤਖਤ ਮਨਜ਼ੂਰ ਨਹੀਂ ਸਨ।"
+
+#. TRANSLATORS: This a request for a EULA
+#: ../client/pk-console.c:1570
+msgid "End user license agreement required"
+msgstr "ਅੰਤਮ ਯੂਜ਼ਰ ਲਾਈਸੈਂਸ ਇਕਰਾਰਨਾਮਾ ਲੋੜੀਦਾ"
+
+#. TRANSLATORS: This a prompt asking the user to agree to the license
+#: ../client/pk-console.c:1577
+msgid "Do you agree to this license?"
+msgstr "ਕੀ ਤੁਸੀਂ ਇਸ ਲਾਈਸੈਂਸ ਨਾਲ ਸਹਿਮਤ ਹੋ?"
+
+#. TRANSLATORS: This is where the user declined the license
+#: ../client/pk-console.c:1581
+msgid "The license was refused."
+msgstr "ਲਾਈਸੈਂਸ ਤੋਂ ਇਨਕਾਰ ਕੀਤਾ।"
+
+#. TRANSLATORS: This is when the daemon crashed, and we are up shit creek without a paddle
+#: ../client/pk-console.c:1610
 msgid "The daemon crashed mid-transaction!"
 msgstr "ਡੈਮਨ ਅਧੂਰੀ ਟਰਾਂਜ਼ਿਸ਼ਨ ਵਿੱਚ ਨਸ਼ਟ ਹੋ ਗਈ!"
 
-#. header
-#: ../client/pk-console.c:1061
+#. TRANSLATORS: This is the header to the --help menu
+#: ../client/pk-console.c:1663
 msgid "PackageKit Console Interface"
 msgstr "ਪੈਕੇਜਕਿੱਟ ਕਨਸੋਲ ਇੰਟਰਫੇਸ"
 
-#: ../client/pk-console.c:1061
+#. these are commands we can use with pkcon
+#: ../client/pk-console.c:1665
 msgid "Subcommands:"
 msgstr "ਸਬ-ਕਮਾਂਡ:"
 
-#: ../client/pk-console.c:1165 ../client/pk-monitor.c:104 ../src/pk-main.c:189
+#. TRANSLATORS: command line argument, if we should show debugging information
+#. TRANSLATORS: if we should show debugging data
+#: ../client/pk-console.c:1757 ../client/pk-generate-pack.c:185
+#: ../client/pk-monitor.c:125
+#: ../contrib/command-not-found/pk-command-not-found.c:510
+#: ../contrib/app-install/pk-app-install-add.c:244
+#: ../contrib/app-install/pk-app-install-create.c:48
+#: ../contrib/app-install/pk-app-install-generate.c:244
+#: ../contrib/app-install/pk-app-install-remove.c:87 ../src/pk-main.c:199
 msgid "Show extra debugging information"
 msgstr "ਹੋਰ ਡੀਬੱਗ ਜਾਣਕਾਰੀ ਵੇਖੋ"
 
-#: ../client/pk-console.c:1167 ../client/pk-monitor.c:106
+#. TRANSLATORS: command line argument, just show the version string
+#: ../client/pk-console.c:1760 ../client/pk-monitor.c:127
 msgid "Show the program version and exit"
 msgstr "ਪਰੋਗਰਾਮ ਵਰਜਨ ਵੇਖੋ ਅਤੇ ਬੰਦ ਕਰੋ"
 
-#: ../client/pk-console.c:1169
+#. TRANSLATORS: command line argument, use a filter to narrow down results
+#: ../client/pk-console.c:1763
 msgid "Set the filter, e.g. installed"
 msgstr "ਫਿਲਟਰ ਸੈੱਟ ਕਰੋ, ਜਿਵੇਂ ਕਿ ਇੰਸਟਾਲ"
 
-#: ../client/pk-console.c:1171
+#. TRANSLATORS: command line argument, work asynchronously
+#: ../client/pk-console.c:1766
 msgid "Exit without waiting for actions to complete"
 msgstr "ਪੂਰੇ ਹੋਣ ਵਾਲੇ ਐਕਸ਼ਨ ਦੀ ਉਡੀਕ ਕੀਤੇ ਬਿਨਾਂ ਬੰਦ ਕਰੋ"
 
-#: ../client/pk-console.c:1194
-msgid "Could not connect to system DBUS."
-msgstr "ਸਿਸਟਮ DBUS ਨਾਲ ਕੁਨੈਕਟ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਿਆ।"
-
-#: ../client/pk-console.c:1288
-#, c-format
-msgid "You need to specify a search type"
-msgstr "ਤੁਹਾਨੂੰ ਖੋਜ ਟਾਈਪ ਦੱਸਣੀ ਪਵੇਗੀ"
-
-#: ../client/pk-console.c:1293 ../client/pk-console.c:1300
-#: ../client/pk-console.c:1307 ../client/pk-console.c:1314
-#: ../client/pk-console.c:1421 ../client/pk-console.c:1428
-#: ../client/pk-console.c:1435 ../client/pk-console.c:1442
-#, c-format
-msgid "You need to specify a search term"
-msgstr "ਤੁਹਾਨੂੰ ਖੋਜ ਸ਼ਬਦ ਦੇਣਾ ਪਵੇਗਾ"
-
-#: ../client/pk-console.c:1319
-#, c-format
+#. TRANSLATORS: This is when we could not connect to the system bus, and is fatal
+#: ../client/pk-console.c:1793
+msgid "This tool could not connect to system DBUS."
+msgstr "ਇਹ ਟੂਲ ਸਿਸਟਮ DBUS ਨਾਲ ਕੁਨੈਕਟ ਨਹੀਂ ਹੋ ਸਕਿਆ।"
+
+#. TRANSLATORS: The user specified an incorrect filter
+#: ../client/pk-console.c:1880
+msgid "The filter specified was invalid"
+msgstr "ਦਿੱਤਾ ਫਿਲਟਰ ਅਢੁੱਕਵਾਂ ਹੈ।"
+
+#. TRANSLATORS: a search type can be name, details, file, etc
+#: ../client/pk-console.c:1898
+msgid "A search type is required, e.g. name"
+msgstr "ਖੋਜ ਕਿਸਮ ਚਾਹੀਦੀ ਹੈ, ਜਿਵੇਂ ਨਾਂ"
+
+#. TRANSLATORS: the user needs to provide a search term
+#: ../client/pk-console.c:1904 ../client/pk-console.c:1912
+#: ../client/pk-console.c:1920 ../client/pk-console.c:1928
+msgid "A search term is required"
+msgstr "ਖੋਜ ਸ਼ਬਦ ਦੀ ਲੋੜ ਹੈ"
+
+#. TRANSLATORS: the search type was provided, but invalid
+#: ../client/pk-console.c:1934
 msgid "Invalid search type"
 msgstr "ਗਲਤ ਖੋਜ ਟਾਈਪ"
 
-#: ../client/pk-console.c:1324
+#. TRANSLATORS: the user did not specify what they wanted to install
+#: ../client/pk-console.c:1940
+msgid "A package name or filename to install is required"
+msgstr "ਇੰਸਟਾਲ ਕਰਨ ਲਈ ਇੱਕ ਪੈਕੇਜ ਨਾਂ ਜਾਂ ਫਾਇਲ ਨਾਂ ਦੀ ਲੋੜ ਹੈ"
+
+#. TRANSLATORS: geeky error, 99.9999% of users won't see this
+#: ../client/pk-console.c:1948
+msgid "A type, key_id and package_id are required"
+msgstr "ਟਾਈਪ, key_id ਜਾਂ package_id ਦੇਣ ਦੀ ਲੋੜ ਹੈ"
+
+#. TRANSLATORS: the user did not specify what they wanted to remove
+#: ../client/pk-console.c:1956
+msgid "A package name to remove is required"
+msgstr "ਹਟਾਉਣ ਵਾਸਤੇ ਪੈਕੇਜ ਨਾਂ ਚਾਹੀਦਾ ਹੈ"
+
+#. TRANSLATORS: the user did not specify anything about what to download or where
+#: ../client/pk-console.c:1963
+msgid "A destination directory and then the package names to download are required"
+msgstr "ਡਾਊਨਲੋਡ ਕਰਨ ਵਾਸਤੇ ਟਿਕਾਣਾ ਡਾਇਰੈਕਟਰੀ ਅਤੇ ਤਦ ਪੈਕੇਜ ਨਾਂ ਲਾਜ਼ਮੀ ਹੈ"
+
+#. TRANSLATORS: the directory does not exist, so we can't continue
+#: ../client/pk-console.c:1969
+msgid "Directory not found"
+msgstr "ਡਾਇਰੈਕਟਰੀ ਨਹੀਂ ਲੱਭੀ"
+
+#. TRANSLATORS: geeky error, 99.9999% of users won't see this
+#: ../client/pk-console.c:1976
+msgid "A licence identifier (eula-id) is required"
+msgstr "ਇੱਕ ਲਾਈਸੈਂਸ ਪਛਾਣਕਰਤਾ (eula-id) ਲਾਜ਼ਮੀ ਹੈ"
+
+#. TRANSLATORS: geeky error, 99.9999% of users won't see this
+#: ../client/pk-console.c:1985
+msgid "A transaction identifier (tid) is required"
+msgstr "ਟਰਾਂਸੈਕਸ਼ਨ ਪਛਾਣ (tid) ਲੋੜੀਦਾ ਹੈ"
+
+#. TRANSLATORS: The user did not specify a package name
+#: ../client/pk-console.c:2001
+msgid "A package name to resolve is required"
+msgstr "ਹੱਲ ਕਰਨ ਲਈ ਪੈਕੇਜ ਨਾਂ ਲਾਜ਼ਮੀ ਹੈ"
+
+#. TRANSLATORS: The user did not specify a repository (software source) name
+#: ../client/pk-console.c:2009 ../client/pk-console.c:2017
+msgid "A repository name is required"
+msgstr "ਰਿਪੋਜ਼ਟਰੀ ਨਾਂ ਲੋੜੀਦਾ ਹੈ"
+
+#. TRANSLATORS: The user didn't provide any data
+#: ../client/pk-console.c:2025
+msgid "A repo name, parameter and value are required"
+msgstr "ਰੈਪੋ ਨਾਂ, ਪੈਰਾਮੀਟਰ ਅਤੇ ਮੁੱਲ ਲੋੜੀਦਾ ਹੈ"
+
+#. TRANSLATORS: The user didn't specify what action to use
+#: ../client/pk-console.c:2038
+msgid "An action, e.g. 'update-system' is required"
+msgstr "ਕਾਰਵਾਈ, ਜਿਵੇਂ 'ਅੱਪਡੇਟ-ਸਿਸਟਮ' ਲੋੜੀਦਾ ਹੈ"
+
+#. TRANSLATORS: The user specified an invalid action
+#: ../client/pk-console.c:2044
+msgid "A correct role is required"
+msgstr "ਠੀਕ ਰੋਲ ਲੋੜੀਦਾ ਹੈ"
+
+#. TRANSLATORS: we keep a database updated with the time that an action was last executed
+#: ../client/pk-console.c:2050
+msgid "Failed to get the time since this action was last completed"
+msgstr "ਇਸ ਕਾਰਵਾਈ ਦੇ ਆਖਰੀ ਵਾਰ ਪੂਰੀ ਹੋਣ ਤੋਂ ਬਾਅਦ ਸਮਾਂ ਲੈਣ ਲਈ ਫੇਲ੍ਹ ਹੈ"
+
+#. TRANSLATORS: The user did not provide a package name
+#. TRANSLATORS: This is when the user fails to supply the package name
+#: ../client/pk-console.c:2059 ../client/pk-console.c:2070
+#: ../client/pk-console.c:2078 ../client/pk-console.c:2094
+#: ../client/pk-console.c:2102 ../client/pk-generate-pack.c:241
+msgid "A package name is required"
+msgstr "ਪੈਕੇਜ ਨਾਂ ਲੋੜੀਦਾ ਹੈ"
+
+#. TRANSLATORS: each package "provides" certain things, e.g. mime(gstreamer-decoder-mp3), the user didn't specify it
+#: ../client/pk-console.c:2086
+msgid "A package provide string is required"
+msgstr "ਪੈਕੇਜ ਦੇਣ ਵਾਲੀ ਸਤਰ ਲੋੜੀਦੀ ਹੈ"
+
+#. TRANSLATORS: The user didn't specify a filename to create as a list
+#: ../client/pk-console.c:2110
+msgid "A list file name to create is required"
+msgstr "ਬਣਾਉਣ ਲਈ ਲਿਸਟ ਫਾਇਲ ਨਾਂ ਲੋੜੀਦਾ ਹੈ"
+
+#. TRANSLATORS: The user didn't specify a filename to open as a list
+#: ../client/pk-console.c:2119 ../client/pk-console.c:2128
+msgid "A list file to open is required"
+msgstr "ਖੋਲ੍ਹਣ ਲਈ ਲਿਸਟ ਫਾਇਲ ਲੋੜੀਦੀ ਹੈ"
+
+#. TRANSLATORS: The user tried to use an unsupported option on the command line
+#: ../client/pk-console.c:2181
 #, c-format
-msgid "You need to specify a package or file to install"
-msgstr "ਤੁਹਾਨੂੰ ਇੰਸਟਾਲ ਕਰਨ ਲਈ ਇੱਕ ਪੈਕੇਜ ਜਾਂ ਫਾਇਲ ਦੇਣ ਦੀ ਲੋੜ ਹੈ"
+msgid "Option '%s' is not supported"
+msgstr "ਚੋਣ '%s' ਸਹਾਇਕ ਨਹੀਂ ਹੈ"
 
-#: ../client/pk-console.c:1339
-#, c-format
-msgid "You need to specify a type, key_id and package_id"
-msgstr "ਤੁਹਾਨੂੰ ਇੱਕ ਟਾਈਪ, key_id ਜਾਂ package_id ਦੇਣ ਦੀ ਲੋੜ ਹੈ"
+#. TRANSLATORS: User does not have permission to do this
+#: ../client/pk-console.c:2194
+msgid "Incorrect privileges for this operation"
+msgstr "ਇਸ ਕਾਰਵਾਈ ਲਈ ਗਲਤ ਅਧਿਕਾਰ"
 
-#: ../client/pk-console.c:1346
-#, c-format
-msgid "You need to specify a package to remove"
-msgstr "ਤੁਹਾਨੂੰ ਹਟਾਉਣ ਵਾਸਤੇ ਇੱਕ ਪੈਕੇਜ ਦੇਣਾ ਪਵੇਗਾ"
+#. TRANSLATORS: Generic failure of what they asked to do
+#: ../client/pk-console.c:2197
+msgid "Command failed"
+msgstr "ਕਮਾਂਡ ਫੇਲ੍ਹ ਹੈ"
 
-#: ../client/pk-console.c:1353
+#. TRANSLATORS: This is the state of the transaction
+#: ../client/pk-generate-pack.c:101
+msgid "Downloading"
+msgstr "ਡਾਊਨਲੋਡ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ"
+
+#. TRANSLATORS: This is when the main packages are being downloaded
+#: ../client/pk-generate-pack.c:121
+msgid "Downloading packages"
+msgstr "ਪੈਕੇਜ ਡਾਊਨਲੋਡ ਕੀਤੇ ਜਾ ਰਹੇ ਹਨ"
+
+#. TRANSLATORS: This is when the dependency packages are being downloaded
+#: ../client/pk-generate-pack.c:126
+msgid "Downloading dependencies"
+msgstr "ਨਿਰਭਰਤਾ ਡਾਊਨਲੋਡ ਕੀਤੀ ਜਾ ਰਹੀ ਹੈ"
+
+#. TRANSLATORS: we can exclude certain packages (glibc) when we know they'll exist on the target
+#: ../client/pk-generate-pack.c:188
+msgid "Set the file name of dependencies to be excluded"
+msgstr "ਨਿਰਭਰਤਾ ਲਈ ਫਾਇਲ ਨਾਂ ਦਿਓ, ਜਿਸ ਨੂੰ ਵੱਖ ਰੱਖਿਆ ਜਾਵੇ"
+
+#. TRANSLATORS: the output location
+#: ../client/pk-generate-pack.c:191
+msgid "The output file or directory (the current directory is used if ommitted)"
+msgstr "ਆਉਟਪੁੱਟ ਫਾਇਲ ਜਾਂ ਡਾਇਰੈਕਟਰੀ (ਮੌਜੂਦਾ ਡਾਇਰੈਕਟਰੀ ਵਰਤੀ ਜਾਵੇਗੀ, ਜੇ ਨਾ ਦਿੱਤੀ)"
+
+#. TRANSLATORS: put a list of packages in the pack
+#: ../client/pk-generate-pack.c:194
+msgid "The package to be put into the service pack"
+msgstr "ਸਰਵਿਸ ਪੈਕ ਵਿੱਚ ਰੱਖਣ ਵਾਸਤੇ ਪੈਕੇਜ"
+
+#. TRANSLATORS: put all pending updates in the pack
+#: ../client/pk-generate-pack.c:197
+msgid "Put all updates available in the service pack"
+msgstr "ਸਰਵਿਸ ਪੈਕ ਵਿੱਚ ਸਭ ਉਪਲੱਬਧ ਅੱਪਡੇਟ ਰੱਖੋ"
+
+#. TRANSLATORS: This is when the user fails to supply the correct arguments
+#: ../client/pk-generate-pack.c:225
+msgid "Neither --package or --updates option selected."
+msgstr "ਨਾ ਤਾਂ --package ਚੋਣ ਕੀਤੀ ਗਈ ਅਤੇ ਨਾ ਹੀ --updates"
+
+#. TRANSLATORS: This is when the user fails to supply just one argument
+#: ../client/pk-generate-pack.c:233
+msgid "Both options selected."
+msgstr "ਦੋਵੇਂ ਚੋਣਾਂ ਕੀਤੀਆਂ।"
+
+#. TRANSLATORS: This is when the user fails to supply the output
+#: ../client/pk-generate-pack.c:249
+msgid "A output directory or file name is required"
+msgstr "ਆਉਟਪੁੱਟ ਡਾਇਰੈਕਟਰੀ ਅਤੇ ਫਾਇਲ ਨਾਂ ਲੋੜੀਦਾ ਹੈ"
+
+#. TRANSLATORS: This is when the backend doesn't have the capability to get-depends
+#. TRANSLATORS: This is when the backend doesn't have the capability to download
+#: ../client/pk-generate-pack.c:267 ../client/pk-generate-pack.c:273
+msgid "The package manager cannot perform this type of operation."
+msgstr "ਪੈਕੇਜ ਮੈਨੇਜਰ ਇਸ ਕਿਸਮ ਦੀ ਕਾਰਵਾਈ ਨਹੀਂ ਕਰ ਸਕਦਾ ਹੈ।"
+
+#. TRANSLATORS: the user specified an absolute path, but didn't get the extension correct
+#: ../client/pk-generate-pack.c:285
+msgid "If specifying a file, the service pack name must end with"
+msgstr "ਜੇ ਫਾਇਲ ਦਿੱਤੀ ਤਾਂ ਸਰਵਿਸ ਪੈਕ ਨਾਂ ਖਤਮ ਹੋਣਾ ਚਾਹੀਦਾ ਹੈ"
+
+#. TRANSLATORS: This is when file already exists
+#: ../client/pk-generate-pack.c:301
+msgid "A pack with the same name already exists, do you want to overwrite it?"
+msgstr "ਇਸ ਨਾਂ ਨਾਲ ਪੈਕ ਪਹਿਲਾਂ ਹੀ ਮੌਜੂਦ ਹੈ, ਕੀ ਇਸ ਉੱਤੇ ਲਿਖਣਾ ਹੈ?"
+
+#. TRANSLATORS: This is when the pack was not overwritten
+#: ../client/pk-generate-pack.c:304
+msgid "The pack was not overwritten."
+msgstr "ਪੈਕ ਉੱਤੇ ਨਹੀਂ ਲਿਖਿਆ ਜਾਵੇਗਾ।"
+
+#. TRANSLATORS: This is when the temporary directory cannot be created, the directory name follows
+#: ../client/pk-generate-pack.c:317
+msgid "Failed to create directory:"
+msgstr "ਡਾਇਰੈਕਟਰੀ ਬਣਾਉਣ ਲਈ ਫੇਲ੍ਹ ਹੈ:"
+
+#. TRANSLATORS: This is when the list of packages from the remote computer cannot be opened
+#: ../client/pk-generate-pack.c:327
+msgid "Failed to open package list."
+msgstr "ਪੈਕੇਜ ਲਿਸਟ ਖੋਲ੍ਹਣ ਲਈ ਫੇਲ੍ਹ ਹੈ।"
+
+#. TRANSLATORS: The package name is being matched up to available packages
+#: ../client/pk-generate-pack.c:338
+msgid "Finding package name."
+msgstr "ਪੈਕੇਜ ਨਾਂ ਲੱਭਿਆ ਜਾ ਰਿਹਾ ਹੈ।"
+
+#. TRANSLATORS: This is when the package cannot be found in any software source. The detailed error follows
+#: ../client/pk-generate-pack.c:342
 #, c-format
-msgid "You need to specify a eula-id"
-msgstr "ਤੁਹਾਨੂੰ eula-id ਦੇਣਾ ਪਵੇਗਾ"
+msgid "Failed to find package '%s': %s"
+msgstr "'%s' ਪੈਕੇਜ ਖੋਜਣ ਲਈ ਫੇਲ੍ਹ ਹੈ: %s"
 
-#: ../client/pk-console.c:1369
-#, c-format
-msgid "You need to specify a package name to resolve"
-msgstr "ਤੁਹਾਨੂੰ ਹੱਲ਼ ਕਰਨ ਲਈ ਇੱਕ ਪੈਕੇਜ ਨਾਂ ਦੇਣਾ ਪਵੇਗਾ"
+#. TRANSLATORS: This is telling the user we are in the process of making the pack
+#: ../client/pk-generate-pack.c:359
+msgid "Creating service pack..."
+msgstr "ਸਰਵਿਸ ਪੈਕ ਬਣਾਇਆ ਜਾ ਰਿਹਾ ਹੈ..."
 
-#: ../client/pk-console.c:1376 ../client/pk-console.c:1383
+#. TRANSLATORS: we succeeded in making the file
+#: ../client/pk-generate-pack.c:366
 #, c-format
-msgid "You need to specify a repo name"
-msgstr "ਤੁਹਾਨੂੰ ਇੱਕ ਰੈਪੋ ਨਾਂ ਦੇਣਾ ਪਵੇਗਾ"
+msgid "Service pack created '%s'"
+msgstr "ਸਰਵਿਸ ਪੈਕ ਬਣਾਇਆ '%s'"
 
-#: ../client/pk-console.c:1390
+#. TRANSLATORS: we failed to make te file
+#: ../client/pk-generate-pack.c:371
 #, c-format
-msgid "You need to specify a repo name/parameter and value"
-msgstr "ਤੁਹਾਨੂੰ ਇੱਕ ਰੈਪੋ ਨਾਂ/ਪੈਰਾਮੀਟਰ ਅਤੇ ਮੁੱਲ ਦੇਣ ਦੀ ਲੋੜ ਹੈ"
+msgid "Failed to create '%s': %s"
+msgstr "'%s' ਬਣਾਉਣ ਲਈ ਫੇਲ੍ਹ: %s"
 
-#: ../client/pk-console.c:1403
-#, c-format
-msgid "You need to specify a time term"
-msgstr "ਤੁਹਾਨੂੰ ਇੱਕ ਟਾਈਮ ਟਰਮ ਦੇਣ ਦੀ ਲੋੜ ਹੈ"
+#. TRANSLATORS: this is a program that monitors PackageKit
+#: ../client/pk-monitor.c:143
+msgid "PackageKit Monitor"
+msgstr "ਪੈਕੇਜਕਿੱਟ ਮਾਨੀਟਰ"
 
-#: ../client/pk-console.c:1408
-#, c-format
-msgid "You need to specify a correct role"
-msgstr "ਤੁਹਾਨੂੰ ਇੱਕ ਠੀਕ ਰੋਲ ਦੇਣ ਦੀ ਲੋੜ ਹੈ"
+#. TRANSLATORS: The package was not found in any software sources
+#: ../client/pk-tools-common.c:118
+msgid "The package could not be found"
+msgstr "ਪੈਕੇਜ ਨਹੀਂ ਲੱਭਿਆ ਜਾ ਸਕਿਆ"
 
-#: ../client/pk-console.c:1413
-#, c-format
-msgid "Failed to get last time"
-msgstr "ਆਖਰੀ ਟਾਈਮ ਲੈਣ ਲਈ ਫੇਲ੍ਹ"
+#. TRANSLATORS: more than one package could be found that matched, to follow is a list of possible packages
+#: ../client/pk-tools-common.c:130
+msgid "More than one package matches:"
+msgstr "ਇੱਕ ਤੋਂ ਵੱਧ ਰਲਦੇ ਪੈਕੇਜ ਲੱਭੇ:"
 
-#: ../client/pk-console.c:1449
-#, c-format
-msgid "You need to specify a package to find the details for"
-msgstr "ਤੁਹਾਨੂੰ ਵੇਰਵਾ ਲੱਭਣ ਲਈ ਇੱਕ ਪੈਕੇਜ ਦੇਣ ਦੀ ਲੋੜ ਹੈ"
+#. TRANSLATORS: This finds out which package in the list to use
+#: ../client/pk-tools-common.c:137
+msgid "Please choose the correct package: "
+msgstr "ਠੀਕ ਪੈਕੇਜ ਚੁਣੋ ਜੀ:"
 
-#: ../client/pk-console.c:1456
+#: ../client/pk-tools-common.c:162
 #, c-format
-msgid "You need to specify a package to find the files for"
-msgstr "ਤੁਹਾਨੂੰ ਫਾਇਲਾਂ ਲੱਭਣ ਲਈ ਇੱਕ ਪੈਕੇਜ ਦੇਣ ਦੀ ਲੋੜ ਹੈ"
+msgid "Please enter a number from 1 to %i: "
+msgstr "1 ਤੋਂ %i ਤੱਕ ਨੰਬਰ ਦਿਓ ਜੀ:"
 
-#: ../client/pk-console.c:1503
+#. TRANSLATORS: we failed to find the package, this shouldn't happen
+#: ../contrib/command-not-found/pk-command-not-found.c:361
+msgid "Failed to search for file"
+msgstr "ਫਾਇਲ ਲਈ ਖੋਜ ਫੇਲ੍ਹ ਹੈ"
+
+#. TRANSLATORS: we failed to launch the executable, the error follows
+#: ../contrib/command-not-found/pk-command-not-found.c:485
+msgid "Failed to launch:"
+msgstr "ਚਲਾਉਣ ਲਈ ਫੇਲ੍ਹ:"
+
+#. TRANSLATORS: tool that gets called when the command is not found
+#: ../contrib/command-not-found/pk-command-not-found.c:526
+msgid "PackageKit Command Not Found"
+msgstr "ਪੈਕੇਜਕਿੱਟ ਕਮਾਂਡ ਨਹੀਂ ਲੱਭੀ"
+
+#. TRANSLATORS: the prefix of all the output telling the user why it's not executing
+#: ../contrib/command-not-found/pk-command-not-found.c:548
+msgid "Command not found."
+msgstr "ਕਮਾਂਡ ਨਹੀਂ ਲੱਭੀ।"
+
+#. TRANSLATORS: tell the user what we think the command is
+#: ../contrib/command-not-found/pk-command-not-found.c:555
+msgid "Similar command is:"
+msgstr "ਰਲਦੀ ਕਮਾਂਡ ਹੈ:"
+
+#. TRANSLATORS: Ask the user if we should run the similar command
+#: ../contrib/command-not-found/pk-command-not-found.c:564
+msgid "Run similar command:"
+msgstr "ਰਲਦੀ ਕਮਾਂਡ ਚਲਾਓ:"
+
+#. TRANSLATORS: show the user a list of commands that they could have meant
+#. TRANSLATORS: show the user a list of commands we could run
+#: ../contrib/command-not-found/pk-command-not-found.c:576
+#: ../contrib/command-not-found/pk-command-not-found.c:585
+msgid "Similar commands are:"
+msgstr "ਰਲਦੀਆਂ ਕਮਾਂਡਾਂ ਹਨ:"
+
+#. TRANSLATORS: ask the user to choose a file to run
+#: ../contrib/command-not-found/pk-command-not-found.c:592
+msgid "Please choose a command to run"
+msgstr "ਚਲਾਉਣ ਲਈ ਕਮਾਂਡ ਦੀ ਚੋਣ ਕਰੋ ਜੀ"
+
+#. TRANSLATORS: tell the user what package provides the command
+#: ../contrib/command-not-found/pk-command-not-found.c:607
+msgid "The package providing this file is:"
+msgstr "ਪੈਕੇਜ ਇਹ ਫਾਇਲ ਦਿੰਦਾ ਹੈ:"
+
+#. TRANSLATORS: as the user if we want to install a package to provide the command
+#: ../contrib/command-not-found/pk-command-not-found.c:612
+#, c-format
+msgid "Install package '%s' to provide command '%s'?"
+msgstr "ਕਮਾਂਡ '%2$s' ਦੇਣ ਲਈ ਪੈਕੇਜ '%1$s' ਇੰਸਟਾਲ ਕਰਨਾ ਹੈ?"
+
+#. TRANSLATORS: Show the user a list of packages that provide this command
+#: ../contrib/command-not-found/pk-command-not-found.c:633
+msgid "Packages providing this file are:"
+msgstr "ਪੈਕੇਜ ਇਹ ਫਾਇਲ ਦਿੰਦਾ ਹੈ:"
+
+#. TRANSLATORS: Show the user a list of packages that they can install to provide this command
+#: ../contrib/command-not-found/pk-command-not-found.c:642
+msgid "Suitable packages are:"
+msgstr "ਢੁੱਕਵੇਂ ਪੈਕੇਜ ਹਨ:"
+
+#. get selection
+#. TRANSLATORS: ask the user to choose a file to install
+#: ../contrib/command-not-found/pk-command-not-found.c:650
+msgid "Please choose a package to install"
+msgstr "ਇੰਸਟਾਲ ਕਰਨ ਲਈ ਪੈਕੇਜ ਚੁਣੋ ਜੀ"
+
+#. TRANSLATORS: when we are getting data from the daemon
+#: ../contrib/browser-plugin/src/contents.cpp:298
+msgid "Getting package information..."
+msgstr "ਪੈਕੇਜ ਜਾਣਕਾਰੀ ਲਈ ਜਾ ਰਹੀ ਹੈ..."
+
+#. TRANSLATORS: run an applicaiton
+#: ../contrib/browser-plugin/src/contents.cpp:304
 #, c-format
-msgid "Option '%s' not supported"
-msgstr "ਚੋਣ '%s' ਸਹਿਯੋਗੀ ਨਹੀਂ"
+msgid "Run %s"
+msgstr "%s ਚਲਾਓ"
 
-#: ../client/pk-console.c:1514
-msgid "Command failed"
-msgstr "ਕਮਾਂਡ ਫੇਲ੍ਹ ਹੈ"
+#. TRANSLATORS: show the installed version of a package
+#: ../contrib/browser-plugin/src/contents.cpp:310
+msgid "Installed version"
+msgstr "ਇੰਸਟਾਲ ਕੀਤੇ ਵਰਜਨ"
 
-#: ../client/pk-console.c:1518
-msgid "You don't have the necessary privileges for this operation"
-msgstr "ਤੁਹਾਨੂੰ ਇਹ ਓਪਰੇਸ਼ਨ ਕਰਨ ਲਈ ਲੋੜੀਦੇ ਅਧਿਕਾਰ ਨਹੀਂ ਹਨ"
+#. TRANSLATORS: run the application now
+#: ../contrib/browser-plugin/src/contents.cpp:318
+#, c-format
+msgid "Run version %s now"
+msgstr "ਵਰਜਨ %s ਹੁਣੇ ਚਲਾਓ"
 
-#: ../client/pk-monitor.c:117
-msgid "PackageKit Monitor"
-msgstr "ਪੈਕੇਜਕਿੱਟ ਮਾਨੀਟਰ"
+#. TRANSLATORS: run the application now
+#: ../contrib/browser-plugin/src/contents.cpp:324
+msgid "Run now"
+msgstr "ਹੁਣੇ ਚਲਾਓ"
 
-#: ../client/pk-import-desktop.c:293 ../client/pk-import-specspo.c:169
+#. TRANSLATORS: update to a new version of the package
+#: ../contrib/browser-plugin/src/contents.cpp:330
 #, c-format
-msgid "Could not open database: %s"
-msgstr "ਡਾਟਾਬੇਸ ਖੋਲ੍ਹਿਆ ਨਹੀਂ ਜਾ ਸਕਿਆ: %s"
+msgid "Update to version %s"
+msgstr "ਵਰਜਨ %s ਲਈ ਅੱਪਡੇਟ ਕਰੋ"
 
-#: ../client/pk-import-desktop.c:294 ../client/pk-import-specspo.c:170
-msgid "You probably need to run this program as the root user"
-msgstr "ਤੁਹਾਨੂੰ ਇਹ ਪਰੋਗਰਾਮ ਸੰਭਵ ਤੌਰ ਉੱਤੇ root ਯੂਜ਼ਰ ਵਜੋਂ ਚਲਾਉਣਾ ਚਾਹੀਦਾ ਹੈ"
-
-#: ../src/pk-main.c:83
+#. TRANSLATORS: To install a package
+#: ../contrib/browser-plugin/src/contents.cpp:336
+#, c-format
+msgid "Install %s now"
+msgstr "%s ਹੁਣੇ ਇੰਸਟਾਲ ਕਰੋ"
+
+#. TRANSLATORS: the version of the package
+#: ../contrib/browser-plugin/src/contents.cpp:339
+msgid "Version"
+msgstr "ਵਰਜਨ"
+
+#. TRANSLATORS: noting found, so can't install
+#: ../contrib/browser-plugin/src/contents.cpp:344
+msgid "No packages found for your system"
+msgstr "ਤੁਹਾਡੇ ਸਿਸਟਮ ਉੱਤੇ ਕੋਈ ਪੈਕੇਜ ਨਹੀਂ ਲੱਭਿਆ"
+
+#. TRANSLATORS: package is being installed
+#: ../contrib/browser-plugin/src/contents.cpp:349
+msgid "Installing..."
+msgstr "ਇੰਸਟਾਲ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ..."
+
+#. TRANSLATORS: the action is non-localised
+#: ../contrib/app-install/pk-app-install-add.c:247
+#: ../contrib/app-install/pk-app-install-generate.c:247
+msgid "The action, one of 'create', 'add', or 'remove'"
+msgstr "ਕਾਰਵਾਈ 'ਬਣਾਓ', 'ਸ਼ਾਮਲ', ਜਾਂ 'ਹਟਾਓ'"
+
+#. TRANSLATORS: if we are specifing a out-of-tree database
+#: ../contrib/app-install/pk-app-install-add.c:250
+#: ../contrib/app-install/pk-app-install-generate.c:250
+#: ../contrib/app-install/pk-app-install-remove.c:90
+msgid "Main cache file to use (if not specififed, default is used)"
+msgstr "ਵਰਤਣ ਲਈ ਮੁੱਖ ਕੈਸ਼ ਫਾਇਲ (ਜੇ ਨਾ ਦਿੱਤੀ ਤਾਂ ਡਿਫਾਲਟ ਵਰਤੀ ਜਾਵੇਗੀ)"
+
+#. TRANSLATORS: the source database, typically used for adding
+#: ../contrib/app-install/pk-app-install-add.c:253
+#: ../contrib/app-install/pk-app-install-generate.c:253
+msgid "Source cache file to add to the main database"
+msgstr "ਮੁੱਖ ਡਾਟਾਬੇਸ ਵਿੱਚ ਸ਼ਾਮਲ ਕਰਨ ਵਾਸਤੇ ਸਰੋਤ ਕੈਸ਼ ਫਾਇਲ"
+
+#. TRANSLATORS: the icon directory
+#: ../contrib/app-install/pk-app-install-add.c:256
+#: ../contrib/app-install/pk-app-install-generate.c:256
+#: ../contrib/app-install/pk-app-install-remove.c:93
+msgid "Icon directory"
+msgstr "ਆਈਕਾਨ ਡਾਇਰੈਕਟਰੀ"
+
+#. TRANSLATORS: the repo of the software source, e.g. fedora
+#: ../contrib/app-install/pk-app-install-add.c:259
+#: ../contrib/app-install/pk-app-install-generate.c:259
+#: ../contrib/app-install/pk-app-install-remove.c:96
+msgid "Name of the remote repo"
+msgstr "ਰਿਮੋਟ ਰੈਪੋ ਦਾ ਨਾਂ"
+
+#. TRANSLATORS: tool that gets called when the command is not found
+#: ../contrib/app-install/pk-app-install-add.c:270
+#: ../contrib/app-install/pk-app-install-create.c:62
+#: ../contrib/app-install/pk-app-install-generate.c:270
+#: ../contrib/app-install/pk-app-install-remove.c:107
+msgid "PackageKit Application Database Installer"
+msgstr "ਪੈਕੇਜਕਿੱਟ ਐਪਲੀਕੇਸ਼ਨ ਡਾਟਾਬੇਸ ਇੰਸਟਾਲਰ"
+
+#. TRANSLATORS: if we are specifing a out-of-tree database
+#: ../contrib/app-install/pk-app-install-create.c:51
+msgid "Main database file to use (if not specififed, default is used)"
+msgstr "ਵਰਤਣ ਲਈ ਮੁੱਖ ਡਾਟਾਬੇਸ ਫਾਇਲ (ਜੇ ਨਾ ਦਿੱਤੀ ਤਾਂ ਡਿਫਾਲਟ ਵਰਤੀ ਜਾਵੇਗੀ)"
+
+#: ../data/packagekit-catalog.xml.in.h:1
+msgid "PackageKit Catalog"
+msgstr "ਪੈਕੇਜਕਿੱਟ ਸੂਚੀ"
+
+#: ../data/packagekit-package-list.xml.in.h:1
+msgid "PackageKit Package List"
+msgstr "ਪੈਕੇਜਕਿੱਟ ਪੈਕੇਜ ਲਿਸਟ"
+
+#: ../data/packagekit-servicepack.xml.in.h:1
+msgid "PackageKit Service Pack"
+msgstr "ਪੈਕੇਜਕਿੱਟ ਸਰਵਿਸ ਪੈਕ"
+
+#. TRANSLATORS: failed due to DBus security
+#: ../src/pk-main.c:87
 msgid "Startup failed due to security policies on this machine."
 msgstr "ਇਸ ਮਸ਼ੀਨ ਉੱਤੇ ਸੁਰੱਖਿਆ ਪਾਲਸੀਆਂ ਕਰਕੇ ਸ਼ੁਰੂ ਕਰਨ ਲਈ ਫੇਲ੍ਹ"
 
-#: ../src/pk-main.c:84
+#. TRANSLATORS: only two ways this can fail...
+#: ../src/pk-main.c:89
 msgid "This can happen for two reasons:"
 msgstr "ਇਹ ਦੋ ਕਾਰਨਾਂ ਕਰਕੇ ਹੋ ਸਕਦਾ ਹੈ:"
 
-#: ../src/pk-main.c:85
+#. TRANSLATORS: only allowed to be owned by root
+#: ../src/pk-main.c:91
 msgid "The correct user is not launching the executable (usually root)"
 msgstr "ਢੁੱਕਵਾਂ ਯੂਜ਼ਰ ਚੱਲਣਯੋਗ ਨੂੰ ਨਹੀਂ ਚਲਾ ਰਿਹਾ ਹੈ (ਅਕਸਰ root)"
 
-#: ../src/pk-main.c:86
+#. TRANSLATORS: or we are installed in a prefix
+#: ../src/pk-main.c:93
 msgid ""
-"The org.freedesktop.PackageKit.conf file is not installed in the system /etc/"
-"dbus-1/system.d directory"
-msgstr ""
-"org.freedesktop.PackageKit.conf ਫਾਇਲ /etc/dbus-1/system.d ਡਾਇਰੈਕਟਰੀ ਵਿੱਚ "
-"ਇੰਸਟਾਲ ਨਹੀਂ ਹੈ।"
+"The org.freedesktop.PackageKit.conf file is not installed in the system "
+"directory:"
+msgstr "org.freedesktop.PackageKit.conf ਫਾਇਲ ਸਿਸਟਮ ਡਾਇਰੈਕਟਰੀ ਵਿੱਚ ਇੰਸਟਾਲ ਨਹੀਂ ਹੈ।"
 
-#: ../src/pk-main.c:185
+#. TRANSLATORS: a backend is the system package tool, e.g. yum, apt
+#: ../src/pk-main.c:193
 msgid "Packaging backend to use, e.g. dummy"
 msgstr "ਵਰਤਣ ਲਈ ਪੈਕੇਜਿੰਗ ਬੈਕਐਂਡ, ਜਿਵੇਂ ਕਿ ਫ਼ਰਜ਼ੀ"
 
-#: ../src/pk-main.c:187
+#. TRANSLATORS: if we should run in the background
+#: ../src/pk-main.c:196
 msgid "Daemonize and detach from the terminal"
 msgstr "ਡੈਮੇਨਾਈਜ਼ ਅਤੇ ਟਰਮੀਨਲ ਤੋਂ ਵੱਖ"
 
-#: ../src/pk-main.c:191
+#. TRANSLATORS: if we should not monitor how long we are inactive for
+#: ../src/pk-main.c:202
 msgid "Disable the idle timer"
 msgstr "ਵੇਹਲਾ ਟਾਈਮਰ ਆਯੋਗ"
 
-#: ../src/pk-main.c:193
+#. TRANSLATORS: show version
+#: ../src/pk-main.c:205
 msgid "Show version and exit"
 msgstr "ਵਰਜਨ ਵੇਖਾ ਕੇ ਬੰਦ ਕਰੋ"
 
-#: ../src/pk-main.c:195
+#. TRANSLATORS: exit after we've started up, used for user profiling
+#: ../src/pk-main.c:208
 msgid "Exit after a small delay"
 msgstr "ਥੋੜ੍ਹੀ ਦੇਰ ਬਾਅਦ ਬੰਦ ਕਰੋ"
 
-#: ../src/pk-main.c:197
+#. TRANSLATORS: exit straight away, used for automatic profiling
+#: ../src/pk-main.c:211
 msgid "Exit after the engine has loaded"
 msgstr "ਇੰਜਣ ਲੋਡ ਕਰਨ ਦੇ ਬਾਅਦ ਬੰਦ ਕਰੋ"
 
-#: ../src/pk-main.c:207
+#. TRANSLATORS: describing the service that is running
+#: ../src/pk-main.c:226
 msgid "PackageKit service"
 msgstr "ਪੈਕੇਜਕਿੱਟ ਸਰਵਿਸ"
 
-#: ../src/pk-main.c:233
+#. TRANSLATORS: fatal error, dbus is not running
+#: ../src/pk-main.c:263
 msgid "Cannot connect to the system bus"
 msgstr "ਸਿਸਟਮ ਬੱਸ ਨਾਲ ਕੁਨੈਕਟ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਦਾ"
 
-#: ../src/pk-main.c:273
+#. TRANSLATORS: cannot register on system bus, unknown reason
+#: ../src/pk-main.c:313
 #, c-format
 msgid "Error trying to start: %s\n"
 msgstr "ਸ਼ੁਰੂ ਕਰਨ ਲਈ ਗਲਤੀ: %s\n"
commit 19e66ae853be8feb9132d55a066bcd5c7dd17bd8
Merge: d0c810c... 562ff7a...
Author: Andres Vargas ( zodman ) <zodman at foresightlinux.org>
Date:   Tue Mar 3 14:47:34 2009 -0600

    Merge branch 'master' of git+ssh://zodman@git.packagekit.org/srv/git/PackageKit

commit d0c810cec386e2ad1b4f726123005146a16dee9f
Author: Andres Vargas ( zodman ) <zodman at foresightlinux.org>
Date:   Mon Mar 2 23:48:26 2009 -0600

    conary trivial: remove chars what break the backend

diff --git a/backends/conary/XMLCache.py b/backends/conary/XMLCache.py
index a2acf98..db85f6f 100644
--- a/backends/conary/XMLCache.py
+++ b/backends/conary/XMLCache.py
@@ -86,9 +86,9 @@ class XMLRepo:
         cat = []
         for node in package_node.childNodes:
             if pkg.has_key('category'):
-                cat.append(str(node.childNodes[0].nodeValue))
+                cat.append(str(node.childNodes[0].nodeValue).replace(";","").replace("#",""))
             else:
-                pkg[node.nodeName.encode("UTF-8")] = str(node.childNodes[0].nodeValue.encode("UTF-8"))
+                pkg[node.nodeName.encode("UTF-8")] = str(node.childNodes[0].nodeValue.encode("UTF-8")).replace(";",' ').replace("#","")
         pkg["category"] = cat
         return pkg
 
diff --git a/backends/conary/conaryBackend.py b/backends/conary/conaryBackend.py
index f153a15..d4fae39 100755
--- a/backends/conary/conaryBackend.py
+++ b/backends/conary/conaryBackend.py
@@ -338,6 +338,7 @@ class PackageKitConaryBackend(PackageKitBaseBackend):
             summary = package_id.split(";")
             data = summary[3].split("#")
             if data[1]:
+                log.info(summary[3].split("#")[1])
                 metadata = eval(summary[3].split("#")[1])
             else:
                 metadata = {}
commit 89c31250d825ada1fe97db97f0e6f31f81149e24
Author: Andres Vargas ( zodman ) <zodman at foresightlinux.org>
Date:   Mon Mar 2 16:32:48 2009 -0600

    conary:
        trivial: fix the unicode decode

diff --git a/backends/conary/XMLCache.py b/backends/conary/XMLCache.py
index 26992eb..a2acf98 100644
--- a/backends/conary/XMLCache.py
+++ b/backends/conary/XMLCache.py
@@ -88,7 +88,7 @@ class XMLRepo:
             if pkg.has_key('category'):
                 cat.append(str(node.childNodes[0].nodeValue))
             else:
-                pkg[str(node.nodeName)] = str(node.childNodes[0].nodeValue)
+                pkg[node.nodeName.encode("UTF-8")] = str(node.childNodes[0].nodeValue.encode("UTF-8"))
         pkg["category"] = cat
         return pkg
 
commit d85eed916d30d80215c6fd875b86713218d06ede
Merge: ce123de... b88a0d0...
Author: Andres Vargas ( zodman ) <zodman at foresightlinux.org>
Date:   Fri Feb 27 01:25:40 2009 -0600

    Merge branch 'master' of git+ssh://zodman@git.packagekit.org/srv/git/PackageKit

commit ce123deb55df4c29517cc45ef5f326fb569d1acc
Author: Andres Vargas ( zodman ) <zodman at foresightlinux.org>
Date:   Wed Feb 25 22:21:50 2009 -0600

    conary:
    trivial: fix some typos for search methods

diff --git a/backends/conary/XMLCache.py b/backends/conary/XMLCache.py
index d517ab5..26992eb 100644
--- a/backends/conary/XMLCache.py
+++ b/backends/conary/XMLCache.py
@@ -1,5 +1,6 @@
 import os
-from xml.dom.minidom import parse
+from xml.dom.minidom import parse, parseString
+from xml.parsers.expat import ExpatError
 import urllib as url
 
 
@@ -7,7 +8,7 @@ from conary.lib import sha1helper
 from conary.lib import util
 
 from packagekit.backend import PackageKitBaseBackend
-from packagekit.enums import ERROR_NO_CACHE
+from packagekit.enums import ERROR_NO_CACHE,ERROR_REPO_CONFIGURATION_ERROR
 
 
 from pkConaryLog import log
@@ -71,8 +72,13 @@ class XMLRepo:
         try:
             return self._repo
         except AttributeError:
-            self._repo =   parse( open( self.xml_path + self.repo) )
-            return self._repo
+            try:
+                self._repo =   parse(open( self.xml_path + self.repo))
+                return self._repo
+            except ExpatError:
+                Pk = PackageKitBaseBackend("")
+                Pk.error(ERROR_REPO_CONFIGURATION_ERROR," The file %s not parsed submit a issue " % ( self.xml_path + self.repo, ) )
+       
 
     def _generatePackage(self, package_node ): 
         """ convert from package_node to dictionary """
@@ -104,7 +110,7 @@ class XMLRepo:
             for package in packages.childNodes:
                 pkg = self._generatePackage(package)
                 pkg["label"] = self.label
-                if name.lower() in pkg["name"]:
+                if name.lower() in pkg["name"].lower():
                     results.append(pkg['name'])
         return  [ self._getPackage(i) for i in set(results) ]
 
@@ -145,8 +151,15 @@ class XMLRepo:
                         for j in pkg[i]:
                             if name.lower() in j.lower():
                                 results.append(pkg['name'])
-                    if name.lower() in pkg[i]:
+                    
+                    if type(pkg[i]) == str:
+                        check = pkg[i].lower()
+                    else:
+                        check = pkg[i]
+                    if name.lower() in check:
                         results.append(pkg['name'])
+            
+
         return  [ self._getPackage(i) for i in set(results) ]
     def _getAllPackages(self):
         doc = self._open()
@@ -291,10 +304,11 @@ class XMLCache:
 
 if __name__ == '__main__':
   #  print ">>> name"
-   # print XMLCache().search('music', 'name' )
+    import sys
+    l= XMLCache().search(sys.argv[1],sys.argv[2] )
    # print ">> details"
    # l= XMLCache().search('Internet', 'group' )
 
-    #for v,p in enumerate(l):
-    #    print v,p["name"]
-    print  XMLCache().getGroup(['GTK', 'Graphics', 'Photography', 'Viewer'])
+    for v,p in enumerate(l):
+        print v,p["name"]
+    #print  XMLCache().getGroup(['GTK', 'Graphics', 'Photography', 'Viewer'])
diff --git a/backends/conary/conaryBackend.py b/backends/conary/conaryBackend.py
index 537fd61..f153a15 100755
--- a/backends/conary/conaryBackend.py
+++ b/backends/conary/conaryBackend.py
@@ -22,18 +22,19 @@
 import sys
 import os
 import re
-
 from conary import errors
 from conary.deps import deps
 from conary import dbstore, queryrep, versions, updatecmd
 from conary.local import database
 from conary import trove
 from conary.conaryclient import cmdline
+from conary.lib import util
 
 from packagekit.backend import *
 from packagekit.package import *
 from packagekit.progress import PackagekitProgress
-from conaryCallback import UpdateCallback, GetUpdateCallback, RemoveCallback, UpdateSystemCallback
+from conaryCallback import UpdateCallback, GetUpdateCallback
+from conaryCallback import RemoveCallback, UpdateSystemCallback
 from conaryFilter import *
 from XMLCache import XMLCache as Cache
 from conaryInit import *
@@ -41,14 +42,11 @@ from conaryInit import *
 from conaryInit import init_conary_config, init_conary_client
 from conary import conarycfg, conaryclient
 from conarypk import ConaryPk
-
-pkpackage = PackagekitPackage()
-
 from pkConaryLog import *
 
-
-from conary.lib import util
+pkpackage = PackagekitPackage()
 sys.excepthook = util.genExcepthook()
+
 def ExceptionHandler(func):
     return func
     def display(error):
@@ -126,9 +124,8 @@ class PackageKitConaryBackend(PackageKitBaseBackend):
             installed = INFO_INSTALLED
         else:
             installed = INFO_AVAILABLE
-
         return installed
-           
+
     @ExceptionHandler
     def get_package_id(self, name, versionObj, flavor):
 
@@ -231,6 +228,8 @@ class PackageKitConaryBackend(PackageKitBaseBackend):
             restartDir = self.client.applyUpdateJob(updJob)
         except errors.InternalConaryError:
             self.error(ERROR_NO_PACKAGES_TO_UPDATE,"get-updates first and then update sytem")
+        except trove.TroveIntegrityError: 
+            self.error(ERROR_NO_PACKAGES_TO_UPDATE,"run get-updates again")
         return updJob
 
     def _get_package_update(self, name, version, flavor):
@@ -478,9 +477,8 @@ class PackageKitConaryBackend(PackageKitBaseBackend):
         for package in package_ids.split(" "):
             name, version, flavor, installed = self._findPackage(package)
             if name:
-               # self._do_package_update(name, version, flavor)
-               cli = ConaryPk()
-               cli.update(name)
+                cli = ConaryPk()
+                cli.update(name)
             else:
                 self.error(ERROR_PACKAGE_ALREADY_INSTALLED, 'No available updates')
 


More information about the PackageKit-commit mailing list