diff options
-rw-r--r-- | client/pk-console.c | 61 | ||||
-rw-r--r-- | client/pk-import-desktop.c | 4 | ||||
-rw-r--r-- | client/pk-import-specspo.c | 4 | ||||
-rw-r--r-- | policy/org.freedesktop.packagekit.policy.in | 26 | ||||
-rw-r--r-- | src/pk-main.c | 27 |
5 files changed, 65 insertions, 57 deletions
diff --git a/client/pk-console.c b/client/pk-console.c index df9471533..d7907e0fc 100644 --- a/client/pk-console.c +++ b/client/pk-console.c @@ -110,7 +110,7 @@ pk_console_package_cb (PkClient *client, PkInfoEnum info, const gchar *package_i /* split */ ident = pk_package_id_new_from_string (package_id); if (ident == NULL) { - pk_warning (_("Could not get valid ident from %s"), package_id); + pk_warning ("Could not get valid ident from %s", package_id); return; } @@ -205,7 +205,7 @@ pk_console_update_detail_cb (PkClient *client, const gchar *package_id, if (awaiting_space) { g_print ("\n"); } - g_print (_("Update detail\n")); + g_print ("%s\n", _("Update detail")); g_print (" package: '%s'\n", package_id); if (pk_strzero (updates) == FALSE) { g_print (" updates: '%s'\n", updates); @@ -396,8 +396,12 @@ pk_console_finished_cb (PkClient *client, PkExitEnum exit, guint runtime, gpoint /* is there any restart to notify the user? */ restart = pk_client_get_require_restart (client); - if (restart != PK_RESTART_ENUM_NONE) { - g_print (_("Requires restart: %s\n"), pk_restart_enum_to_text (restart)); + if (restart == PK_RESTART_ENUM_SYSTEM) { + g_print ("%s\n", _("A system restart is required")); + } else if (restart == PK_RESTART_ENUM_SESSION) { + g_print ("%s\n", _("A logout and login is required")); + } else if (restart == PK_RESTART_ENUM_APPLICATION) { + g_print ("%s\n", _("An application restart is required")); } /* have we failed to install, and the gpg key is now installed */ @@ -462,7 +466,7 @@ pk_console_perhaps_resolve (PkClient *client, PkFilterEnum filter, const gchar * /* we need to resolve it */ ret = pk_client_resolve (client_task, filter, package, error); if (ret == FALSE) { - pk_warning (_("Resolve is not supported in this backend")); + pk_warning ("Resolve is not supported in this backend"); return NULL; } @@ -478,7 +482,7 @@ pk_console_perhaps_resolve (PkClient *client, PkFilterEnum filter, const gchar * } ret = pk_client_what_provides (client_task, filter, PK_PROVIDES_ENUM_ANY, package, error); if (ret == FALSE) { - pk_warning (_("WhatProvides is not supported in this backend")); + pk_warning ("WhatProvides is not supported in this backend"); return NULL; } } @@ -500,7 +504,7 @@ pk_console_perhaps_resolve (PkClient *client, PkFilterEnum filter, const gchar * if (awaiting_space) { g_print ("\n"); } - g_print (_("There are multiple matches\n")); + g_print ("%s\n", _("There are multiple package matches")); for (i=0; i<length; i++) { item = pk_client_package_buffer_get_item (client_task, i); g_print ("%i. %s\n", i+1, item->package_id); @@ -523,7 +527,7 @@ pk_console_install_package (PkClient *client, const gchar *package, GError **err gchar *package_id; package_id = pk_console_perhaps_resolve (client, PK_FILTER_ENUM_NOT_INSTALLED, package, error); if (package_id == NULL) { - g_print (_("Could not find a package with that name to install, or package already installed\n")); + g_print ("%s\n", _("Could not find a package with that name to install, or package already installed")); return FALSE; } ret = pk_client_install_package (client, package_id, error); @@ -605,7 +609,7 @@ pk_console_remove_package (PkClient *client, const gchar *package, GError **erro package_id = pk_console_perhaps_resolve (client, PK_FILTER_ENUM_INSTALLED, package, error); if (package_id == NULL) { - g_print (_("Could not find a package with that name to remove\n")); + g_print ("%s\n", _("Could not find a package with that name to remove")); return FALSE; } @@ -624,7 +628,7 @@ pk_console_remove_package (PkClient *client, const gchar *package, GError **erro return FALSE; } - pk_debug (_("Getting installed requires for %s"), package_id); + pk_debug ("Getting installed requires for %s", package_id); ret = pk_client_get_requires (client_task, PK_FILTER_ENUM_INSTALLED, package_id, TRUE, error); if (!ret) { return FALSE; @@ -645,7 +649,7 @@ pk_console_remove_package (PkClient *client, const gchar *package, GError **erro if (awaiting_space) { g_print ("\n"); } - g_print (_("The following packages have to be removed:\n")); + g_print ("%s:\n", _("The following packages have to be removed")); for (i=0; i<length; i++) { item = pk_client_package_buffer_get_item (client_task, i); ident = pk_package_id_new_from_string (item->package_id); @@ -658,7 +662,7 @@ pk_console_remove_package (PkClient *client, const gchar *package, GError **erro /* we chickened out */ if (remove == FALSE) { - g_print ("Cancelled!\n"); + g_print ("%s\n", _("Cancelled!")); g_free (package_id); return FALSE; } @@ -680,7 +684,7 @@ pk_console_update_package (PkClient *client, const gchar *package, GError **erro gchar *package_id; package_id = pk_console_perhaps_resolve (client, PK_FILTER_ENUM_INSTALLED, package, error); if (package_id == NULL) { - g_print (_("Could not find a package with that name to update\n")); + g_print ("%s\n", _("Could not find a package with that name to update")); return FALSE; } ret = pk_client_update_package (client, package_id, error); @@ -698,7 +702,7 @@ pk_console_get_requires (PkClient *client, const gchar *package, GError **error) gchar *package_id; package_id = pk_console_perhaps_resolve (client, PK_FILTER_ENUM_NONE, package, error); if (package_id == NULL) { - g_print (_("Could not find a package with that name to get requires\n")); + g_print ("%s\n", _("Could not find what packages require this package")); return FALSE; } ret = pk_client_get_requires (client, PK_FILTER_ENUM_NONE, package_id, TRUE, error); @@ -716,7 +720,7 @@ pk_console_get_depends (PkClient *client, const gchar *package, GError **error) gchar *package_id; package_id = pk_console_perhaps_resolve (client, PK_FILTER_ENUM_NONE, package, error); if (package_id == NULL) { - g_print (_("Could not find a package with that name to get depends\n")); + g_print ("%s\n", _("Could not get dependencies for this package")); return FALSE; } ret = pk_client_get_depends (client, PK_FILTER_ENUM_NONE, package_id, FALSE, error); @@ -734,7 +738,7 @@ pk_console_get_description (PkClient *client, const gchar *package, GError **err gchar *package_id; package_id = pk_console_perhaps_resolve (client, PK_FILTER_ENUM_NONE, package, error); if (package_id == NULL) { - g_print (_("Could not find a package with that name to get description\n")); + g_print ("%s\n", _("Could not find a description for this package")); return FALSE; } ret = pk_client_get_description (client, package_id, error); @@ -752,7 +756,7 @@ pk_console_get_files (PkClient *client, const gchar *package, GError **error) gchar *package_id; package_id = pk_console_perhaps_resolve (client, PK_FILTER_ENUM_NONE, package, error); if (package_id == NULL) { - g_print (_("Could not find a package with that name to get files\n")); + g_print (_("Could not find the files for this package")); return FALSE; } ret = pk_client_get_files (client, package_id, error); @@ -770,7 +774,7 @@ pk_console_get_update_detail (PkClient *client, const gchar *package, GError **e gchar *package_id; package_id = pk_console_perhaps_resolve (client, PK_FILTER_ENUM_INSTALLED, package, error); if (package_id == NULL) { - g_print ("Could not find a package with that name to get update details\n"); + g_print ("%s\n", "Could not find the update details for this package"); return FALSE; } ret = pk_client_get_update_detail (client, package_id, error); @@ -812,7 +816,7 @@ pk_console_description_cb (PkClient *client, const gchar *package_id, if (awaiting_space) { g_print ("\n"); } - g_print (_("Package description\n")); + g_print ("%s\n", _("Package description")); g_print (" package: '%s'\n", package_id); g_print (" license: '%s'\n", license); g_print (" group: '%s'\n", pk_group_enum_to_text (group)); @@ -833,9 +837,9 @@ pk_console_files_cb (PkClient *client, const gchar *package_id, if (awaiting_space) { g_print ("\n"); } - g_print ("Package files\n"); if (*filevector != NULL) { + g_print ("%s\n", _("Package files")); gchar **current_file = filevector; while (*current_file != NULL) { @@ -843,7 +847,7 @@ pk_console_files_cb (PkClient *client, const gchar *package_id, current_file++; } } else { - g_print (" no files\n"); + g_print ("%s\n", _("No files")); } g_strfreev (filevector); @@ -865,7 +869,7 @@ pk_console_repo_signature_required_cb (PkClient *client, const gchar *package_id if (awaiting_space) { g_print ("\n"); } - g_print ("Repository Signature Required\n"); + g_print ("%s\n", "Repository signature required"); g_print ("Package: %s\n", package_id); g_print ("Name: %s\n", repository_name); g_print ("URL: %s\n", key_url); @@ -878,7 +882,7 @@ pk_console_repo_signature_required_cb (PkClient *client, const gchar *package_id import = pk_console_get_prompt (_("Okay to import key?"), FALSE); if (!import) { need_requeue = FALSE; - g_print ("%s\n", _("Did not import key, task will fail")); + g_print ("%s\n", _("Did not import key")); return; } @@ -911,7 +915,7 @@ pk_console_eula_required_cb (PkClient *client, const gchar *eula_id, const gchar if (awaiting_space) { g_print ("\n"); } - g_print ("Eula Required\n"); + g_print ("%s\n", "Eula required"); g_print ("Eula: %s\n", eula_id); g_print ("Package: %s\n", package_id); g_print ("Vendor: %s\n", vendor_name); @@ -950,7 +954,7 @@ pk_connection_changed_cb (PkConnection *pconnection, gboolean connected, gpointe g_print ("\n"); } if (connected == FALSE) { - g_print (_("The daemon crashed mid transaction. This is bad\n")); + g_print ("%s\n", _("The daemon crashed mid-transaction!")); exit (2); } } @@ -1434,7 +1438,8 @@ main (int argc, char *argv[]) ret = pk_client_refresh_cache (client, FALSE, &error); } else { - g_print (_("Option '%s' not supported\n"), mode); + g_print (_("Option '%s' not supported"), mode); + g_print ("\n"); } /* do we wait for the method? */ @@ -1444,11 +1449,11 @@ main (int argc, char *argv[]) out: if (ret == FALSE) { - g_print (_("Command failed\n")); + g_print ("%s\n", _("Command failed")); } if (error != NULL) { if (g_str_has_prefix (error->message, "org.freedesktop.packagekit.")) { - g_print (_("You don't have the necessary privileges for this operation\n")); + g_print ("%s\n", _("You don't have the necessary privileges for this operation")); } else { g_print ("Error:\n %s\n\n", error->message); g_error_free (error); diff --git a/client/pk-import-desktop.c b/client/pk-import-desktop.c index f2a01f12d..3edebbf13 100644 --- a/client/pk-import-desktop.c +++ b/client/pk-import-desktop.c @@ -280,8 +280,8 @@ main (int argc, char *argv[]) extra = pk_extra_new (); ret = pk_extra_set_database (extra, database_location); if (!ret) { - g_print (_("Could not open database: %s\n"), database_location); - g_print (_("You probably need to run this program as the root user\n")); + g_print (_("Could not open database: %s"), database_location); + g_print ("\n%s\n", _("You probably need to run this program as the root user")); goto out; } diff --git a/client/pk-import-specspo.c b/client/pk-import-specspo.c index 346032807..bd37480e0 100644 --- a/client/pk-import-specspo.c +++ b/client/pk-import-specspo.c @@ -166,8 +166,8 @@ main (int argc, char *argv[]) extra = pk_extra_new (); ret = pk_extra_set_database (extra, database_location); if (!ret) { - g_print (_("Could not open database: %s\n"), database_location); - g_print (_("You probably need to run this program as the root user\n")); + g_print (_("Could not open database: %s"), database_location); + g_print ("\n%s\n", _("You probably need to run this program as the root user")); goto out; } diff --git a/policy/org.freedesktop.packagekit.policy.in b/policy/org.freedesktop.packagekit.policy.in index 701a866ce..6b9b43e54 100644 --- a/policy/org.freedesktop.packagekit.policy.in +++ b/policy/org.freedesktop.packagekit.policy.in @@ -15,7 +15,7 @@ <action id="org.freedesktop.packagekit.install"> <_description>Install package</_description> - <_message>System policy prevents installing package</_message> + <_message>Authentication is required to install a package</_message> <icon_name>pk-package-add</icon_name> <vendor_url>http://www.packagekit.org/pk-reference.html#methods-install-package</vendor_url> <defaults> @@ -26,7 +26,7 @@ <action id="org.freedesktop.packagekit.localinstall"> <_description>Install local file</_description> - <_message>System policy prevents installing file</_message> + <_message>Authentication is required to install a local file</_message> <icon_name>pk-package-add</icon_name> <vendor_url>http://www.packagekit.org/pk-reference.html#methods-install-file</vendor_url> <defaults> @@ -37,7 +37,7 @@ <action id="org.freedesktop.packagekit.install-signature"> <_description>Install security signature</_description> - <_message>System policy prevents installing security signature</_message> + <_message>Authentication is required to install a security signature</_message> <icon_name>pk-package-add</icon_name> <vendor_url>http://www.packagekit.org/pk-reference.html#methods-install-signature</vendor_url> <defaults> @@ -48,7 +48,7 @@ <action id="org.freedesktop.packagekit.accept-eula"> <_description>Accept EULA</_description> - <_message>System policy prevents accepting EULA</_message> + <_message>Authentication is required to accept a EULA</_message> <icon_name>pk-package-add</icon_name> <vendor_url>http://www.packagekit.org/pk-reference.html#methods-accept-eula</vendor_url> <defaults> @@ -59,7 +59,7 @@ <action id="org.freedesktop.packagekit.update-package"> <_description>Update package</_description> - <_message>System policy prevents updating package</_message> + <_message>Authentication is required to update packages</_message> <icon_name>pk-package-update</icon_name> <vendor_url>http://www.packagekit.org/pk-reference.html#methods-update</vendor_url> <defaults> @@ -70,7 +70,7 @@ <action id="org.freedesktop.packagekit.remove"> <_description>Remove package</_description> - <_message>System policy prevents removing package</_message> + <_message>Authentication is required to remove packages</_message> <icon_name>pk-package-delete</icon_name> <vendor_url>http://www.packagekit.org/pk-reference.html#methods-remove</vendor_url> <defaults> @@ -80,8 +80,8 @@ </action> <action id="org.freedesktop.packagekit.update-system"> - <_description>Update all packages on system</_description> - <_message>System policy prevents updating system</_message> + <_description>Update all packages</_description> + <_message>Authentication is required to update all packages</_message> <icon_name>pk-package-update</icon_name> <vendor_url>http://www.packagekit.org/pk-reference.html#methods-update-system</vendor_url> <defaults> @@ -92,7 +92,7 @@ <action id="org.freedesktop.packagekit.rollback"> <_description>Rollback to a previous transaction</_description> - <_message>System policy prevents rollback</_message> + <_message>Authentication is required to rollback a transaction</_message> <icon_name>pk-rollback</icon_name> <vendor_url>http://www.packagekit.org/pk-reference.html#methods-rollback</vendor_url> <defaults> @@ -102,8 +102,8 @@ </action> <action id="org.freedesktop.packagekit.repo-change"> - <_description>Change repository parameters</_description> - <_message>System policy prevents changing repository parameters</_message> + <_description>Change software source parameters</_description> + <_message>Authentication is required to change software source parameters</_message> <icon_name>pk-package-info</icon_name> <vendor_url>http://www.packagekit.org/pk-reference.html#methods-repo-enable</vendor_url> <defaults> @@ -113,8 +113,8 @@ </action> <action id="org.freedesktop.packagekit.refresh-cache"> - <_description>Refresh package cache</_description> - <_message>System policy prevents refresh package cache</_message> + <_description>Refresh package lists</_description> + <_message>Authentication is required to refresh the package lists</_message> <icon_name>pk-refresh-cache</icon_name> <vendor_url>http://www.packagekit.org/pk-reference.html#methods-refresh-cache</vendor_url> <defaults> diff --git a/src/pk-main.c b/src/pk-main.c index a7d398e98..aa4e5c83c 100644 --- a/src/pk-main.c +++ b/src/pk-main.c @@ -58,6 +58,7 @@ pk_object_register (DBusGConnection *connection, GObject *object, GError **error DBusGProxy *bus_proxy = NULL; guint request_name_result; gboolean ret; + gchar *message; bus_proxy = dbus_g_proxy_new_for_name (connection, DBUS_SERVICE_DBUS, @@ -78,12 +79,14 @@ pk_object_register (DBusGConnection *connection, GObject *object, GError **error if (!ret) { pk_warning ("RequestName failed!"); g_clear_error (error); - g_set_error (error, PK_ENGINE_ERROR, PK_ENGINE_ERROR_DENIED, - _("Acquiring D-Bus name %s failed due to security policies on this machine\n" - "This can happen for two reasons:\n" - "* The correct user is not launching the executable (usually root)\n" - "* The org.freedesktop.PackageKit.conf file is " - "not installed in the system /etc/dbus-1/system.d directory\n"), PK_DBUS_SERVICE); + message = g_strdup_printf ("%s\n%s\n* %s\n* %s\n", + _("Startup failed due to security policies on this machine."), + _("This can happen for two reasons:"), + _("The correct user is not launching the executable (usually root)"), + _("The org.freedesktop.PackageKit.conf file is not " + "installed in the system /etc/dbus-1/system.d directory")); + g_set_error (error, PK_ENGINE_ERROR, PK_ENGINE_ERROR_DENIED, message); + g_free (message); return FALSE; } @@ -179,19 +182,19 @@ main (int argc, char *argv[]) const GOptionEntry options[] = { { "backend", '\0', 0, G_OPTION_ARG_STRING, &backend_name, - _("Backend to use"), NULL }, + _("Packaging backend to use, e.g. dummy"), NULL }, { "daemonize", '\0', 0, G_OPTION_ARG_NONE, &use_daemon, - _("Daemonize and detach"), NULL }, + _("Daemonize and detach from the terminal"), NULL }, { "verbose", '\0', 0, G_OPTION_ARG_NONE, &verbose, _("Show extra debugging information"), NULL }, { "disable-timer", '\0', 0, G_OPTION_ARG_NONE, &disable_timer, _("Disable the idle timer"), NULL }, { "version", '\0', 0, G_OPTION_ARG_NONE, &version, - _("Show version of installed program and exit"), NULL }, + _("Show version and exit"), NULL }, { "timed-exit", '\0', 0, G_OPTION_ARG_NONE, &timed_exit, _("Exit after a small delay"), NULL }, { "immediate-exit", '\0', 0, G_OPTION_ARG_NONE, &immediate_exit, - _("Exit after a the engine has loaded"), NULL }, + _("Exit after the engine has loaded"), NULL }, { NULL} }; @@ -201,7 +204,7 @@ main (int argc, char *argv[]) dbus_g_thread_init (); g_type_init (); - context = g_option_context_new (_("PackageKit daemon")); + context = g_option_context_new (_("PackageKit service")); g_option_context_add_main_entries (context, options, NULL); g_option_context_parse (context, &argc, &argv, NULL); g_option_context_free (context); @@ -227,7 +230,7 @@ main (int argc, char *argv[]) /* check dbus connections, exit if not valid */ system_connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error); if (error) { - g_print ("Cannot connect to the system bus: %s\n", error->message); + g_print ("%s: %s\n", _("Cannot connect to the system bus"), error->message); g_error_free (error); goto exit_program; } |