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

Richard Hughes hughsient at kemper.freedesktop.org
Wed Apr 23 13:18:29 PDT 2008


 backends/alpm/pk-backend-alpm.c    |   34 ++++
 backends/yum/helpers/yumBackend.py |   15 +-
 docs/spec/pk-concepts.xml          |   14 +
 libpackagekit/pk-enum.c            |    2 
 libpackagekit/pk-enum.h            |    2 
 po/de.po                           |  269 ++++++++++++++-----------------------
 6 files changed, 169 insertions(+), 167 deletions(-)

New commits:
commit 3ec775d4b319fd22c6ba26f026512bf96b43ed64
Merge: d3be731... 0f9128b...
Author: Valeriy Lyasotskiy <onestep at ukr.net>
Date:   Wed Apr 23 21:07:56 2008 +0300

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

commit d3be7315c843e0a0443caeb80f566178a407c70f
Author: Valeriy Lyasotskiy <onestep at ukr.net>
Date:   Wed Apr 23 21:07:23 2008 +0300

    implemented backend_search_name

diff --git a/backends/alpm/pk-backend-alpm.c b/backends/alpm/pk-backend-alpm.c
index c4f9f27..cc54ad7 100644
--- a/backends/alpm/pk-backend-alpm.c
+++ b/backends/alpm/pk-backend-alpm.c
@@ -872,6 +872,7 @@ backend_search_name (PkBackend *backend, PkFilterEnum filters, const gchar *sear
     g_return_if_fail (backend != NULL);
 
     alpm_list_t *repos = NULL;
+    alpm_list_t *result = NULL;
 
     pk_backend_set_status (backend, PK_STATUS_ENUM_QUERY);
 
@@ -883,6 +884,37 @@ backend_search_name (PkBackend *backend, PkFilterEnum filters, const gchar *sear
     if (!installed)
 	repos = alpm_list_join (repos, alpm_list_copy(alpm_option_get_syncdbs ()));
 
+    alpm_list_t *iterator;
+    for (iterator = repos; iterator; iterator = alpm_list_next (iterator)) {
+	pmdb_t *db = alpm_list_getdata (iterator);
+	alpm_list_t *cache = alpm_db_getpkgcache (db);
+
+	// determine if repository is local
+	gboolean db_is_local = (db == alpm_option_get_localdb ());
+	// determine repository name
+	const gchar *repo = alpm_db_get_name (db);
+
+	alpm_list_t *pkg_iterator;
+	for (pkg_iterator = cache; pkg_iterator; pkg_iterator = alpm_list_next (pkg_iterator)) {
+	    pmpkg_t *pkg = alpm_list_getdata(pkg_iterator);
+
+	    if (strstr (alpm_pkg_get_name (pkg), search)) {
+		PackageSource *source = g_malloc (sizeof (PackageSource));
+
+		source->pkg = (pmpkg_t *) pkg;
+		source->repo = (gchar *) repo;
+		source->installed = db_is_local;
+
+		result = alpm_list_add (result, (PackageSource *) source);
+	    }
+	}
+    }
+
+    add_packages_from_list (backend, alpm_list_first (result));
+
+    alpm_list_free_inner (result, (alpm_list_fn_free) package_source_free);
+    alpm_list_free (result);
+
     alpm_list_free (repos);
     pk_backend_finished (backend);
 }
@@ -896,7 +928,7 @@ backend_get_groups (PkBackend *backend)
     g_return_val_if_fail (backend != NULL, PK_GROUP_ENUM_UNKNOWN);
 
     // TODO: Provide support for groups in alpm
-    return PK_GROUP_ENUM_UNKNOWN;
+    return PK_GROUP_ENUM_OTHER | PK_GROUP_ENUM_UNKNOWN;
 }
 
 /**
commit 0f9128b562602e91a6e70c0d9c7a797266031650
Author: Fabian Affolter <fabian at bernewireless.net>
Date:   Wed Apr 23 17:34:39 2008 +0000

    2008-04-23  Fabian Affolter <fabian at bernewireless.net> (via
    fab at fedoraproject.org)
    
      * po/de.po: Fix some spelling mistake in German translation

diff --git a/po/de.po b/po/de.po
index 8a39ef8..33d30c1 100644
--- a/po/de.po
+++ b/po/de.po
@@ -1,105 +1,22 @@
-# SOME DESCRIPTIVE TITLE.
+# PackageKit
 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
 # This file is distributed under the same license as the PackageKit package.
 # Stephan Sachse <white at dev-zero.com>, 2008.
+# Fabian Affolter <fab at fedoraproject.org>, 2008.
 #
 msgid ""
 msgstr ""
 "Project-Id-Version: PackageKit\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-04-19 12:51+0200\n"
-"PO-Revision-Date: 2008-04-19 12:44+0200\n"
-"Last-Translator: Stephan Sachse <white at dev-zero.com>\n"
-"Language-Team: LANGUAGE <LL at li.org>\n"
+"POT-Creation-Date: 2008-04-23 01:36+0000\n"
+"PO-Revision-Date: 2008-04-23 19:28+0100\n"
+"Last-Translator: Fabian Affolter <fab at fedoraproject.org>\n"
+"Language-Team: German <fedora-trans-de at redhat.com>\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:1
-msgid "Accept EULA"
-msgstr "EULA akzeptieren"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:2
-msgid "Authentication is required to accept a EULA"
-msgstr "eine Authentifikation ist erforderlich zum akzeptieren der EULA"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:3
-msgid "Authentication is required to change software source parameters"
-msgstr "eine Authentifikation ist erforderlich um Softwarequellen zu ändern"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:4
-msgid "Authentication is required to install a local file"
-msgstr ""
-"eine Authentifikation ist erforderlich um eine lokale Datei zu installieren"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:5
-msgid "Authentication is required to install a package"
-msgstr "eine Authentifikation ist erforderlich um ein Paket zu installieren"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:6
-msgid "Authentication is required to install a security signature"
-msgstr ""
-"eine Authentifikation ist erforderlich um eine digitale Unterschrift zu "
-"installieren"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:7
-msgid "Authentication is required to refresh the package lists"
-msgstr ""
-"eine Authentifikation ist erforderlich um die Paketliste zu aktualisieren"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:8
-msgid "Authentication is required to remove packages"
-msgstr "eine Authentifikation ist erforderlich um Pakete zu entfernen"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:9
-msgid "Authentication is required to rollback a transaction"
-msgstr ""
-"eine Authentifikation ist erforderlich um eine Transaktion rückgängig zu "
-"machen"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:10
-msgid "Authentication is required to update all packages"
-msgstr "eine Authentifikation ist erforderlich um alle Pakete zu aktualisieren"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:11
-msgid "Authentication is required to update packages"
-msgstr "eine Authentifikation ist erforderlich um Pakete zu aktualisieren"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:12
-msgid "Change software source parameters"
-msgstr "Softwarequellen ändern"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:13
-msgid "Install local file"
-msgstr "Lokale Datei installieren"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:14
-msgid "Install package"
-msgstr "Paket installieren"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:15
-msgid "Install security signature"
-msgstr "digitale Unterschrift installieren"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:16
-msgid "Refresh package lists"
-msgstr "Paketlisten aktualisieren"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:17
-msgid "Remove package"
-msgstr "Paket entfernen"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:18
-msgid "Rollback to a previous transaction"
-msgstr "Wiederherstellung zu einer vorherigen Transaktion"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:19
-msgid "Update all packages"
-msgstr "Alle Pakete aktualisieren"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:20
-msgid "Update package"
-msgstr "Paket aktualisieren"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Poedit-Language: German\n"
 
 #: ../client/pk-console.c:208
 msgid "Update detail"
@@ -136,17 +53,12 @@ msgid "Please enter the package number: "
 msgstr "Bitte die Paketnummer eingeben: "
 
 #: ../client/pk-console.c:530
-msgid ""
-"Could not find a package with that name to install, or package already "
-"installed"
-msgstr ""
-"Es konnten weder installierte noch zu installierende Paket mit diesem Namen "
-"gefunden werden"
+msgid "Could not find a package with that name to install, or package already installed"
+msgstr "Es konnten weder installierte noch zu installierende Paket mit diesem Namen gefunden werden"
 
 #: ../client/pk-console.c:612
 msgid "Could not find a package with that name to remove"
-msgstr ""
-"Es konnte kein Paket mit diesem Namen zum deinstallieren gefunden werden"
+msgstr "Es konnte kein Paket mit diesem Namen zum Deinstallieren gefunden werden"
 
 #: ../client/pk-console.c:652
 msgid "The following packages have to be removed"
@@ -155,7 +67,7 @@ msgstr "Die folgenden Paket werden entfernt"
 #. get user input
 #: ../client/pk-console.c:661
 msgid "Okay to remove additional packages?"
-msgstr "Die folgenden zusätzlichen Paket entfernen?"
+msgstr "Die folgenden zusätzlichen Pakete entfernen?"
 
 #: ../client/pk-console.c:665
 msgid "Cancelled!"
@@ -163,13 +75,11 @@ msgstr "Abgebrochen!"
 
 #: ../client/pk-console.c:687
 msgid "Could not find a package with that name to update"
-msgstr ""
-"Es konnte kein Paket mit diesem Namen zum aktualisieren gefunden werden"
+msgstr "Es konnte kein Paket mit diesem Namen zum Aktualisieren gefunden werden"
 
 #: ../client/pk-console.c:705
 msgid "Could not find what packages require this package"
-msgstr ""
-"Es konnte nicht rausgefunden werden welche Pakete dieses Paket benötigen"
+msgstr "Es konnte nicht rausgefunden werden, welche Pakete dieses Paket benötigen"
 
 #: ../client/pk-console.c:723
 msgid "Could not get dependencies for this package"
@@ -180,7 +90,6 @@ msgid "Could not find a description for this package"
 msgstr "Die Beschreibung für dieses Paket konnten nicht ermittelt werden"
 
 #: ../client/pk-console.c:759
-#, c-format
 msgid "Could not find the files for this package"
 msgstr "Die Dateien für dieses Paket konnten nicht ermittelt werden"
 
@@ -194,7 +103,7 @@ msgstr "Paketinhalt"
 
 #: ../client/pk-console.c:850
 msgid "No files"
-msgstr "keine Dateien"
+msgstr "Keine Dateien"
 
 #. get user input
 #: ../client/pk-console.c:882
@@ -208,7 +117,7 @@ msgstr "Den Schlüssel nicht importieren"
 #. get user input
 #: ../client/pk-console.c:925
 msgid "Do you agree?"
-msgstr "einverstanden?"
+msgstr "Sind Sie einverstanden?"
 
 #: ../client/pk-console.c:928
 msgid "Did not agree to licence, task will fail"
@@ -216,28 +125,31 @@ msgstr "Lizenz wurde abgelehnt, Aufgabe wird fehlschlagen"
 
 #: ../client/pk-console.c:957
 msgid "The daemon crashed mid-transaction!"
-msgstr "Der Dienst ist während der Trasaktion abgestürzt!"
+msgstr "Der Dienst ist während der Verarbeitung abgestürzt!"
 
 #. header
 #: ../client/pk-console.c:1010
 msgid "PackageKit Console Interface"
-msgstr "PackageKit Konsoleninterface"
+msgstr "PackageKit-Konsolenschnittstelle"
 
 #: ../client/pk-console.c:1010
 msgid "Subcommands:"
-msgstr "Unterkommandos:"
+msgstr "Unterbefehle:"
 
-#: ../client/pk-console.c:1114 ../client/pk-monitor.c:100 ../src/pk-main.c:189
+#: ../client/pk-console.c:1114
+#: ../client/pk-monitor.c:100
+#: ../src/pk-main.c:189
 msgid "Show extra debugging information"
-msgstr "Zusätzliche Ausagen anzeigen"
+msgstr "Zusätzliche Debugging-Informationen anzeigen"
 
-#: ../client/pk-console.c:1116 ../client/pk-monitor.c:102
+#: ../client/pk-console.c:1116
+#: ../client/pk-monitor.c:102
 msgid "Show the program version and exit"
 msgstr "Die Programmversion anzeigen und beenden"
 
 #: ../client/pk-console.c:1118
 msgid "Set the filter, e.g. installed"
-msgstr "Setzt den Filter, z.B: installiert"
+msgstr "Setzt den Filter, z. B. installiert"
 
 #: ../client/pk-console.c:1120
 msgid "Exit without waiting for actions to complete"
@@ -245,88 +157,75 @@ msgstr "Beenden ohne auf das Ende der Aktionen zu warten"
 
 #: ../client/pk-console.c:1143
 msgid "Could not connect to system DBUS."
-msgstr "System DBUS konnte nicht verbunden werden"
+msgstr "Mit System-DBUS konnte nicht verbunden werden."
 
 #: ../client/pk-console.c:1231
-#, c-format
 msgid "You need to specify a search type"
 msgstr "Es muss eine Suchart angegeben werden"
 
-#: ../client/pk-console.c:1236 ../client/pk-console.c:1243
-#: ../client/pk-console.c:1250 ../client/pk-console.c:1257
-#: ../client/pk-console.c:1361 ../client/pk-console.c:1368
-#: ../client/pk-console.c:1375 ../client/pk-console.c:1382
-#, c-format
+#: ../client/pk-console.c:1236
+#: ../client/pk-console.c:1243
+#: ../client/pk-console.c:1250
+#: ../client/pk-console.c:1257
+#: ../client/pk-console.c:1361
+#: ../client/pk-console.c:1368
+#: ../client/pk-console.c:1375
+#: ../client/pk-console.c:1382
 msgid "You need to specify a search term"
 msgstr "Es muss ein Suchausdruck angegeben werden"
 
 #: ../client/pk-console.c:1262
-#, c-format
 msgid "Invalid search type"
-msgstr "Falsche Suchart"
+msgstr "Ungültige Suchart"
 
 #: ../client/pk-console.c:1267
-#, c-format
 msgid "You need to specify a package or file to install"
-msgstr "Es muss ein Paket oder eine Datei zum installieren angegeben werden"
+msgstr "Es muss ein Paket oder eine Datei zum Installieren angegeben werden"
 
 #: ../client/pk-console.c:1280
-#, c-format
 msgid "You need to specify a type, key_id and package_id"
 msgstr "Es muss ein Typ angegeben werden, key_id oder package_id"
 
 #: ../client/pk-console.c:1287
-#, c-format
 msgid "You need to specify a package to remove"
-msgstr "Es muss ein Paket zum entfernen angegeben werden"
+msgstr "Es muss ein Paket zum Entfernen angegeben werden"
 
 #: ../client/pk-console.c:1294
-#, c-format
 msgid "You need to specify a eula-id"
 msgstr "Es muss eine eula-id angegeben werden"
 
 #: ../client/pk-console.c:1309
-#, c-format
 msgid "You need to specify a package name to resolve"
-msgstr "Es muss ein Paketname zum auflösen angegeben werden"
+msgstr "Es muss ein Paketname zum Auflösen angegeben werden"
 
-#: ../client/pk-console.c:1316 ../client/pk-console.c:1323
-#, c-format
+#: ../client/pk-console.c:1316
+#: ../client/pk-console.c:1323
 msgid "You need to specify a repo name"
-msgstr "Es muss ein Deponame angegeben werden"
+msgstr "Es muss ein Repository-Name angegeben werden"
 
 #: ../client/pk-console.c:1330
-#, c-format
 msgid "You need to specify a repo name/parameter and value"
-msgstr "Es muss ein Depo Name/Argument und Wert angegeben werden"
+msgstr "Es muss ein Repository-Name/Argument und Wert angegeben werden"
 
 #: ../client/pk-console.c:1343
-#, c-format
 msgid "You need to specify a time term"
 msgstr "Es muss ein Zeitausdruck angegeben werden"
 
 #: ../client/pk-console.c:1348
-#, c-format
 msgid "You need to specify a correct role"
-msgstr "Es muss eine correct Rolle angegeben werden"
+msgstr "Es muss eine korrekte Rolle angegeben werden"
 
 #: ../client/pk-console.c:1353
-#, c-format
 msgid "Failed to get last time"
 msgstr "Die letzte Zeit konnte nicht abgefragt werden"
 
 #: ../client/pk-console.c:1389
-#, c-format
 msgid "You need to specify a package to find the description for"
-msgstr ""
-"Es muss ein Paket angegeben werden zu dem die Beschreibung gefunden werden "
-"soll"
+msgstr "Es muss ein Paket angegeben werden zu dem die Beschreibung gefunden werden soll"
 
 #: ../client/pk-console.c:1396
-#, c-format
 msgid "You need to specify a package to find the files for"
-msgstr ""
-"Es muss ein Paket angegeben werden zu dem die Dateien gefunden werden sollen"
+msgstr "Es muss ein Paket angegeben werden zu dem die Dateien gefunden werden sollen"
 
 #: ../client/pk-console.c:1441
 #, c-format
@@ -335,7 +234,7 @@ msgstr "Option '%s' wird nicht unterstützt"
 
 #: ../client/pk-console.c:1452
 msgid "Command failed"
-msgstr "Kommando fehlgeschlagen"
+msgstr "Befehl fehlgeschlagen"
 
 #: ../client/pk-console.c:1456
 msgid "You don't have the necessary privileges for this operation"
@@ -345,12 +244,14 @@ msgstr "Es fehlen die benötigten Rechte für diese Operation"
 msgid "PackageKit Monitor"
 msgstr "PackageKit Monitor"
 
-#: ../client/pk-import-desktop.c:283 ../client/pk-import-specspo.c:169
+#: ../client/pk-import-desktop.c:283
+#: ../client/pk-import-specspo.c:169
 #, c-format
 msgid "Could not open database: %s"
 msgstr "Datenbank konnte nicht geöffnet werden: %s"
 
-#: ../client/pk-import-desktop.c:284 ../client/pk-import-specspo.c:170
+#: ../client/pk-import-desktop.c:284
+#: ../client/pk-import-specspo.c:170
 msgid "You probably need to run this program as the root user"
 msgstr "Das Programm muss möglicherweise als Benutzer root ausgeführt werden"
 
@@ -364,17 +265,11 @@ msgstr "Dies kann zwei Gründe haben:"
 
 #: ../src/pk-main.c:85
 msgid "The correct user is not launching the executable (usually root)"
-msgstr ""
-"Das Programm wurde nicht vom richtigen Benutzer gestartet (normalerweise "
-"root)"
+msgstr "Das Programm wurde nicht vom richtigen Benutzer gestartet (normalerweise root)"
 
 #: ../src/pk-main.c:86
-msgid ""
-"The org.freedesktop.PackageKit.conf file is not installed in the system /etc/"
-"dbus-1/system.d directory"
-msgstr ""
-"Die Datei org.freedesktop.PackageKit.conf ist nicht im Verzeichniss /etc/"
-"dbus-1/system.d installiert"
+msgid "The org.freedesktop.PackageKit.conf file is not installed in the system /etc/dbus-1/system.d directory"
+msgstr "Die Datei org.freedesktop.PackageKit.conf ist nicht im Verzeichnis /etc/dbus-1/system.d installiert"
 
 #: ../src/pk-main.c:185
 msgid "Packaging backend to use, e.g. dummy"
@@ -386,7 +281,7 @@ msgstr "Als Dienst starten und vom Terminal trennen"
 
 #: ../src/pk-main.c:191
 msgid "Disable the idle timer"
-msgstr "Den IDLE Zeitnehmer deaktivieren"
+msgstr "Den IDLE-Zeitnehmer deaktivieren"
 
 #: ../src/pk-main.c:193
 msgid "Show version and exit"
@@ -402,13 +297,63 @@ msgstr "Beenden nachdem die Funktionseinheit geladen wurde"
 
 #: ../src/pk-main.c:207
 msgid "PackageKit service"
-msgstr "PackageKit Dienst"
+msgstr "PackageKit-Dienst"
 
 #: ../src/pk-main.c:233
 msgid "Cannot connect to the system bus"
-msgstr "es konnte nicht zum System BUS verbunden werden"
+msgstr "Es konnte nicht zum System-Bus verbunden werden"
 
 #: ../src/pk-main.c:273
 #, c-format
 msgid "Error trying to start: %s\n"
 msgstr "Fehler beim Versuch zu starten: %s\n"
+
+#~ msgid "Accept EULA"
+#~ msgstr "EULA akzeptieren"
+#~ msgid "Authentication is required to accept a EULA"
+#~ msgstr "eine Authentifikation ist erforderlich zum akzeptieren der EULA"
+#~ msgid "Authentication is required to change software source parameters"
+#~ msgstr "eine Authentifikation ist erforderlich um Softwarequellen zu ändern"
+#~ msgid "Authentication is required to install a local file"
+#~ msgstr ""
+#~ "eine Authentifikation ist erforderlich um eine lokale Datei zu "
+#~ "installieren"
+#~ msgid "Authentication is required to install a package"
+#~ msgstr "eine Authentifikation ist erforderlich um ein Paket zu installieren"
+#~ msgid "Authentication is required to install a security signature"
+#~ msgstr ""
+#~ "eine Authentifikation ist erforderlich um eine digitale Unterschrift zu "
+#~ "installieren"
+#~ msgid "Authentication is required to refresh the package lists"
+#~ msgstr ""
+#~ "eine Authentifikation ist erforderlich um die Paketliste zu aktualisieren"
+#~ msgid "Authentication is required to remove packages"
+#~ msgstr "eine Authentifikation ist erforderlich um Pakete zu entfernen"
+#~ msgid "Authentication is required to rollback a transaction"
+#~ msgstr ""
+#~ "eine Authentifikation ist erforderlich um eine Transaktion rückgängig zu "
+#~ "machen"
+#~ msgid "Authentication is required to update all packages"
+#~ msgstr ""
+#~ "eine Authentifikation ist erforderlich um alle Pakete zu aktualisieren"
+#~ msgid "Authentication is required to update packages"
+#~ msgstr "eine Authentifikation ist erforderlich um Pakete zu aktualisieren"
+#~ msgid "Change software source parameters"
+#~ msgstr "Softwarequellen ändern"
+#~ msgid "Install local file"
+#~ msgstr "Lokale Datei installieren"
+#~ msgid "Install package"
+#~ msgstr "Paket installieren"
+#~ msgid "Install security signature"
+#~ msgstr "digitale Unterschrift installieren"
+#~ msgid "Refresh package lists"
+#~ msgstr "Paketlisten aktualisieren"
+#~ msgid "Remove package"
+#~ msgstr "Paket entfernen"
+#~ msgid "Rollback to a previous transaction"
+#~ msgstr "Wiederherstellung zu einer vorherigen Transaktion"
+#~ msgid "Update all packages"
+#~ msgstr "Alle Pakete aktualisieren"
+#~ msgid "Update package"
+#~ msgstr "Paket aktualisieren"
+
commit 850feba91bd238068563e68b10a99326debb4d09
Merge: 4555b07... b7a5b99...
Author: Robin Norwood <rnorwood at redhat.com>
Date:   Wed Apr 23 10:44:27 2008 -0400

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

diff --cc backends/yum/helpers/yumBackend.py
index 7f70269,9ea100c..ab7c1db
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@@ -914,12 -920,25 +920,27 @@@ class PackageKitYumBackend(PackageKitBa
          self.status(STATUS_RUNNING)
  
          pkgs_to_inst = []
-         self.yumbase.conf.gpgcheck=0
+ 
+         # If trusted is true, it means that we will only install trusted files
+         if trusted == 'yes':
+             # disregard the default
+             self.yumbase.conf.gpgcheck=1
+ 
+             # self.yumbase.installLocal fails for unsigned packages when self.yumbase.conf.gpgcheck=1
+             # This means we don't run runYumTransaction, and don't get the GPG failure in
+             # PackageKitYumBase(_checkSignatures) -- so we check here
+             po = YumLocalPackage(ts=self.yumbase.rpmdb.readOnlyTS(), filename=inst_file)
+             try:
+                 self.yumbase._checkSignatures([po], None)
+             except yum.Errors.YumGPGCheckError,e:
+                 self.error(ERROR_MISSING_GPG_SIGNATURE,str(e))
+         else:
+             self.yumbase.conf.gpgcheck=0
  
 +        if not self._check_local_file(inst_file):
 +            return
 +            
          try:
 -            self._check_local_file(inst_file)
              txmbr = self.yumbase.installLocal(inst_file)
              if txmbr:
                  self._checkForNewer(txmbr[0].po)
commit 4555b078034ab2605adab60d46614b3da61d8097
Author: Robin Norwood <rnorwood at redhat.com>
Date:   Wed Apr 23 10:44:11 2008 -0400

    Fix error messages for new install-file error cases.

diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index 8da06df..7f70269 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -916,8 +916,10 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         pkgs_to_inst = []
         self.yumbase.conf.gpgcheck=0
 
+        if not self._check_local_file(inst_file):
+            return
+            
         try:
-            self._check_local_file(inst_file)
             txmbr = self.yumbase.installLocal(inst_file)
             if txmbr:
                 self._checkForNewer(txmbr[0].po)
@@ -957,16 +959,21 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         try:
             po = YumLocalPackage(ts=self.yumbase.rpmdb.readOnlyTS(), filename=pkg)
         except yum.Errors.MiscError:
-            raise yum.Errors.InstallError("%s does not appear to be a valid package." % pkg)
+            self.error(ERROR_INVALID_PACKAGE_FILE, "%s does not appear to be a valid package." % pkg)
+            return False
 
         if self._is_inst(po):
-            raise yum.Errors.InstallError("%s is already installed" % str(po))
+            self.error(ERROR_PACKAGE_ALREADY_INSTALLED, "%s is already installed" % str(po))
+            return False
 
         if len(self.yumbase.conf.exclude) > 0:
            exactmatch, matched, unmatched = \
                    parsePackages([po], self.yumbase.conf.exclude, casematch=1)
            if po in exactmatch + matched:
-               raise yum.Errors.InstallError("%s is excluded by yum configuration." % pkg)
+               self.error(ERROR_PACKAGE_INSTALL_BLOCKED, "Installation of %s is excluded by yum configuration." % pkg)
+               return False
+
+        return True
 
     def update(self,packages):
         '''
diff --git a/docs/spec/pk-concepts.xml b/docs/spec/pk-concepts.xml
index 1f294c0..5ed24dc 100644
--- a/docs/spec/pk-concepts.xml
+++ b/docs/spec/pk-concepts.xml
@@ -263,6 +263,20 @@
             <entry>A package failed to download correctly</entry>
           </row>
           <row>
+            <entry><literal>invalid-package-file</literal></entry>
+            <entry>
+	      The file that is supposed to contain a package to
+              install is corrupt, or is not a valid package file
+	    </entry>
+          </row>
+          <row>
+            <entry><literal>package-install-blocked</literal></entry>
+            <entry>
+	      The backend's configuration or policy prevents the
+              install or updating of a package
+	    </entry>
+          </row>
+          <row>
             <entry><literal>dep-resolution-failed</literal></entry>
             <entry>Dependency resolution failed</entry>
           </row>
diff --git a/libpackagekit/pk-enum.c b/libpackagekit/pk-enum.c
index 152a33b..768b078 100644
--- a/libpackagekit/pk-enum.c
+++ b/libpackagekit/pk-enum.c
@@ -149,6 +149,8 @@ static PkEnumMatch enum_error[] = {
 	{PK_ERROR_ENUM_NO_LICENSE_AGREEMENT,	"no-license-agreement"},
 	{PK_ERROR_ENUM_FILE_CONFLICTS,		"file-conflicts"},
 	{PK_ERROR_ENUM_REPO_NOT_AVAILABLE,	"repo-not-available"},
+	{PK_ERROR_ENUM_INVALID_PACKAGE_FILE,    "invalid-package-file"},
+	{PK_ERROR_ENUM_PACKAGE_INSTALL_BLOCKED, "package-install-blocked"},
 	{0, NULL}
 };
 
diff --git a/libpackagekit/pk-enum.h b/libpackagekit/pk-enum.h
index 11c61cf..a28fa17 100644
--- a/libpackagekit/pk-enum.h
+++ b/libpackagekit/pk-enum.h
@@ -240,6 +240,8 @@ typedef enum {
 	PK_ERROR_ENUM_NO_LICENSE_AGREEMENT,
 	PK_ERROR_ENUM_FILE_CONFLICTS,
 	PK_ERROR_ENUM_REPO_NOT_AVAILABLE,
+	PK_ERROR_ENUM_INVALID_PACKAGE_FILE,
+	PK_ERROR_ENUM_PACKAGE_INSTALL_BLOCKED,
 	PK_ERROR_ENUM_UNKNOWN
 } PkErrorCodeEnum;
 


More information about the PackageKit-commit mailing list