=== modified file 'click/commands/install.py' --- click/commands/install.py 2014-08-07 21:25:48 +0000 +++ click/commands/install.py 2014-08-25 19:02:21 +0000 @@ -23,7 +23,11 @@ from gi.repository import Click -from click.install import ClickInstaller, ClickInstallerError +from click.install import ( + ClickInstaller, + ClickInstallerAuditError, + ClickInstallerError, +) def run(argv): @@ -60,6 +64,9 @@ try: installer.install( package_path, user=options.user, all_users=options.all_users) + except ClickInstallerAuditError as e: + print("Audit failed for %s: %s" % (package_path, e), file=sys.stderr) + return 2 except ClickInstallerError as e: print("Cannot install %s: %s" % (package_path, e), file=sys.stderr) return 1 === modified file 'pk-plugin/pk-plugin-click.c' --- pk-plugin/pk-plugin-click.c 2014-08-19 07:06:25 +0000 +++ pk-plugin/pk-plugin-click.c 2014-08-25 20:28:29 +0000 @@ -515,10 +515,14 @@ JsonObject *manifest; gchar *pkid = NULL; - argv = g_malloc0_n (6, sizeof (*argv)); + argv = g_malloc0_n (7, sizeof (*argv)); i = 0; argv[i++] = g_strdup ("click"); argv[i++] = g_strdup ("install"); + if (!pk_bitfield_contain (pk_transaction_get_transaction_flags (transaction), + PK_TRANSACTION_FLAG_ENUM_ONLY_TRUSTED)) { + argv[i++] = g_strdup ("--allow-unauthenticated"); + } username = click_get_username_for_uid (pk_transaction_get_uid (transaction)); if (username) @@ -535,9 +539,13 @@ if (!g_spawn_check_exit_status (click_status, NULL)) { gchar *summary = g_strdup_printf ("%s failed to install.", filename); - click_pk_error (plugin, - PK_ERROR_ENUM_PACKAGE_FAILED_TO_INSTALL, - summary, click_stderr); + if(WEXITSTATUS(click_status) == 2) + pk_backend_job_error_code + (plugin->job, PK_ERROR_ENUM_MISSING_GPG_SIGNATURE, "reauth"); + else + click_pk_error (plugin, + PK_ERROR_ENUM_PACKAGE_FAILED_TO_INSTALL, + summary, click_stderr); g_free (summary); ret = FALSE; goto out;