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

Richard Hughes hughsient at kemper.freedesktop.org
Mon Sep 1 01:28:43 PDT 2008


 backends/apt/aptDBUSBackend.py         |  122 ++++++++++-
 backends/apt/pk-backend-apt.c          |   11 -
 backends/smart/helpers/Makefile.am     |    1 
 backends/smart/helpers/search-file.py  |   22 ++
 backends/smart/helpers/smartBackend.py |   16 +
 backends/smart/pk-backend-smart.c      |   14 +
 docs/html/pk-download.html             |    4 
 docs/html/pk-matrix.html               |    4 
 po/fi.po                               |  339 ++++++++++++++++++++++++---------
 po/pt_BR.po                            |   12 -
 python/enum-convertor.py               |    2 
 python/packagekit/daemonBackend.py     |   30 ++
 src/pk-backend-dbus.c                  |   55 +++++
 src/pk-backend-dbus.h                  |    1 
 14 files changed, 517 insertions(+), 116 deletions(-)

New commits:
commit fdaf81afbdfdfef7061d99771b5c569417cc1b71
Author: Richard Hughes <richard at hughsie.com>
Date:   Mon Sep 1 09:23:57 2008 +0100

    add instructions for getting PackageKit on Ubuntu, from Dimitris Symeonidis, many thanks

diff --git a/docs/html/pk-download.html b/docs/html/pk-download.html
index ec0bf8a..75e2d35 100644
--- a/docs/html/pk-download.html
+++ b/docs/html/pk-download.html
@@ -32,6 +32,10 @@ easier to install.
    Fedora 9: Yes, just run: <code>yum install PackageKit gnome-packagekit</code> (as root)
   </li>
   <li>
+   Ubuntu: Yes, just run: <code>apt-get install PackageKit gnome-packagekit</code> (as root).
+   With hardy expect the obsolete 0.1.6 release, but intrepid has the stable 0.2.4 release.
+  </li>
+  <li>
    openSUSE 11: Yes, add <a href="http://download.opensuse.org/distribution/SL-OSS-factory/inst-source">this</a>
    repository file and run: <code>zypper install PackageKit gnome-packagekit</code> (as root)
   </li>
commit 75cbb5293378b92cdf3dd0155307cfc2575411af
Author: Anders F Bjorklund <afb at users.sourceforge.net>
Date:   Mon Sep 1 10:05:29 2008 +0200

    smart: add search_file

diff --git a/backends/smart/helpers/Makefile.am b/backends/smart/helpers/Makefile.am
index cdfbca3..3291cf5 100644
--- a/backends/smart/helpers/Makefile.am
+++ b/backends/smart/helpers/Makefile.am
@@ -18,6 +18,7 @@ dist_helper_DATA = 			\
 	repo-enable.py			\
 	resolve.py			\
 	search-name.py			\
+	search-file.py			\
 	search-group.py			\
 	search-details.py		\
 	smartBackend.py			\
diff --git a/backends/smart/helpers/search-file.py b/backends/smart/helpers/search-file.py
new file mode 100755
index 0000000..2b1d118
--- /dev/null
+++ b/backends/smart/helpers/search-file.py
@@ -0,0 +1,22 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2007 Richard Hughes <richard at hughsie.com>
+# Copyright (C) 2007 James Bowes <jbowes at dangerouslyinc.com>
+#
+# Licensed under the GNU General Public License Version 2
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+
+import sys
+
+from smartBackend import PackageKitSmartBackend
+
+options = sys.argv[1]
+searchterms = sys.argv[2]
+
+backend = PackageKitSmartBackend(sys.argv[1:])
+backend.search_file(options,searchterms)
+sys.exit(0)
diff --git a/backends/smart/helpers/smartBackend.py b/backends/smart/helpers/smartBackend.py
index ce8c183..ff6b200 100644
--- a/backends/smart/helpers/smartBackend.py
+++ b/backends/smart/helpers/smartBackend.py
@@ -244,6 +244,22 @@ class PackageKitSmartBackend(PackageKitBaseBackend):
                 self._show_package(package)
 
     @needs_cache
+    def search_file(self, filters, searchstring):
+        self.status(STATUS_QUERY)
+        packages = self.ctrl.getCache().getPackages()
+        for package in packages:
+            if self._passes_filters(package, filters):
+                # FIXME: Only installed packages have path lists.
+                paths = []
+                for loader in package.loaders:
+                    info = loader.getInfo(package)
+                    paths = info.getPathList()
+                    if len(paths) > 0:
+                        break
+                if searchstring in paths:
+                    self._show_package(package)
+
+    @needs_cache
     def search_group(self, filters, searchstring):
         self.status(STATUS_QUERY)
         packages = self.ctrl.getCache().getPackages()
diff --git a/backends/smart/pk-backend-smart.c b/backends/smart/pk-backend-smart.c
index 342f3d0..e17ad59 100644
--- a/backends/smart/pk-backend-smart.c
+++ b/backends/smart/pk-backend-smart.c
@@ -294,6 +294,18 @@ backend_search_details (PkBackend *backend, PkBitfield filters, const gchar *sea
 }
 
 /**
+ * pk_backend_search_file:
+ */
+static void
+backend_search_file (PkBackend *backend, PkBitfield filters, const gchar *search)
+{
+	gchar *filters_text;
+	filters_text = pk_filter_bitfield_to_text (filters);
+	pk_backend_spawn_helper (spawn, "search-file.py", filters_text, search, NULL);
+	g_free (filters_text);
+}
+
+/**
  * pk_backend_search_group:
  */
 static void
@@ -401,7 +413,7 @@ PK_BACKEND_OPTIONS (
 	backend_resolve,				/* resolve */
 	NULL,						/* rollback */
 	backend_search_details,				/* search_details */
-	NULL,						/* search_file */
+	backend_search_file,				/* search_file */
 	backend_search_group,				/* search_group */
 	backend_search_name,				/* search_name */
 	NULL,						/* service_pack */
commit 6ca754abc0f6d08188b18297ffd1aa163f17dadb
Author: Ville-Pekka Vainio <vpivaini at cs.helsinki.fi>
Date:   Sun Aug 31 21:55:00 2008 +0000

    Updated Finnish translation
    
    Transmitted-via: Transifex (translate.fedoraproject.org)

diff --git a/po/fi.po b/po/fi.po
index 939901f..1b9b947 100644
--- a/po/fi.po
+++ b/po/fi.po
@@ -7,244 +7,402 @@ msgid ""
 msgstr ""
 "Project-Id-Version: packagekit\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-05-03 01:34+0000\n"
-"PO-Revision-Date: 2008-05-06 00:39+0300\n"
+"POT-Creation-Date: 2008-08-26 01:23+0000\n"
+"PO-Revision-Date: 2008-09-01 00:51+0300\n"
 "Last-Translator: Ville-Pekka Vainio <vpivaini at cs.helsinki.fi>\n"
 "Language-Team: Finnish <laatu at lokalisointi.org>\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#: ../client/pk-console.c:224
+#: ../client/pk-console.c:235
 msgid "Update detail"
 msgstr "Päivityksen tiedot"
 
-#: ../client/pk-console.c:425
+#: ../client/pk-console.c:452
 msgid "A system restart is required"
 msgstr "Järjestelmä on käynnistettävä uudelleen"
 
-#: ../client/pk-console.c:427
+#: ../client/pk-console.c:454
 msgid "A logout and login is required"
 msgstr "On kirjauduttava ulos ja takaisin sisään"
 
-#: ../client/pk-console.c:429
+#: ../client/pk-console.c:456
 msgid "An application restart is required"
 msgstr "Sovellus on käynnistettävä uudelleen"
 
-#: ../client/pk-console.c:474
-#, c-format
-msgid "Please enter a number from 1 to %i: "
-msgstr "Anna numero väliltä 1-%i: "
-
-#: ../client/pk-console.c:524
-msgid "Could not find a package match"
-msgstr "Vastaavaa pakettia ei löytynyt"
-
-#: ../client/pk-console.c:538
+#: ../client/pk-console.c:549 ../client/pk-generate-pack.c:124
 msgid "There are multiple package matches"
 msgstr "Useita vastaavia paketteja saatavilla"
 
 #. find out what package the user wants to use
-#: ../client/pk-console.c:545
+#: ../client/pk-console.c:556 ../client/pk-generate-pack.c:131
 msgid "Please enter the package number: "
 msgstr "Anna paketin numero:"
 
-#: ../client/pk-console.c:561
-msgid ""
-"Could not find a package with that name to install, or package already "
-"installed"
-msgstr ""
-"Nimellä ei löytynyt pakettia asennettavaksi tai paketti on jo asennettu"
+#: ../client/pk-console.c:590
+msgid "Could not find package to install"
+msgstr "Asennettavaksi pyydettyä pakettia ei löytynyt"
 
-#: ../client/pk-console.c:643
-msgid "Could not find a package with that name to remove"
-msgstr "Nimellä ei löytynyt pakettia poistettavaksi"
+#: ../client/pk-console.c:696
+msgid "Could not find package to remove"
+msgstr "Poistettavaksi pyydettyä pakettia ei löytynyt"
 
-#: ../client/pk-console.c:683
+#: ../client/pk-console.c:757
 msgid "The following packages have to be removed"
 msgstr "Seuraavat paketit on poistettava"
 
 #. get user input
-#: ../client/pk-console.c:692
+#: ../client/pk-console.c:764
 msgid "Okay to remove additional packages?"
 msgstr "Poistetaanko lisäpaketteja?"
 
-#: ../client/pk-console.c:696
+#: ../client/pk-console.c:768 ../client/pk-generate-pack.c:523
+#: ../client/pk-generate-pack-main.c:131
 msgid "Cancelled!"
 msgstr "Peruttu!"
 
-#: ../client/pk-console.c:718
-msgid "Could not find a package with that name to update"
-msgstr "Nimellä ei löytynyt pakettia päivitettäväksi"
+#: ../client/pk-console.c:802
+msgid "Could not find package to download"
+msgstr "Ladattavaksi pyydettyä pakettia ei löytynyt"
+
+#: ../client/pk-console.c:853
+msgid "Could not find package to update"
+msgstr "Päivitettäväksi pyydettyä pakettia ei löytynyt"
 
-#: ../client/pk-console.c:736
-msgid "Could not find what packages require this package"
-msgstr "Ei löydetty, mitkä paketti vaativat tämän paketit"
+#: ../client/pk-console.c:875
+msgid "Could not find what packages require"
+msgstr "Ei löydetty, mitkä paketti vaativat tämän paketin"
 
-#: ../client/pk-console.c:754
-msgid "Could not get dependencies for this package"
+#: ../client/pk-console.c:896
+msgid "Could not get dependencies for"
 msgstr "Ei voitu hakea riippuvuuksia tälle paketille"
 
-#: ../client/pk-console.c:772
-msgid "Could not find details for this package"
+#: ../client/pk-console.c:917
+msgid "Could not find details for"
 msgstr "Tämän paketin tietoja ei löydetty"
 
-#: ../client/pk-console.c:790
+#: ../client/pk-console.c:940
 msgid "Could not find the files for this package"
 msgstr "Tämän paketin tiedostoja ei löydetty"
 
-#: ../client/pk-console.c:870
+#: ../client/pk-console.c:947
+msgid "Could not get the file list"
+msgstr "Tiedostoluetteloa ei voitu hakea"
+
+#: ../client/pk-console.c:966
+msgid "Could not find the update details for"
+msgstr "Tämän paketin päivitystietoja ei löydetty"
+
+#: ../client/pk-console.c:1027
 msgid "Package description"
 msgstr "Paketin kuvaus"
 
-#: ../client/pk-console.c:893
+#: ../client/pk-console.c:1060
 msgid "Package files"
 msgstr "Paketin tiedostot"
 
-#: ../client/pk-console.c:901
+#: ../client/pk-console.c:1068
 msgid "No files"
 msgstr "Ei tiedostoja"
 
 #. get user input
-#: ../client/pk-console.c:933
+#: ../client/pk-console.c:1100
 msgid "Okay to import key?"
 msgstr "Tuodaanko avain?"
 
-#: ../client/pk-console.c:936
+#: ../client/pk-console.c:1103
 msgid "Did not import key"
 msgstr "Avainta ei tuotu"
 
 #. get user input
-#: ../client/pk-console.c:976
+#: ../client/pk-console.c:1143
 msgid "Do you agree?"
 msgstr "Hyväksytkö?"
 
-#: ../client/pk-console.c:979
+#: ../client/pk-console.c:1146
 msgid "Did not agree to licence, task will fail"
 msgstr "Käyttöoikeussopimusta ei hyväksytty, tehtävä epäonnistuu"
 
-#: ../client/pk-console.c:1008
+#: ../client/pk-console.c:1175
 msgid "The daemon crashed mid-transaction!"
 msgstr "Taustaprosessi kaatui kesken toimenpiteen"
 
 #. header
-#: ../client/pk-console.c:1061
+#: ../client/pk-console.c:1228
 msgid "PackageKit Console Interface"
 msgstr "PackageKitin konsolikäyttöliittymä"
 
-#: ../client/pk-console.c:1061
+#: ../client/pk-console.c:1228
 msgid "Subcommands:"
 msgstr "Alikomennot:"
 
-#: ../client/pk-console.c:1165 ../client/pk-monitor.c:104 ../src/pk-main.c:189
+#: ../client/pk-console.c:1338 ../client/pk-generate-pack-main.c:64
+#: ../client/pk-monitor.c:104 ../src/pk-main.c:189
 msgid "Show extra debugging information"
 msgstr "Näytä ylimääräisiä virheenjäljitystietoja"
 
-#: ../client/pk-console.c:1167 ../client/pk-monitor.c:106
+#: ../client/pk-console.c:1340 ../client/pk-monitor.c:106
 msgid "Show the program version and exit"
 msgstr "Näytä ohjelman versio ja lopeta"
 
-#: ../client/pk-console.c:1169
+#: ../client/pk-console.c:1342
 msgid "Set the filter, e.g. installed"
 msgstr "Aseta suodin, esim. asennettu"
 
-#: ../client/pk-console.c:1171
+#: ../client/pk-console.c:1344
 msgid "Exit without waiting for actions to complete"
 msgstr "Lopeta odottamatta toimintojen valmistumista"
 
-#: ../client/pk-console.c:1194
+#: ../client/pk-console.c:1367
 msgid "Could not connect to system DBUS."
 msgstr "Järjestelmän DBUSiin yhdistäminen ei onnistunut."
 
-#: ../client/pk-console.c:1288
-msgid "You need to specify a search type"
-msgstr "Haun tyyppi on annettava"
+#: ../client/pk-console.c:1464
+msgid "You need to specify a search type, e.g. name"
+msgstr "Haun tyyppi on annettava, esim. nimi"
 
-#: ../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
+#: ../client/pk-console.c:1469 ../client/pk-console.c:1476
+#: ../client/pk-console.c:1483 ../client/pk-console.c:1490
+#: ../client/pk-console.c:1601 ../client/pk-console.c:1611
+#: ../client/pk-console.c:1618 ../client/pk-console.c:1625
 msgid "You need to specify a search term"
 msgstr "Hakutermi on annettava"
 
-#: ../client/pk-console.c:1319
+#: ../client/pk-console.c:1495
 msgid "Invalid search type"
 msgstr "Virheellinen haun tyyppi"
 
-#: ../client/pk-console.c:1324
+#: ../client/pk-console.c:1500
 msgid "You need to specify a package or file to install"
 msgstr "Asennettava paketti tai tiedosto on annettava"
 
-#: ../client/pk-console.c:1339
+#: ../client/pk-console.c:1507
 msgid "You need to specify a type, key_id and package_id"
 msgstr "Tyyppi, key_id ja package_id on annettava"
 
-#: ../client/pk-console.c:1346
+#: ../client/pk-console.c:1514
 msgid "You need to specify a package to remove"
 msgstr "Poistettava paketti on annettava"
 
-#: ../client/pk-console.c:1353
+#: ../client/pk-console.c:1520
+msgid ""
+"You need to specify the destination directory and then the packages to "
+"download"
+msgstr "Kohdehakemisto ja ladattavat paketit on annettava"
+
+#: ../client/pk-console.c:1525
+msgid "Directory not found"
+msgstr "Hakemistoa ei löytynyt"
+
+#: ../client/pk-console.c:1531
 msgid "You need to specify a eula-id"
 msgstr "Eula-id on annettava"
 
-#: ../client/pk-console.c:1369
+#: ../client/pk-console.c:1547
 msgid "You need to specify a package name to resolve"
 msgstr "Ratkaistavan paketin nimi on annettava"
 
-#: ../client/pk-console.c:1376 ../client/pk-console.c:1383
+#: ../client/pk-console.c:1556 ../client/pk-console.c:1563
 msgid "You need to specify a repo name"
 msgstr "Asennuslähteen nimi on annettava"
 
-#: ../client/pk-console.c:1390
+#: ../client/pk-console.c:1570
 msgid "You need to specify a repo name/parameter and value"
 msgstr "Asennuslähteen nimi/parametri ja arvo on annettava"
 
-#: ../client/pk-console.c:1403
+#: ../client/pk-console.c:1583
 msgid "You need to specify a time term"
 msgstr "Aika on annettava"
 
-#: ../client/pk-console.c:1408
+#: ../client/pk-console.c:1588
 msgid "You need to specify a correct role"
 msgstr "Sopiva rooli on annettava"
 
-#: ../client/pk-console.c:1413
+#: ../client/pk-console.c:1593
 msgid "Failed to get last time"
 msgstr "Edellistä aikaa ei saatu"
 
-#: ../client/pk-console.c:1449
+#: ../client/pk-console.c:1632
 msgid "You need to specify a package to find the details for"
 msgstr "On annettava paketti, jonka tietoja etsitään"
 
-#: ../client/pk-console.c:1456
+#: ../client/pk-console.c:1639
 msgid "You need to specify a package to find the files for"
 msgstr "On annettava paketti, jonka tiedostoja etsitään"
 
-#: ../client/pk-console.c:1503
+#: ../client/pk-console.c:1688
 #, c-format
 msgid "Option '%s' not supported"
-msgstr "valitsin ”%s” ei ole tuettu"
+msgstr "Valitsin ”%s” ei ole tuettu"
 
-#: ../client/pk-console.c:1514
+#: ../client/pk-console.c:1701
+msgid "You don't have the necessary privileges for this operation"
+msgstr "Sinulla ei ole tähän toimintoon tarvittavia oikeuksia"
+
+#: ../client/pk-console.c:1703
 msgid "Command failed"
 msgstr "Komento epäonnistui"
 
-#: ../client/pk-console.c:1518
-msgid "You don't have the necessary privileges for this operation"
-msgstr "Sinulla ei ole tähän toimintoon tarvittavia oikeuksia"
+#: ../client/pk-generate-pack.c:115
+msgid "Could not find a package match"
+msgstr "Vastaavaa pakettia ei löytynyt"
 
-#: ../client/pk-monitor.c:117
-msgid "PackageKit Monitor"
-msgstr "PackageKit-tarkkailija"
+#: ../client/pk-generate-pack.c:149
+msgid "failed to download: invalid package_id and/or directory"
+msgstr "Lataaminen epäonnistui: virheellinen package_id ja/tai hakemisto"
+
+#: ../client/pk-generate-pack.c:230
+msgid "Could not find a valid metadata file"
+msgstr "Kelvollista metadata-tiedostoa ei löytynyt"
+
+#. get user input
+#: ../client/pk-generate-pack.c:519
+msgid "Okay to download the additional packages"
+msgstr "Ladataanko lisäpaketit?"
+
+#: ../client/pk-generate-pack-main.c:66
+msgid ""
+"Set the path of the file with the list of packages/dependencies to be "
+"excluded"
+msgstr ""
+"Aseta polku tiedostoon, jossa on pois jätettävien pakettien/riippuvuuksien "
+"luettelo"
+
+#: ../client/pk-generate-pack-main.c:111
+msgid "You need to specify the pack name and packages to be packed\n"
+msgstr "Pakkauksen nimi ja pakattavat paketit on annettava\n"
+
+#: ../client/pk-generate-pack-main.c:117
+msgid ""
+"Invalid name for the service pack, Specify a name with .servicepack "
+"extension\n"
+msgstr ""
+"Virheellinen nimi huoltopakkaukselle, nimessä on oltava .servicepack-pääte\n"
+
+#: ../client/pk-generate-pack-main.c:129
+msgid "A pack with the same name already exists, do you want to overwrite it?"
+msgstr "Samalla nimellä on jo olemassa pakkaus, haluatko korvata sen?"
 
-#: ../client/pk-import-desktop.c:293 ../client/pk-import-specspo.c:169
+#: ../client/pk-generate-pack-main.c:142
+msgid "Failed to create directory"
+msgstr "Hakemiston luominen epäonnistui"
+
+#: ../client/pk-generate-pack-main.c:149
+msgid "Failed to create pack"
+msgstr "Pakkauksen luominen epäonnistui"
+
+#: ../client/pk-import-desktop.c:279 ../client/pk-import-specspo.c:177
 #, c-format
 msgid "Could not open database: %s"
 msgstr "Ei voitu avata tietokantaa: %s"
 
-#: ../client/pk-import-desktop.c:294 ../client/pk-import-specspo.c:170
+#: ../client/pk-import-desktop.c:280 ../client/pk-import-specspo.c:178
 msgid "You probably need to run this program as the root user"
 msgstr "Tämä ohjelma on luultavasti suoritettava root-käyttäjänä"
 
+#: ../client/pk-monitor.c:117
+msgid "PackageKit Monitor"
+msgstr "PackageKit-tarkkailija"
+
+#: ../client/pk-tools-common.c:51
+#, c-format
+msgid "Please enter a number from 1 to %i: "
+msgstr "Anna numero väliltä 1-%i: "
+
+#: ../contrib/packagekit-plugin/src/contents.cpp:300
+msgid "Getting package information..."
+msgstr "Haetaan pakettitietoja..."
+
+#: ../contrib/packagekit-plugin/src/contents.cpp:304
+#, c-format
+msgid "<span color='#%06x' underline='single' size='larger'>Run %s</span>"
+msgstr "<span color='#%06x' underline='single' size='larger'>Suorita %s</span>"
+
+#: ../contrib/packagekit-plugin/src/contents.cpp:308
+#: ../contrib/packagekit-plugin/src/contents.cpp:313
+#: ../contrib/packagekit-plugin/src/contents.cpp:336
+#: ../contrib/packagekit-plugin/src/contents.cpp:340
+#, c-format
+msgid "<big>%s</big>"
+msgstr "<big>%s</big>"
+
+#: ../contrib/packagekit-plugin/src/contents.cpp:310
+#, c-format
+msgid ""
+"\n"
+"<small>Installed version: %s</small>"
+msgstr ""
+"\n"
+"<small>Asennettu versio: %s</small>"
+
+#: ../contrib/packagekit-plugin/src/contents.cpp:316
+#, c-format
+msgid ""
+"\n"
+"<span color='#%06x' underline='single'>Run version %s now</span>"
+msgstr ""
+"\n"
+"<span color='#%06x' underline='single'>Suorita versio %s nyt</span>"
+
+#: ../contrib/packagekit-plugin/src/contents.cpp:321
+#, c-format
+msgid ""
+"\n"
+"<span color='#%06x' underline='single'>Run now</span>"
+msgstr ""
+"\n"
+"<span color='#%06x' underline='single'>Suorita nyt</span>"
+
+#: ../contrib/packagekit-plugin/src/contents.cpp:325
+#, c-format
+msgid ""
+"\n"
+"<span color='#%06x' underline='single'>Upgrade to version %s</span>"
+msgstr ""
+"\n"
+"<span color='#%06x' underline='single'>Päivitä versioon %s</span>"
+
+#: ../contrib/packagekit-plugin/src/contents.cpp:330
+#, c-format
+msgid ""
+"<span color='#%06x' underline='single' size='larger'>Install %s Now</span>"
+msgstr ""
+"<span color='#%06x' underline='single' size='larger'>Asenna %s nyt</span>"
+
+#: ../contrib/packagekit-plugin/src/contents.cpp:333
+#, c-format
+msgid ""
+"\n"
+"<small>Version: %s</small>"
+msgstr ""
+"\n"
+"<small>Versio: %s</small>"
+
+#: ../contrib/packagekit-plugin/src/contents.cpp:337
+msgid ""
+"\n"
+"<small>No packages found for your system</small>"
+msgstr ""
+"\n"
+"<small>Järjestelmääsi sopivia paketteja ei löytynyt</small>"
+
+#: ../contrib/packagekit-plugin/src/contents.cpp:341
+msgid ""
+"\n"
+"<small>Installing...</small>"
+msgstr ""
+"\n"
+"<small>Asennetaan...</small>"
+
+#: ../data/packagekit-catalog.xml.in.h:1
+msgid "PackageKit Catalog"
+msgstr "PackageKit-katalogi"
+
+#: ../data/packagekit-pack.xml.in.h:1
+msgid "PackageKit Service Pack"
+msgstr "PackageKit-huoltopakkaus"
+
 #: ../src/pk-main.c:83
 msgid "Startup failed due to security policies on this machine."
 msgstr "Käynnistys epäonnistui tämän koneen turvakäytäntöjen vuoksi"
@@ -303,6 +461,15 @@ msgstr "Ei voida yhdistää järjestelmäväylään"
 msgid "Error trying to start: %s\n"
 msgstr "Virhe yritettäessä käynnistää: %s\n"
 
+#~ msgid ""
+#~ "Could not find a package with that name to install, or package already "
+#~ "installed"
+#~ msgstr ""
+#~ "Nimellä ei löytynyt pakettia asennettavaksi tai paketti on jo asennettu"
+
+#~ msgid "Could not find a package with that name to update"
+#~ msgstr "Nimellä ei löytynyt pakettia päivitettäväksi"
+
 #~ msgid "Could not find a description for this package"
 #~ msgstr "Tälle paketille ei löydetty kuvausta"
 
commit 34c09e74a197b45b7bc977016c8f159147d465ed
Merge: fdae31a... 51d32f6...
Author: Sebastian Heinlein <devel at glatzor.de>
Date:   Sat Aug 30 22:48:33 2008 +0200

    Merge branch 'master' into glatzor

commit fdae31ab43fdcae4e00703d2de70e013a1fbe27d
Author: Sebastian Heinlein <devel at glatzor.de>
Date:   Sat Aug 30 16:22:51 2008 +0200

    Update feature matrix for apt.

diff --git a/docs/html/pk-matrix.html b/docs/html/pk-matrix.html
index 527e23b..ed11f7b 100644
--- a/docs/html/pk-matrix.html
+++ b/docs/html/pk-matrix.html
@@ -96,7 +96,7 @@
 </tr>
 <tr>
 <td><b>GetDistroUpgrades</b></td>
-<td><img src="img/status-bad.png" alt="[no]"/></td><!-- apt -->
+<td><img src="img/status-good.png" alt="[yes]"/></td><!-- apt -->
 <td><img src="img/status-bad.png" alt="[no]"/></td><!-- alpm -->
 <td><img src="img/status-bad.png" alt="[no]"/></td><!-- box -->
 <td><img src="img/status-bad.png" alt="[no]"/></td><!-- conary -->
@@ -186,7 +186,7 @@
 </tr>
 <tr>
 <td><b>InstallFiles</b></td>
-<td><img src="img/status-bad.png" alt="[no]"/></td><!-- apt -->
+<td><img src="img/status-good.png" alt="[yes]"/></td><!-- apt -->
 <td><img src="img/status-good.png" alt="[yes]"/></td><!-- alpm -->
 <td><img src="img/status-good.png" alt="[yes]"/></td><!-- box -->
 <td><img src="img/status-bad.png" alt="[no]"/></td><!-- conary -->
commit 33ac012319158c25704cc042f461d83656ffb2f7
Author: Sebastian Heinlein <devel at glatzor.de>
Date:   Sat Aug 30 16:19:31 2008 +0200

    APT: Implement GetDistroUpgrades. It makes use of update-manager's MetaRelease classCurrently we only watch and report stable upgrades.

diff --git a/backends/apt/aptDBUSBackend.py b/backends/apt/aptDBUSBackend.py
index fa3ee06..bde2228 100755
--- a/backends/apt/aptDBUSBackend.py
+++ b/backends/apt/aptDBUSBackend.py
@@ -67,6 +67,14 @@ else:
         pklog.debug("Use XAPIAN for the search")
         XAPIAN_SUPPORT = True
 
+# Check if update-manager-core is installed to get aware of the latest distro releases
+try:
+    from UpdateManager.Core.MetaRelease import MetaReleaseCore
+except ImportError:
+    META_RELEASE_SUPPORT = False
+else:
+    META_RELEASE_SUPPORT = True
+
 # Set a timeout for the changelog download
 socket.setdefaulttimeout(2)
 
@@ -501,6 +509,43 @@ class PackageKitAptBackend(PackageKitBaseBackend):
 
     @threaded
     @async
+    def doGetDistroUpgrades(self):
+        '''
+        Implement the {backend}-get-distro-upgrades functionality
+        '''
+        pklog.info("Get distro upgrades")
+        self.StatusChanged(STATUS_INFO)
+        self.AllowCancel(False)
+        self.NoPercentageUpdates()
+
+        if META_RELEASE_SUPPORT == False:
+            if self._cache.has_key("update-manager-core") and \
+               self._cache["update-manager-core"].isInstalled == False:
+                self.ErrorCode(ERROR_UNKNOWN,
+                               "Please install the package update-manager-core to get notified "
+                               "of the latest distribution releases.")
+            else:
+                self.ErrorCode(ERROR_UNKNOWN,
+                               "Please make sure that update-manager-core is"
+                               "correctly installed.")
+            self.Finished(EXIT_KILLED)
+            return
+
+        #FIXME Evil to start the download during init
+        meta_release = MetaReleaseCore(False, False)
+        #FIXME: should use a lock
+        while meta_release.downloading:
+                time.sleep(1)
+        #FIXME: Add support for description
+        if meta_release.new_dist != None:
+            self.DistroUpgrade("stable", 
+                               "%s %s" % (meta_release.new_dist.name, 
+                                          meta_release_new_dist.version), 
+                               "The latest stable release")
+        self.Finished(EXIT_SUCCESS)
+
+    @threaded
+    @async
     def doGetUpdates(self, filters):
         '''
         Implement the {backend}-get-update functionality
diff --git a/backends/apt/pk-backend-apt.c b/backends/apt/pk-backend-apt.c
index cae02de..2778039 100644
--- a/backends/apt/pk-backend-apt.c
+++ b/backends/apt/pk-backend-apt.c
@@ -177,6 +177,15 @@ backend_get_files (PkBackend *backend, gchar **package_ids)
 	pk_backend_dbus_get_files (dbus, package_ids);
 }
 
+/**
+ * backend_get_distro_upgrades:
+ *  */
+static void
+backend_get_distro_upgrades (PkBackend *backend)
+{
+	pk_backend_dbus_get_distro_upgrades (dbus);
+}
+
 
 /**
  * backend_get_details:
@@ -308,7 +317,7 @@ PK_BACKEND_OPTIONS (
 	backend_download_packages,		/* download_packages */
 	backend_get_depends,			/* get_depends */
 	backend_get_details,			/* get_details */
-	NULL,					/* get_distro_upgrades */
+	backend_get_distro_upgrades,		/* get_distro_upgrades */
 	backend_get_files,			/* get_files */
 	backend_get_packages,			/* get_packages */
 	NULL,					/* get_repo_list */
commit e443efdc98f0db76cc82daa9eecc005ed5b552c8
Author: Sebastian Heinlein <devel at glatzor.de>
Date:   Sat Aug 30 16:15:14 2008 +0200

    Add support for distro upgrades to the dbus backend.

diff --git a/python/packagekit/daemonBackend.py b/python/packagekit/daemonBackend.py
index 0060376..22c1203 100644
--- a/python/packagekit/daemonBackend.py
+++ b/python/packagekit/daemonBackend.py
@@ -348,6 +348,19 @@ class PackageKitBaseBackend(dbus.service.Object):
         pklog.info("RepoSignatureRequired (%s,%s,%s,%s,%s,%s,%s,%s)" %
                    (id,repo_name,key_url,key_userid,key_id,key_fingerprint,key_timestamp,key_type))
 
+    @PKSignalHouseKeeper
+    @dbus.service.signal(dbus_interface=PACKAGEKIT_DBUS_INTERFACE,
+                         signature='sss')
+    def DistroUpgrade(self, type, name, summary):
+        '''
+        send 'distro-upgrade' signal:
+        @param type:   The type of distro upgrade (e.g. stable or unstable)
+        @param name: Short name of the distribution e.g. Dapper Drake 6.06 LTS
+        @param summary: Multi-line description of the release
+        '''
+        pklog.info("DistroUpgrade (%s,%s,%s)" % (type, name, summary))
+
+
 
 #
 # Methods ( client -> engine -> backend )
@@ -736,6 +749,23 @@ class PackageKitBaseBackend(dbus.service.Object):
         self.Finished(EXIT_FAILED)
 
     @dbus.service.method(PACKAGEKIT_DBUS_INTERFACE,
+                         in_signature='',out_signature='')
+    def GetDistroUpgrades(self):
+        '''
+        Implement the {backend}-get-distro-upgrades functionality
+        '''
+        pklog.info("GetDistroUpgrades()")
+        self.doGetDistroUpgrades()
+
+    def doGetDistroUpgrades(self):
+        '''
+        Should be replaced in the corresponding backend sub class
+        '''
+        self.ErrorCode(ERROR_NOT_SUPPORTED,
+                       "This function is not implemented in this backend")
+        self.Finished(EXIT_FAILED)
+
+    @dbus.service.method(PACKAGEKIT_DBUS_INTERFACE,
                          in_signature='s',out_signature='')
     def GetUpdates(self,filters):
         '''
diff --git a/src/pk-backend-dbus.c b/src/pk-backend-dbus.c
index 9baa5a5..2ff5c8b 100644
--- a/src/pk-backend-dbus.c
+++ b/src/pk-backend-dbus.c
@@ -149,6 +149,22 @@ pk_backend_dbus_details_cb (DBusGProxy *proxy, const gchar *package_id,
 }
 
 /**
+ * pk_backend_dbus_distro_upgrade_cb:
+ **/
+static void
+pk_backend_dbus_distro_upgrade_cb (DBusGProxy *proxy,
+			           const gchar *type,
+				   const gchar *name,
+				   const gchar *summary,
+				   PkBackendDbus *backend_dbus)
+{
+	egg_debug ("got signal");
+	pk_backend_distro_upgrade (backend_dbus->priv->backend,
+			           pk_distro_upgrade_enum_from_text (type),
+			           name, summary);
+}
+
+/**
  * pk_backend_dbus_files_cb:
  **/
 static void
@@ -343,6 +359,8 @@ pk_backend_dbus_remove_callbacks (PkBackendDbus *backend_dbus)
 					G_CALLBACK (pk_backend_dbus_repo_signature_required_cb), backend_dbus);
 	dbus_g_proxy_disconnect_signal (proxy, "EulaRequired",
 					G_CALLBACK (pk_backend_dbus_eula_required_cb), backend_dbus);
+	dbus_g_proxy_disconnect_signal (proxy, "DistroUpgrade",
+					G_CALLBACK (pk_backend_dbus_distro_upgrade_cb), backend_dbus);
 	return TRUE;
 }
 
@@ -501,6 +519,9 @@ pk_backend_dbus_set_name (PkBackendDbus *backend_dbus, const gchar *service)
 	dbus_g_proxy_add_signal (proxy, "EulaRequired",
 				 G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
 				 G_TYPE_STRING, G_TYPE_INVALID);
+	dbus_g_proxy_add_signal (proxy, "DistroUpgrade",
+				 G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
+				 G_TYPE_INVALID);
 
 	/* add callbacks */
 	dbus_g_proxy_connect_signal (proxy, "RepoDetail",
@@ -533,6 +554,8 @@ pk_backend_dbus_set_name (PkBackendDbus *backend_dbus, const gchar *service)
 				     G_CALLBACK (pk_backend_dbus_repo_signature_required_cb), backend_dbus, NULL);
 	dbus_g_proxy_connect_signal (proxy, "EulaRequired",
 				     G_CALLBACK (pk_backend_dbus_eula_required_cb), backend_dbus, NULL);
+	dbus_g_proxy_connect_signal (proxy, "DistroUpgrade",
+				     G_CALLBACK (pk_backend_dbus_distro_upgrade_cb), backend_dbus, NULL);
 
 	backend_dbus->priv->proxy = proxy;
 
@@ -695,6 +718,38 @@ pk_backend_dbus_refresh_cache (PkBackendDbus *backend_dbus, gboolean force)
 }
 
 /**
+ * pk_backend_dbus_get_distro_upgrades
+ **/
+gboolean
+pk_backend_dbus_get_distro_upgrades (PkBackendDbus *backend_dbus)
+{
+	gboolean ret;
+	GError *error = NULL;
+
+	g_return_val_if_fail (PK_IS_BACKEND_DBUS (backend_dbus), FALSE);
+	g_return_val_if_fail (backend_dbus->priv->proxy != NULL, FALSE);
+
+	/* new sync method call */
+	pk_backend_dbus_time_reset (backend_dbus);
+	ret = dbus_g_proxy_call (backend_dbus->priv->proxy, 
+			         "GetDistroUpgrades", &error, 
+				 G_TYPE_INVALID, G_TYPE_INVALID);
+	if (error != NULL) {
+		egg_warning ("%s", error->message);
+		pk_backend_error_code (backend_dbus->priv->backend, 
+				       PK_ERROR_ENUM_INTERNAL_ERROR,
+				       error->message);
+		pk_backend_finished (backend_dbus->priv->backend);
+		g_error_free (error);
+	}
+	if (ret) {
+		pk_backend_dbus_time_check (backend_dbus);
+	}
+	return ret;
+}
+
+
+/**
  * pk_backend_dbus_update_system:
  **/
 gboolean
diff --git a/src/pk-backend-dbus.h b/src/pk-backend-dbus.h
index b9df368..eb53962 100644
--- a/src/pk-backend-dbus.h
+++ b/src/pk-backend-dbus.h
@@ -135,6 +135,7 @@ gboolean	 pk_backend_dbus_get_updates		(PkBackendDbus		*backend_dbus,
 							 PkBitfield	 filters);
 gboolean	 pk_backend_dbus_set_name		(PkBackendDbus		*backend_dbus,
 							 const gchar		*service);
+gboolean	 pk_backend_dbus_get_distro_upgrades	(PkBackendDbus		*backend_dbus);
 
 G_END_DECLS
 
commit 51d32f63fd3e8abb34bf8fc17b4453495af2f822
Author: Igor Pires Soares <igorsoares at gmail.com>
Date:   Sat Aug 30 14:15:05 2008 +0000

    Minor fix
    
    Transmitted-via: Transifex (translate.fedoraproject.org)

diff --git a/po/pt_BR.po b/po/pt_BR.po
index 426b2bf..3d3abd3 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -9,7 +9,7 @@ msgstr ""
 "Project-Id-Version: PackageKit\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2008-08-28 01:24+0000\n"
-"PO-Revision-Date: 2008-08-30 00:28-0300\n"
+"PO-Revision-Date: 2008-08-30 11:14-0300\n"
 "Last-Translator: Igor Pires Soares <igor at projetofedora.org>\n"
 "Language-Team: Brazilian Portuguese <fedora-trans-pt_br at redhat.com>\n"
 "MIME-Version: 1.0\n"
@@ -280,7 +280,7 @@ msgstr "Defina o caminho do arquivo com a lista de pacotes/dependências a serem
 
 #: ../client/pk-generate-pack-main.c:111
 msgid "You need to specify the pack name and packages to be packed\n"
-msgstr "Você precisa especificar o nome do conjunto e os pacotes a serem incluídos\n"
+msgstr "Você precisa especificar o nome do pacote de serviços e os pacotes a serem incluídos\n"
 
 #: ../client/pk-generate-pack-main.c:117
 msgid "Invalid name for the service pack, Specify a name with .servicepack extension\n"
@@ -288,7 +288,7 @@ msgstr "Nome inválido para o pacote de serviços. Especifique um nome com a ext
 
 #: ../client/pk-generate-pack-main.c:129
 msgid "A pack with the same name already exists, do you want to overwrite it?"
-msgstr "Um conjunto com o mesmo nome já existe, você deseja sobrescrevê-lo?"
+msgstr "Um pacote de serviços com o mesmo nome já existe, você deseja sobrescrevê-lo?"
 
 #: ../client/pk-generate-pack-main.c:142
 msgid "Failed to create directory"
@@ -296,7 +296,7 @@ msgstr "Falha ao criar o diretório"
 
 #: ../client/pk-generate-pack-main.c:149
 msgid "Failed to create pack"
-msgstr "Falha ao criar o conjunto"
+msgstr "Falha ao criar o pacote de serviços"
 
 #: ../client/pk-import-desktop.c:279
 #: ../client/pk-import-specspo.c:177
commit 024e1dcbd53c74bd1cbe74942b08ecf6c9ca3893
Author: Sebastian Heinlein <devel at glatzor.de>
Date:   Sat Aug 30 16:13:13 2008 +0200

    Fix the python enum converter to allow underscores in the value names (before it missed the DISTRO_UPGRADE enums)

diff --git a/python/enum-convertor.py b/python/enum-convertor.py
index 6ac1fc5..f21cfe0 100644
--- a/python/enum-convertor.py
+++ b/python/enum-convertor.py
@@ -3,7 +3,7 @@
 from re import compile,DOTALL,MULTILINE
 
 enum = compile("static PkEnumMatch enum_([^\]]+)\[\] = {(.*?)};", DOTALL|MULTILINE)
-value = compile("PK_([A-Z]+)_ENUM_([A-Z0-9_]+),\s+\"([^\"]+)\"")
+value = compile("PK_([A-Z_]+)_ENUM_([A-Z0-9_]+),\s+\"([^\"]+)\"")
 
 inp = open("../libpackagekit/pk-enum.c").read()
 
commit 5219c9c93a9c7e43a39164706fe89279dd1ca068
Merge: babfac5... 7f495be...
Author: Sebastian Heinlein <devel at glatzor.de>
Date:   Sat Aug 30 11:18:50 2008 +0200

    Merge branch 'master' into glatzor

commit babfac5c79b8eed97f4840b0b632fb297f2b6041
Author: Sebastian Heinlein <devel at glatzor.de>
Date:   Sat Aug 30 10:40:07 2008 +0200

    APT: Do not suppress badly formatted description lines. Avoid duplicated line breaks. Trivial.

diff --git a/backends/apt/aptDBUSBackend.py b/backends/apt/aptDBUSBackend.py
index 5b06136..fa3ee06 100755
--- a/backends/apt/aptDBUSBackend.py
+++ b/backends/apt/aptDBUSBackend.py
@@ -1735,7 +1735,7 @@ class PackageKitAptBackend(PackageKitBaseBackend):
             raw_line = lines[i]
             if raw_line.strip() == ".":
                 # The line is just line break
-                if desc.endswith("\n"):
+                if not desc.endswith("\n"):
                     desc += "\n"
                 continue
             elif raw_line.startswith("  "):
@@ -1752,6 +1752,7 @@ class PackageKitAptBackend(PackageKitBaseBackend):
                 else:
                     line = raw_line
             else:
+                line = raw_line
                 pkglog.debug("invalid line %s in description for %s:\n%s" % \
                              (i, pkg.name, pkg.rawDescription))
             # Use dots for lists
commit c4d6e86febfe5d4da8b7cc5074d5810a4b96c1c2
Author: Sebastian Heinlein <devel at glatzor.de>
Date:   Sat Aug 30 10:15:10 2008 +0200

    APT: The description formater now respects the Debian Policy

diff --git a/backends/apt/aptDBUSBackend.py b/backends/apt/aptDBUSBackend.py
index eddccc0..5b06136 100755
--- a/backends/apt/aptDBUSBackend.py
+++ b/backends/apt/aptDBUSBackend.py
@@ -1711,7 +1711,10 @@ class PackageKitAptBackend(PackageKitBaseBackend):
 
     def _get_package_description(self, pkg):
         """
-        Return the formated long description
+        Return the formated long description according to the Debian policy
+        (Chapter 5.6.13).
+        See http://www.debian.org/doc/debian-policy/ch-controlfields.html
+        for more information.
         """
         if not pkg._lookupRecord():
             return ""
@@ -1729,19 +1732,32 @@ class PackageKitAptBackend(PackageKitBaseBackend):
         for i in range(len(lines)):
             # Skip the first line, since its a duplication of the summary
             if i == 0: continue
-            line = lines[i].strip()
-            # Replace all empty lines by line breaks
-            if line == ".":
-                desc += "\n"
+            raw_line = lines[i]
+            if raw_line.strip() == ".":
+                # The line is just line break
+                if desc.endswith("\n"):
+                    desc += "\n"
                 continue
-            # Use dots for lists
-            p = re.compile(r'^(\s|\t)*(\*|0|-)',re.MULTILINE)
-            line = p.sub(ur'\n\u2022', line)
-            # Use line breaks only for abstracts
-            if desc == "" or desc[-1] == "\n":
-                desc += line
+            elif raw_line.startswith("  "):
+                # The line should be displayed verbatim without word wrapping
+                if not desc.endswith("\n"):
+                    line = "\n%s\n" % raw_line[2:]
+                else:
+                    line = "%s\n" % raw_line[2:]
+            elif raw_line.startswith(" "):
+                # The line is part of a paragraph.
+                if desc.endswith("\n") or desc == "":
+                    # Skip the leading white space
+                    line = raw_line[1:]
+                else:
+                    line = raw_line
             else:
-                desc += " " + line
+                pkglog.debug("invalid line %s in description for %s:\n%s" % \
+                             (i, pkg.name, pkg.rawDescription))
+            # Use dots for lists
+            line = re.sub(r"^(\s*)(\*|0|o|-) ", ur"\1\u2022 ", line, 1)
+            # Add current line to the description
+            desc += line
         return desc
 
 
commit 7f495be4894225b415291aba9c96fe37e55cc0eb
Author: Igor Pires Soares <igorsoares at gmail.com>
Date:   Sat Aug 30 03:29:43 2008 +0000

    Updated Brazilian Portuguese translation
    
    Transmitted-via: Transifex (translate.fedoraproject.org)

diff --git a/po/pt_BR.po b/po/pt_BR.po
index 2d5b080..426b2bf 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -9,7 +9,7 @@ msgstr ""
 "Project-Id-Version: PackageKit\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2008-08-28 01:24+0000\n"
-"PO-Revision-Date: 2008-08-28 01:05-0300\n"
+"PO-Revision-Date: 2008-08-30 00:28-0300\n"
 "Last-Translator: Igor Pires Soares <igor at projetofedora.org>\n"
 "Language-Team: Brazilian Portuguese <fedora-trans-pt_br at redhat.com>\n"
 "MIME-Version: 1.0\n"
@@ -284,7 +284,7 @@ msgstr "Você precisa especificar o nome do conjunto e os pacotes a serem incluÃ
 
 #: ../client/pk-generate-pack-main.c:117
 msgid "Invalid name for the service pack, Specify a name with .servicepack extension\n"
-msgstr "Nome inválido para o conjunto de atualizações. Especifique um nome com a extensão .servicepack\n"
+msgstr "Nome inválido para o pacote de serviços. Especifique um nome com a extensão .servicepack\n"
 
 #: ../client/pk-generate-pack-main.c:129
 msgid "A pack with the same name already exists, do you want to overwrite it?"
@@ -407,7 +407,7 @@ msgstr "Catálogo do PackageKit"
 
 #: ../data/packagekit-pack.xml.in.h:1
 msgid "PackageKit Service Pack"
-msgstr "Conjunto de Atualizações do PackageKit"
+msgstr "Pacote de serviços do PackageKit"
 
 #: ../src/pk-main.c:83
 msgid "Startup failed due to security policies on this machine."
commit d51cc049ceaa4d868cfe9b1d7065fe20516789dc
Author: Sebastian Heinlein <devel at glatzor.de>
Date:   Fri Aug 29 13:56:45 2008 +0200

    APT: Copy and use the new description formater from python-apt. PackageKit should provide a goot test case.

diff --git a/backends/apt/aptDBUSBackend.py b/backends/apt/aptDBUSBackend.py
index 793c2cf..eddccc0 100755
--- a/backends/apt/aptDBUSBackend.py
+++ b/backends/apt/aptDBUSBackend.py
@@ -600,22 +600,7 @@ class PackageKitAptBackend(PackageKitBaseBackend):
                                "Package %s isn't available" % name)
                 self.Finished(EXIT_FAILED)
                 return
-            #FIXME: should perhaps go to python-apt since we need this in
-            #       several applications
-            desc = pkg.description
-            # Skip the first line - it's a duplicate of the summary
-            i = desc.find('\n')
-            desc = desc[i+1:]
-            # do some regular expression magic on the description
-            # Add a newline before each bullet
-            p = re.compile(r'^(\s|\t)*(\*|0|-)',re.MULTILINE)
-            desc = p.sub(ur'\n\u2022', desc)
-            # replace all newlines by spaces
-            p = re.compile(r'\n', re.MULTILINE)
-            desc = p.sub(" ", desc)
-            # replace all multiple spaces by newlines
-            p = re.compile(r'\s\s+', re.MULTILINE)
-            desc = p.sub('\n', desc)
+            desc = self._get_package_description(pkg)
             #FIXME: We need more fine grained license information!
             candidate = pkg.candidateOrigin
             if candidate != None and  \
@@ -1724,6 +1709,41 @@ class PackageKitAptBackend(PackageKitBaseBackend):
                                                              pkg.name))
             return GROUP_UNKNOWN
 
+    def _get_package_description(self, pkg):
+        """
+        Return the formated long description
+        """
+        if not pkg._lookupRecord():
+            return ""
+        # get the translated description
+        ver = pkg._depcache.GetCandidateVer(pkg._pkg)
+        desc_iter = ver.TranslatedDescription
+        pkg._records.Lookup(desc_iter.FileList.pop(0))
+        desc = ""
+        try:
+            s = unicode(pkg._records.LongDesc,"utf-8")
+        except UnicodeDecodeError,e:
+            s = _("Invalid unicode in description for '%s' (%s). "
+                  "Please report.") % (pkg.name,e)
+        lines = string.split(s, "\n")
+        for i in range(len(lines)):
+            # Skip the first line, since its a duplication of the summary
+            if i == 0: continue
+            line = lines[i].strip()
+            # Replace all empty lines by line breaks
+            if line == ".":
+                desc += "\n"
+                continue
+            # Use dots for lists
+            p = re.compile(r'^(\s|\t)*(\*|0|-)',re.MULTILINE)
+            line = p.sub(ur'\n\u2022', line)
+            # Use line breaks only for abstracts
+            if desc == "" or desc[-1] == "\n":
+                desc += line
+            else:
+                desc += " " + line
+        return desc
+
 
 def sigquit(signum, frame):
     pklog.error("Was killed")
commit cecdc60fa898aa30fac7bcc2304696b5c88b518f
Author: Sebastian Heinlein <devel at glatzor.de>
Date:   Fri Aug 29 13:53:08 2008 +0200

    APT: Fix section to group mapping for non main packages. Furthermore use the correct names for gnome and libs.

diff --git a/backends/apt/aptDBUSBackend.py b/backends/apt/aptDBUSBackend.py
index 6b5fbc3..793c2cf 100755
--- a/backends/apt/aptDBUSBackend.py
+++ b/backends/apt/aptDBUSBackend.py
@@ -1646,7 +1646,7 @@ class PackageKitAptBackend(PackageKitBaseBackend):
         """
         Return the packagekit group corresponding to the package's section
         """
-        section = pkg.section
+        section = pkg.section.split("/")[-1]
         if section == "admin":
             return GROUP_ADMIN_TOOLS
         elif section == "base":
@@ -1665,7 +1665,7 @@ class PackageKitAptBackend(PackageKitBaseBackend):
             return GROUP_SYSTEM
         elif section == "games":
             return GROUP_GAMES
-        elif section == "GNOME":
+        elif section == "gnome":
             return GROUP_DESKTOP_GNOME
         elif section == "graphics":
             return GROUP_GRAPHICS
@@ -1677,7 +1677,7 @@ class PackageKitAptBackend(PackageKitBaseBackend):
             return GROUP_DESKTOP_KDE
         elif section == "libdevel":
             return GROUP_PROGRAMMING
-        elif section == "lib":
+        elif section == "libs":
             return GROUP_SYSTEM
         elif section == "mail":
             return GROUP_INTERNET
@@ -1720,6 +1720,8 @@ class PackageKitAptBackend(PackageKitBaseBackend):
         elif section == "translations":
             return GROUP_LOCALIZATION
         else:
+            pklog.debug("Unkown package section %s of %s" % (pkg.section,
+                                                             pkg.name))
             return GROUP_UNKNOWN
 
 


More information about the PackageKit-commit mailing list