[PackageKit-commit] packagekit: Branch 'master' - 17 commits
Richard Hughes
hughsient at kemper.freedesktop.org
Mon Apr 13 02:45:28 PDT 2009
backends/apt/HACKING | 16
backends/apt/HACKING.apt | 5
backends/apt/Makefile.am | 15
backends/apt/README | 23
backends/apt/README.apt | 23
backends/apt/TODO | 27
backends/apt/TODO.apt | 27
backends/apt/aptBackend.py | 2003 ++++++++++++++++++++++++++++++++++++++++
backends/apt/aptbackend.py | 2003 ----------------------------------------
backends/apt/pk-backend-apt.c | 54 -
backends/apt/pk-backend-apt.py | 28
lib/packagekit-glib/pk-client.c | 37
po/es.po | 109 +-
po/nl.po | 140 +-
po/pl.po | 345 ++----
po/pt.po | 105 +-
po/pt_BR.po | 107 +-
po/ta.po | 100 +
src/pk-transaction.c | 4
19 files changed, 2576 insertions(+), 2595 deletions(-)
New commits:
commit 34e2c6e65c399b0005fff0d443edc102b39ed7ae
Author: nippur <nippur at fedoraproject.org>
Date: Sun Apr 12 10:23:38 2009 +0000
Sending translation for Dutch
diff --git a/po/nl.po b/po/nl.po
index 869a267..256680c 100644
--- a/po/nl.po
+++ b/po/nl.po
@@ -4,8 +4,8 @@ msgid ""
msgstr ""
"Project-Id-Version: packagekit.master.nl\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-04-04 14:07+0000\n"
-"PO-Revision-Date: 2009-04-04 21:57+0200\n"
+"POT-Creation-Date: 2009-04-12 08:05+0000\n"
+"PO-Revision-Date: 2009-04-12 12:21+0200\n"
"Last-Translator: R.E. van der Luit <nippur at fedoraproject.org>\n"
"Language-Team: Dutch <nippur at fedoraproject.org>\n"
"MIME-Version: 1.0\n"
@@ -13,7 +13,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-Language: Dutch\n"
-"X-Generator: KBabel 1.11.4\n"
+"X-Generator: Lokalize 0.3\n"
#. TRANSLATORS: this is an atomic transaction
#: ../client/pk-console.c:234
@@ -290,7 +290,9 @@ msgstr "Het verwijderen van pakketten is afgebroken!"
#: ../client/pk-console.c:941
#, c-format
msgid "This tool could not download the package %s as it could not be found"
-msgstr "Dit programma kon het pakket %s niet downloaden omdat het nergens gevonden kon worden."
+msgstr ""
+"Dit programma kon het pakket %s niet downloaden omdat het nergens gevonden "
+"kon worden."
#. TRANSLATORS: Could not download the packages for some reason. The detailed error follows
#: ../client/pk-console.c:972
@@ -429,64 +431,69 @@ msgstr "Fout:"
msgid "Package description"
msgstr "Pakketomschrijving"
+#. TRANSLATORS: This a message (like a little note that may be of interest) from the transaction
+#: ../client/pk-console.c:1473
+msgid "Message:"
+msgstr "Bericht:"
+
#. TRANSLATORS: This a list files contained in the package
-#: ../client/pk-console.c:1491
+#: ../client/pk-console.c:1501
msgid "Package files"
msgstr "Pakketbestanden"
#. TRANSLATORS: This where the package has no files
-#: ../client/pk-console.c:1499
+#: ../client/pk-console.c:1509
msgid "No files"
msgstr "Geen bestanden"
#. TRANSLATORS: This a request for a GPG key signature from the backend, which the client will prompt for later
-#: ../client/pk-console.c:1522
+#: ../client/pk-console.c:1532
msgid "Repository signature required"
msgstr "Repository signatuur vereist"
#. TRANSLATORS: This a prompt asking the user to import the security key
-#: ../client/pk-console.c:1532
+#: ../client/pk-console.c:1542
msgid "Do you accept this signature?"
msgstr "Accepteert u deze signatuur?"
#. TRANSLATORS: This is where the user declined the security key
-#: ../client/pk-console.c:1536
+#: ../client/pk-console.c:1546
msgid "The signature was not accepted."
msgstr "De signatuur werd niet geaccepteerd"
#. TRANSLATORS: This a request for a EULA
-#: ../client/pk-console.c:1570
+#: ../client/pk-console.c:1580
msgid "End user license agreement required"
msgstr "Eindgebruiker licentie overeenkomst vereist"
#. TRANSLATORS: This a prompt asking the user to agree to the license
-#: ../client/pk-console.c:1577
+#: ../client/pk-console.c:1587
msgid "Do you agree to this license?"
msgstr "Gaat u accoord met deze licentie?"
#. TRANSLATORS: This is where the user declined the license
-#: ../client/pk-console.c:1581
+#: ../client/pk-console.c:1591
msgid "The license was refused."
msgstr "De licentie werd geweigerd."
#. TRANSLATORS: This is when the daemon crashed, and we are up shit creek without a paddle
-#: ../client/pk-console.c:1610
+#: ../client/pk-console.c:1620
msgid "The daemon crashed mid-transaction!"
msgstr "De service is midden in de transactie gecrashed!"
#. TRANSLATORS: This is the header to the --help menu
-#: ../client/pk-console.c:1663
+#: ../client/pk-console.c:1673
msgid "PackageKit Console Interface"
msgstr "PackageKit console-interface"
#. these are commands we can use with pkcon
-#: ../client/pk-console.c:1665
+#: ../client/pk-console.c:1675
msgid "Subcommands:"
msgstr "Subopdrachten:"
#. TRANSLATORS: command line argument, if we should show debugging information
#. TRANSLATORS: if we should show debugging data
-#: ../client/pk-console.c:1757 ../client/pk-generate-pack.c:185
+#: ../client/pk-console.c:1767 ../client/pk-generate-pack.c:185
#: ../client/pk-monitor.c:125
#: ../contrib/command-not-found/pk-command-not-found.c:518
#: ../src/pk-main.c:199
@@ -494,147 +501,149 @@ msgid "Show extra debugging information"
msgstr "Extra debuginformatie tonen"
#. TRANSLATORS: command line argument, just show the version string
-#: ../client/pk-console.c:1760 ../client/pk-monitor.c:127
+#: ../client/pk-console.c:1770 ../client/pk-monitor.c:127
msgid "Show the program version and exit"
msgstr "Programmaversie tonen en sluiten"
#. TRANSLATORS: command line argument, use a filter to narrow down results
-#: ../client/pk-console.c:1763
+#: ../client/pk-console.c:1773
msgid "Set the filter, e.g. installed"
msgstr "Filter instellen, bijvoorbeeld geïnstalleerd"
#. TRANSLATORS: command line argument, work asynchronously
-#: ../client/pk-console.c:1766
+#: ../client/pk-console.c:1776
msgid "Exit without waiting for actions to complete"
msgstr "Afsluiten zonder te wachten tot de transacties zijn afgerond"
#. TRANSLATORS: This is when we could not connect to the system bus, and is fatal
-#: ../client/pk-console.c:1793
+#: ../client/pk-console.c:1803
msgid "This tool could not connect to system DBUS."
msgstr "Er kon geen verbinding worden gelegd met system DBUS"
#. TRANSLATORS: The user specified an incorrect filter
-#: ../client/pk-console.c:1880
+#: ../client/pk-console.c:1894
msgid "The filter specified was invalid"
msgstr "De opgegeven filter was ongeldig"
#. TRANSLATORS: a search type can be name, details, file, etc
-#: ../client/pk-console.c:1898
+#: ../client/pk-console.c:1912
msgid "A search type is required, e.g. name"
msgstr "Een zoektype is verplicht, b.v. naam"
#. TRANSLATORS: the user needs to provide a search term
-#: ../client/pk-console.c:1904 ../client/pk-console.c:1912
-#: ../client/pk-console.c:1920 ../client/pk-console.c:1928
+#: ../client/pk-console.c:1918 ../client/pk-console.c:1926
+#: ../client/pk-console.c:1934 ../client/pk-console.c:1942
msgid "A search term is required"
msgstr "Een zoekterm is vereist"
#. TRANSLATORS: the search type was provided, but invalid
-#: ../client/pk-console.c:1934
+#: ../client/pk-console.c:1948
msgid "Invalid search type"
msgstr "Ongeldig zoektype"
#. TRANSLATORS: the user did not specify what they wanted to install
-#: ../client/pk-console.c:1940
+#: ../client/pk-console.c:1954
msgid "A package name or filename to install is required"
msgstr "Een pakketnaam of bestandsnaam om te installeren is vereist"
#. TRANSLATORS: geeky error, 99.9999% of users won't see this
-#: ../client/pk-console.c:1948
+#: ../client/pk-console.c:1962
msgid "A type, key_id and package_id are required"
msgstr "Er moet een type worden opgegeven, key_id of package_id"
#. TRANSLATORS: the user did not specify what they wanted to remove
-#: ../client/pk-console.c:1956
+#: ../client/pk-console.c:1970
msgid "A package name to remove is required"
msgstr "Een te verwijderen pakketnaam is vereist"
#. TRANSLATORS: the user did not specify anything about what to download or where
-#: ../client/pk-console.c:1963
-msgid "A destination directory and then the package names to download are required"
+#: ../client/pk-console.c:1977
+msgid ""
+"A destination directory and then the package names to download are required"
msgstr "Een doelmap en dan de namen van te downloaden pakketten zijn vereist."
#. TRANSLATORS: the directory does not exist, so we can't continue
-#: ../client/pk-console.c:1969
+#: ../client/pk-console.c:1983
msgid "Directory not found"
msgstr "Map niet gevonden"
#. TRANSLATORS: geeky error, 99.9999% of users won't see this
-#: ../client/pk-console.c:1976
+#: ../client/pk-console.c:1990
msgid "A licence identifier (eula-id) is required"
msgstr "Een licentie indentificatie (eula-id) is vereis"
#. TRANSLATORS: geeky error, 99.9999% of users won't see this
-#: ../client/pk-console.c:1985
+#: ../client/pk-console.c:1999
msgid "A transaction identifier (tid) is required"
msgstr "Een transactie indentificatie (tid) is vereist"
#. TRANSLATORS: The user did not specify a package name
-#: ../client/pk-console.c:2001
+#: ../client/pk-console.c:2015
msgid "A package name to resolve is required"
msgstr "Een pakketnaam om te gebruiken is vereist"
#. TRANSLATORS: The user did not specify a repository (software source) name
-#: ../client/pk-console.c:2009 ../client/pk-console.c:2017
+#: ../client/pk-console.c:2023 ../client/pk-console.c:2031
msgid "A repository name is required"
msgstr "Een naam van een repository is vereist"
#. TRANSLATORS: The user didn't provide any data
-#: ../client/pk-console.c:2025
+#: ../client/pk-console.c:2039
msgid "A repo name, parameter and value are required"
msgstr "Een repo naam, parameter en waarde zijn vereist"
#. TRANSLATORS: The user didn't specify what action to use
-#: ../client/pk-console.c:2038
+#: ../client/pk-console.c:2052
msgid "An action, e.g. 'update-system' is required"
msgstr "Een actie, b.v. 'update-system' is vereist"
#. TRANSLATORS: The user specified an invalid action
-#: ../client/pk-console.c:2044
+#: ../client/pk-console.c:2058
msgid "A correct role is required"
msgstr "Een correcte rol is vereist"
#. TRANSLATORS: we keep a database updated with the time that an action was last executed
-#: ../client/pk-console.c:2050
+#: ../client/pk-console.c:2064
msgid "Failed to get the time since this action was last completed"
-msgstr "Verkrijgen van de tijd tussen laatste actie en deze actie is niet gelukt"
+msgstr ""
+"Verkrijgen van de tijd tussen laatste actie en deze actie is niet gelukt"
#. TRANSLATORS: The user did not provide a package name
#. TRANSLATORS: This is when the user fails to supply the package name
-#: ../client/pk-console.c:2059 ../client/pk-console.c:2070
-#: ../client/pk-console.c:2078 ../client/pk-console.c:2094
-#: ../client/pk-console.c:2102 ../client/pk-generate-pack.c:241
+#: ../client/pk-console.c:2073 ../client/pk-console.c:2084
+#: ../client/pk-console.c:2092 ../client/pk-console.c:2108
+#: ../client/pk-console.c:2116 ../client/pk-generate-pack.c:241
msgid "A package name is required"
msgstr "Een pakketnaam is vereist"
#. TRANSLATORS: each package "provides" certain things, e.g. mime(gstreamer-decoder-mp3), the user didn't specify it
-#: ../client/pk-console.c:2086
+#: ../client/pk-console.c:2100
msgid "A package provide string is required"
msgstr "Een pakket geleverde string is vereist"
#. TRANSLATORS: The user didn't specify a filename to create as a list
-#: ../client/pk-console.c:2110
+#: ../client/pk-console.c:2124
msgid "A list file name to create is required"
msgstr "Een lijstbestandsnaam om aan te maken is vereist"
#. TRANSLATORS: The user didn't specify a filename to open as a list
-#: ../client/pk-console.c:2119 ../client/pk-console.c:2128
+#: ../client/pk-console.c:2133 ../client/pk-console.c:2142
msgid "A list file to open is required"
msgstr "Een lijstbestand om te open is vereist"
#. TRANSLATORS: The user tried to use an unsupported option on the command line
-#: ../client/pk-console.c:2181
+#: ../client/pk-console.c:2195
#, c-format
msgid "Option '%s' is not supported"
msgstr "Optie '%s' wordt niet ondersteund"
#. TRANSLATORS: User does not have permission to do this
-#: ../client/pk-console.c:2194
+#: ../client/pk-console.c:2208
msgid "Incorrect privileges for this operation"
msgstr "Onjuiste privileges voor deze operatie"
#. TRANSLATORS: Generic failure of what they asked to do
-#: ../client/pk-console.c:2197
+#: ../client/pk-console.c:2211
msgid "Command failed"
msgstr "Opdracht mislukt"
@@ -656,12 +665,16 @@ msgstr "Afhankelijkheden aan het downloaden"
#. TRANSLATORS: we can exclude certain packages (glibc) when we know they'll exist on the target
#: ../client/pk-generate-pack.c:188
msgid "Set the file name of dependencies to be excluded"
-msgstr "Zet de bestandsnamen van afhankelijkheden die moeten worden uitgesloten"
+msgstr ""
+"Zet de bestandsnamen van afhankelijkheden die moeten worden uitgesloten"
#. TRANSLATORS: the output location
#: ../client/pk-generate-pack.c:191
-msgid "The output file or directory (the current directory is used if ommitted)"
-msgstr "Het doelbestand of map (huidige map wordt gebruikt als dit niet wordt opgegeven)"
+msgid ""
+"The output file or directory (the current directory is used if ommitted)"
+msgstr ""
+"Het doelbestand of map (huidige map wordt gebruikt als dit niet wordt "
+"opgegeven)"
#. TRANSLATORS: put a list of packages in the pack
#: ../client/pk-generate-pack.c:194
@@ -697,7 +710,8 @@ msgstr "De package manager kan dit type operatie niet uitvoeren."
#. TRANSLATORS: the user specified an absolute path, but didn't get the extension correct
#: ../client/pk-generate-pack.c:285
msgid "If specifying a file, the service pack name must end with"
-msgstr "Bij het specificeren van een bestand moet de servicepacknaam eindigen met"
+msgstr ""
+"Bij het specificeren van een bestand moet de servicepacknaam eindigen met"
#. TRANSLATORS: This is when file already exists
#: ../client/pk-generate-pack.c:301
@@ -917,18 +931,23 @@ msgid "Authentication is required to accept a EULA"
msgstr "Authenticatie is vereist om een EULA te accepteren"
#: ../policy/org.freedesktop.packagekit.policy.in.h:3
-msgid "Authentication is required to cancel a task that was not started by yourself"
-msgstr "Athenticatie is vereist om een taak af te breken die niet door u is gestart"
+msgid ""
+"Authentication is required to cancel a task that was not started by yourself"
+msgstr ""
+"Athenticatie is vereist om een taak af te breken die niet door u is gestart"
#: ../policy/org.freedesktop.packagekit.policy.in.h:4
msgid "Authentication is required to change software source parameters"
-msgstr "Athenticatie is vereist om de parameters van de softwarebronnen te wijzigen"
+msgstr ""
+"Athenticatie is vereist om de parameters van de softwarebronnen te wijzigen"
#: ../policy/org.freedesktop.packagekit.policy.in.h:5
msgid ""
"Authentication is required to consider a key used for signing packages as "
"trusted"
-msgstr "Authenticatie is vereist om de sleutel te overleggen die gebruikt wordt om een pakket als vertrouwt te tekenen "
+msgstr ""
+"Authenticatie is vereist om de sleutel te overleggen die gebruikt wordt om "
+"een pakket als vertrouwt te tekenen "
#: ../policy/org.freedesktop.packagekit.policy.in.h:6
msgid "Authentication is required to install a signed package"
@@ -954,7 +973,9 @@ msgstr "Authenticatie is vereist om een transactie terug te draaien"
msgid ""
"Authentication is required to set the network proxy used for downloading "
"packages"
-msgstr "Authenticatie is vereist om de netwerkproxy die gebruikt wordt om pakketten te installeren in te stellen "
+msgstr ""
+"Authenticatie is vereist om de netwerkproxy die gebruikt wordt om pakketten "
+"te installeren in te stellen "
#: ../policy/org.freedesktop.packagekit.policy.in.h:12
msgid "Authentication is required to update packages"
@@ -1013,7 +1034,8 @@ msgstr "Dit kan twee redenen hebben:"
#. TRANSLATORS: only allowed to be owned by root
#: ../src/pk-main.c:91
msgid "The correct user is not launching the executable (usually root)"
-msgstr "Het programma wordt niet door de correcte gebruiker gestart (gewoonlijk root)"
+msgstr ""
+"Het programma wordt niet door de correcte gebruiker gestart (gewoonlijk root)"
#. TRANSLATORS: or we are installed in a prefix
#: ../src/pk-main.c:93
commit 44e04b767b47f75d31ca2afdbfcd7f860d1ccd7d
Merge: 18554be... bb7f7c3...
Author: Sebastian Heinlein <devel at glatzor.de>
Date: Sun Apr 12 11:39:39 2009 +0200
Merge branch 'master' of git+ssh://glatzor@git.packagekit.org/srv/git/PackageKit
commit 18554be93f1c244c5fa0e963ec2b825637a5f3e6
Author: Sebastian Heinlein <devel at glatzor.de>
Date: Sun Apr 12 11:36:59 2009 +0200
APT: Trivial ship the README and TODO
diff --git a/backends/apt/HACKING.apt b/backends/apt/HACKING.apt
index 15894dc..239700f 100644
--- a/backends/apt/HACKING.apt
+++ b/backends/apt/HACKING.apt
@@ -1,16 +1,5 @@
-The backend can be tested by running it as root from the source code
-repository. Use the -t/--takeover command line switch to kill a perhaps already
-running apt backend before:
+The backend can be tested by running it as root from the source code and using
- sudo python aptDBUSBackend.py --debug --takeover
+ sudo python aptBackend.py --debug
Use the --help command line switch for more details.
-
-Some of the development takes place in python-apt. Since this means using
-not yet released code the corresponding work is done in PackageKit's
-apt-consolidate branch and in python-apt's consolidate branch.
-
-bzr branch lp:~glatzor/python-apt/consolidate
-
-Just place a symlink to the apt directory of the consolidate branch working
-directory to the apt backend directory.
diff --git a/backends/apt/Makefile.am b/backends/apt/Makefile.am
index 29500d4..7bb3d5e 100644
--- a/backends/apt/Makefile.am
+++ b/backends/apt/Makefile.am
@@ -20,6 +20,8 @@ sbin_SCRIPTS = \
EXTRA_DIST = \
20packagekit \
update-packagekit-app-data \
+ README.apt \
+ TODO.apt \
$(NULL)
install-data-hook:
commit bb7f7c328159f37cc518e298891664d68d483cab
Author: ifelix <ifelix at fedoraproject.org>
Date: Sat Apr 11 23:46:09 2009 +0000
Sending translation for Tamil
diff --git a/po/ta.po b/po/ta.po
index 3834e6c..5edb3b0 100644
--- a/po/ta.po
+++ b/po/ta.po
@@ -1,14 +1,14 @@
-# translation of packagekit.master.PackageKit.po to Tamil
+# translation of packagekit.master.ta.po to Tamil
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
#
# I. Felix <ifelix at redhat.com>, 2009.
msgid ""
msgstr ""
-"Project-Id-Version: packagekit.master.PackageKit\n"
+"Project-Id-Version: packagekit.master.ta\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-04-03 08:09+0000\n"
-"PO-Revision-Date: 2009-04-08 06:40+0530\n"
+"POT-Creation-Date: 2009-04-11 19:05+0000\n"
+"PO-Revision-Date: 2009-04-12 05:14+0530\n"
"Last-Translator: I. Felix <ifelix at redhat.com>\n"
"Language-Team: Tamil <fedora-trans-ta at redhat.com>\n"
"MIME-Version: 1.0\n"
@@ -21,6 +21,7 @@ msgstr ""
"\n"
"\n"
"\n"
+"\n"
#. TRANSLATORS: this is an atomic transaction
#: ../client/pk-console.c:234
@@ -436,64 +437,69 @@ msgstr "பிழà¯:"
msgid "Package description"
msgstr "தà¯à®à¯à®ªà¯à®ªà¯ விளà®à¯à®à®®à¯"
+#. TRANSLATORS: This a message (like a little note that may be of interest) from the transaction
+#: ../client/pk-console.c:1473
+msgid "Message:"
+msgstr "à®à¯à®¯à¯à®¤à®¿:"
+
#. TRANSLATORS: This a list files contained in the package
-#: ../client/pk-console.c:1491
+#: ../client/pk-console.c:1501
msgid "Package files"
msgstr "தà¯à®à¯à®ªà¯à®ªà¯ à®à¯à®ªà¯à®ªà¯à®à®³à¯"
#. TRANSLATORS: This where the package has no files
-#: ../client/pk-console.c:1499
+#: ../client/pk-console.c:1509
msgid "No files"
msgstr "à®à¯à®ªà¯à®ªà¯à®à®³à¯ à®à®²à¯à®²à¯"
#. TRANSLATORS: This a request for a GPG key signature from the backend, which the client will prompt for later
-#: ../client/pk-console.c:1522
+#: ../client/pk-console.c:1532
msgid "Repository signature required"
msgstr "நமà¯à®ªà®¿à®à¯à®à¯à®¯à®¾à®© à®à¯à®¯à¯à®´à¯à®¤à¯à®¤à¯ தà¯à®µà¯à®ªà¯à®ªà®à¯à®à®¿à®±à®¤à¯"
#. TRANSLATORS: This a prompt asking the user to import the security key
-#: ../client/pk-console.c:1532
+#: ../client/pk-console.c:1542
msgid "Do you accept this signature?"
msgstr "நà¯à®à¯à®à®³à¯ à®à®¨à¯à®¤ à®à¯à®¯à¯à®®à¯à®¤à¯à®¤à¯ à®à®±à¯à®±à¯à®à¯ à®à¯à®³à¯à®à®¿à®±à¯à®°à¯à®à®³à®¾ ?"
#. TRANSLATORS: This is where the user declined the security key
-#: ../client/pk-console.c:1536
+#: ../client/pk-console.c:1546
msgid "The signature was not accepted."
msgstr "à®à¯à®¯à¯à®´à¯à®¤à¯à®¤à¯ à®à®±à¯à®±à¯à®à¯ à®à¯à®³à¯à®³à®ªà¯à®ªà®à®µà®¿à®²à¯à®²à¯."
#. TRANSLATORS: This a request for a EULA
-#: ../client/pk-console.c:1570
+#: ../client/pk-console.c:1580
msgid "End user license agreement required"
msgstr "à®à®±à¯à®¤à®¿à®¯à®¾à®© பயனரின௠à®à®°à®¿à®® à®à®ªà¯à®ªà®¨à¯à®¤à®®à¯ தà¯à®µà¯à®ªà¯à®ªà®à¯à®à®¿à®±à®¤à¯"
#. TRANSLATORS: This a prompt asking the user to agree to the license
-#: ../client/pk-console.c:1577
+#: ../client/pk-console.c:1587
msgid "Do you agree to this license?"
msgstr "à®à®¨à¯à®¤ à®à®°à®¿à®®à®¤à¯à®¤à¯ நà¯à®à¯à®à®³à¯ à®à®±à¯à®±à¯ à®à¯à®³à¯à®à®¿à®±à¯à®°à¯à®à®³à®¾?"
#. TRANSLATORS: This is where the user declined the license
-#: ../client/pk-console.c:1581
+#: ../client/pk-console.c:1591
msgid "The license was refused."
msgstr "à®à®°à®¿à®®à®®à¯ மறà¯à®à¯à®à®ªà¯à®ªà®à¯à®à®¤à¯."
#. TRANSLATORS: This is when the daemon crashed, and we are up shit creek without a paddle
-#: ../client/pk-console.c:1610
+#: ../client/pk-console.c:1620
msgid "The daemon crashed mid-transaction!"
msgstr "மதà¯à®¤à®¿à®¯ பரிமாறà¯à®±à®¤à¯à®¤à®¿à®©à¯ பà¯à®¤à¯ à®à¯à®®à¯à®©à¯ நà¯à®±à¯à®à¯à®à®ªà¯à®ªà®à¯à®à®¤à¯!"
#. TRANSLATORS: This is the header to the --help menu
-#: ../client/pk-console.c:1663
+#: ../client/pk-console.c:1673
msgid "PackageKit Console Interface"
msgstr "PackageKit பணிய஠மà¯à®à®ªà¯à®ªà¯"
#. these are commands we can use with pkcon
-#: ../client/pk-console.c:1665
+#: ../client/pk-console.c:1675
msgid "Subcommands:"
msgstr "தà¯à®£à¯à®à¯à®à®à¯à®à®³à¯à®à®³à¯:"
#. TRANSLATORS: command line argument, if we should show debugging information
#. TRANSLATORS: if we should show debugging data
-#: ../client/pk-console.c:1757 ../client/pk-generate-pack.c:185
+#: ../client/pk-console.c:1767 ../client/pk-generate-pack.c:185
#: ../client/pk-monitor.c:125
#: ../contrib/command-not-found/pk-command-not-found.c:518
#: ../src/pk-main.c:199
@@ -501,147 +507,147 @@ msgid "Show extra debugging information"
msgstr "à®à¯à®à¯à®¤à®²à¯ பிழà¯à®¤à®¿à®°à¯à®¤à¯à®¤ தà®à®µà®²à¯à®à¯ à®à®¾à®à¯à®à¯"
#. TRANSLATORS: command line argument, just show the version string
-#: ../client/pk-console.c:1760 ../client/pk-monitor.c:127
+#: ../client/pk-console.c:1770 ../client/pk-monitor.c:127
msgid "Show the program version and exit"
msgstr "நிà®à®´à¯à®à¯à®à®¿ பதிபà¯à®ªà¯ மறà¯à®±à¯à®®à¯ வà¯à®³à®¿à®¯à¯à®±à¯à®µà®¤à¯à®à¯ à®à®¾à®à¯à®à¯"
#. TRANSLATORS: command line argument, use a filter to narrow down results
-#: ../client/pk-console.c:1763
+#: ../client/pk-console.c:1773
msgid "Set the filter, e.g. installed"
msgstr "வà®à¯à®ªà¯à®ªà®¿à®©à¯"
#. TRANSLATORS: command line argument, work asynchronously
-#: ../client/pk-console.c:1766
+#: ../client/pk-console.c:1776
msgid "Exit without waiting for actions to complete"
msgstr "à®à¯à®¯à®²à¯ à®®à¯à®à®¿à®µà®à¯ வர௠à®à®¾à®¤à¯à®¤à®¿à®°à¯à®à¯à®à®¾à®®à®²à¯ வà¯à®³à®¿à®¯à¯à®±à¯"
#. TRANSLATORS: This is when we could not connect to the system bus, and is fatal
-#: ../client/pk-console.c:1793
+#: ../client/pk-console.c:1803
msgid "This tool could not connect to system DBUS."
msgstr "à®à®¨à¯à®¤à®à¯ à®à®°à¯à®µà®¿à®¯à®¾à®²à¯ à®à®£à®¿à®©à®¿ DBUSà® à®à®£à¯à®à¯à® à®®à¯à®à®¿à®¯à®¾à®¤à¯."
#. TRANSLATORS: The user specified an incorrect filter
-#: ../client/pk-console.c:1880
+#: ../client/pk-console.c:1894
msgid "The filter specified was invalid"
msgstr "வà®à®¿à®ªà¯à®ªà®¿ à®à¯à®±à®¿à®ªà¯à®ªà®¿à®à¯à®µà®¤à¯ தவறானதà¯"
#. TRANSLATORS: a search type can be name, details, file, etc
-#: ../client/pk-console.c:1898
+#: ../client/pk-console.c:1912
msgid "A search type is required, e.g. name"
msgstr "à®à®°à¯ தà¯à®à¯à®®à¯ வà®à¯ தà¯à®µà¯à®ªà¯à®ªà®à¯à®à®¿à®±à®¤à¯, à®.à®à®¾. பà¯à®¯à®°à¯"
#. TRANSLATORS: the user needs to provide a search term
-#: ../client/pk-console.c:1904 ../client/pk-console.c:1912
-#: ../client/pk-console.c:1920 ../client/pk-console.c:1928
+#: ../client/pk-console.c:1918 ../client/pk-console.c:1926
+#: ../client/pk-console.c:1934 ../client/pk-console.c:1942
msgid "A search term is required"
msgstr "à®à®°à¯ தà¯à®à¯à®®à¯ à®à¯à®²à¯ தà¯à®µà¯à®ªà¯à®ªà®à¯à®à®¿à®±à®¤à¯"
#. TRANSLATORS: the search type was provided, but invalid
-#: ../client/pk-console.c:1934
+#: ../client/pk-console.c:1948
msgid "Invalid search type"
msgstr "தவறான தà¯à®à¯à®®à¯ வà®à¯"
#. TRANSLATORS: the user did not specify what they wanted to install
-#: ../client/pk-console.c:1940
+#: ../client/pk-console.c:1954
msgid "A package name or filename to install is required"
msgstr "à®à®°à¯ தà¯à®à¯à®ªà¯à®ªà¯ பà¯à®¯à®°à¯ à®
லà¯à®²à®¤à¯ à®à¯à®ªà¯à®ªà¯ பà¯à®¯à®°à¯ நறà¯à®µà¯à®µà®¤à®±à¯à®à¯ தà¯à®µà¯à®ªà¯à®ªà®à¯à®à®¿à®±à®¤à¯"
#. TRANSLATORS: geeky error, 99.9999% of users won't see this
-#: ../client/pk-console.c:1948
+#: ../client/pk-console.c:1962
msgid "A type, key_id and package_id are required"
msgstr "à®à®°à¯ வà®à¯, விà®à¯_à®à®à®¿ மறà¯à®±à¯à®®à¯ தà¯à®à¯à®ªà¯à®ªà¯_à®à®à®¿ தà¯à®µà¯à®ªà¯à®ªà®à¯à®à®¿à®±à®¤à¯"
#. TRANSLATORS: the user did not specify what they wanted to remove
-#: ../client/pk-console.c:1956
+#: ../client/pk-console.c:1970
msgid "A package name to remove is required"
msgstr "நà¯à®à¯à®à¯à®µà®¤à®±à¯à®à¯ à®à®°à¯ தà¯à®à¯à®ªà¯à®ªà¯ பà¯à®¯à®°à¯ தà¯à®µà¯à®ªà¯à®ªà®à¯à®à®¿à®±à®¤à¯"
#. TRANSLATORS: the user did not specify anything about what to download or where
-#: ../client/pk-console.c:1963
+#: ../client/pk-console.c:1977
msgid "A destination directory and then the package names to download are required"
msgstr "à®à®°à¯ à®à®²à®à¯à®à¯ à®
à®à¯à®µà¯ மறà¯à®±à¯à®®à¯ தà¯à®à¯à®ªà¯à®ªà¯ பà¯à®¯à®°à¯à®à®³à¯ பதிவிறà®à¯à® தà¯à®µà¯à®ªà¯à®ªà®à¯à®à®¿à®±à®¤à¯"
#. TRANSLATORS: the directory does not exist, so we can't continue
-#: ../client/pk-console.c:1969
+#: ../client/pk-console.c:1983
msgid "Directory not found"
msgstr "à®
à®à¯à®µà¯ à®à®¾à®£à®ªà¯à®ªà®à®µà®¿à®²à¯à®²à¯"
#. TRANSLATORS: geeky error, 99.9999% of users won't see this
-#: ../client/pk-console.c:1976
+#: ../client/pk-console.c:1990
msgid "A licence identifier (eula-id) is required"
msgstr "à®à®°à¯ à®à®°à®¿à®®à®®à¯ à®à®à¯à®¤à¯à®¤à¯à®à®¾à®à¯à®à¯à®ªà®µà®°à¯ (eula-id) தà¯à®µà¯à®ªà¯à®ªà®à¯à®à®¿à®±à®¤à¯"
#. TRANSLATORS: geeky error, 99.9999% of users won't see this
-#: ../client/pk-console.c:1985
+#: ../client/pk-console.c:1999
msgid "A transaction identifier (tid) is required"
msgstr "பரிமாறà¯à®± à®à®£à¯à®à¯à®ªà®¿à®à®¿à®ªà¯à®ªà®¾à®³à®°à¯ (tid) தà¯à®µà¯à®ªà¯à®ªà®à¯à®à®¿à®±à®¤à¯"
#. TRANSLATORS: The user did not specify a package name
-#: ../client/pk-console.c:2001
+#: ../client/pk-console.c:2015
msgid "A package name to resolve is required"
msgstr "தà¯à®à¯à®ªà¯à®ªà¯ பà¯à®¯à®°à¯ மறà¯à®¤à¯à®°à¯à®µà¯à®à¯à®à¯ தà¯à®µà¯à®ªà¯à®ªà®à¯à®à®¿à®±à®¤à¯"
#. TRANSLATORS: The user did not specify a repository (software source) name
-#: ../client/pk-console.c:2009 ../client/pk-console.c:2017
+#: ../client/pk-console.c:2023 ../client/pk-console.c:2031
msgid "A repository name is required"
msgstr "நமà¯à®ªà®à®®à®¾à®© à®à®°à¯ பà¯à®¯à®°à¯ தà¯à®µà¯à®ªà¯à®ªà®à¯à®à®¿à®±à®¤à¯"
#. TRANSLATORS: The user didn't provide any data
-#: ../client/pk-console.c:2025
+#: ../client/pk-console.c:2039
msgid "A repo name, parameter and value are required"
msgstr "à®à®°à¯ à®°à¯à®ªà¯ பà¯à®¨à®°à¯, à®
ளவà¯à®°à¯ மறà¯à®±à¯à®®à¯ மதிபà¯à®ªà¯ தà¯à®µà¯à®ªà¯à®ªà®à¯à®à®¿à®±à®¤à¯"
#. TRANSLATORS: The user didn't specify what action to use
-#: ../client/pk-console.c:2038
+#: ../client/pk-console.c:2052
msgid "An action, e.g. 'update-system' is required"
msgstr "à®à¯à®¯à®²à¯à®à¯à®à¯, à®.à®à®¾. 'à®®à¯à®®à¯à®ªà®à¯à®¤à¯à®¤à®ªà¯à®ªà®à¯à® à®à®£à®¿à®©à®¿' தà¯à®µà¯à®ªà¯à®ªà®à¯à®à®¿à®±à®¤à¯"
#. TRANSLATORS: The user specified an invalid action
-#: ../client/pk-console.c:2044
+#: ../client/pk-console.c:2058
msgid "A correct role is required"
msgstr "à®à®°à¯ à®à®°à®¿à®¯à®¾à®© திரà¯à®ªà¯à®ªà®®à¯ தà¯à®µà¯à®ªà¯à®ªà®à¯à®à®¿à®±à®¤à¯"
#. TRANSLATORS: we keep a database updated with the time that an action was last executed
-#: ../client/pk-console.c:2050
+#: ../client/pk-console.c:2064
msgid "Failed to get the time since this action was last completed"
msgstr "à®à®¨à¯à®¤ à®à¯à®¯à®²à¯ à®à®à¯à®à®¿à®¯à®¾à® à®®à¯à®à®¿à®µà®à¯à®¯à¯à®®à¯ வர௠நà¯à®°à®¤à¯à®¤à¯ பà¯à®±à¯à®±à®¿à®°à¯à®ªà¯à®ªà®¤à®¿à®²à¯ தà¯à®²à¯à®µà®¿"
#. TRANSLATORS: The user did not provide a package name
#. TRANSLATORS: This is when the user fails to supply the package name
-#: ../client/pk-console.c:2059 ../client/pk-console.c:2070
-#: ../client/pk-console.c:2078 ../client/pk-console.c:2094
-#: ../client/pk-console.c:2102 ../client/pk-generate-pack.c:241
+#: ../client/pk-console.c:2073 ../client/pk-console.c:2084
+#: ../client/pk-console.c:2092 ../client/pk-console.c:2108
+#: ../client/pk-console.c:2116 ../client/pk-generate-pack.c:241
msgid "A package name is required"
msgstr "à®à®°à¯ தà¯à®à¯à®ªà¯à®ªà¯ பà¯à®¯à®°à¯ தà¯à®µà¯à®ªà¯à®ªà®à¯à®à®¿à®±à®¤à¯"
#. TRANSLATORS: each package "provides" certain things, e.g. mime(gstreamer-decoder-mp3), the user didn't specify it
-#: ../client/pk-console.c:2086
+#: ../client/pk-console.c:2100
msgid "A package provide string is required"
msgstr "à®à®°à¯ தà¯à®à¯à®ªà¯à®ªà®¾à®²à¯ வழà®à¯à®à®ªà¯à®ªà®à¯à®®à¯ à®à®°à®®à¯ தà¯à®µà¯à®ªà¯à®ªà®à¯à®à®¿à®±à®¤à¯"
#. TRANSLATORS: The user didn't specify a filename to create as a list
-#: ../client/pk-console.c:2110
+#: ../client/pk-console.c:2124
msgid "A list file name to create is required"
msgstr "à®à®°à¯ பà®à¯à®à®¿à®¯à®²à¯ à®à¯à®ªà¯à®ªà¯ பà¯à®¯à®°à¯ à®à®°à¯à®µà®¾à®à¯à®à¯à®µà®¤à¯ தà¯à®µà¯à®ªà¯à®ªà®à¯à®à®¿à®±à®¤à¯"
#. TRANSLATORS: The user didn't specify a filename to open as a list
-#: ../client/pk-console.c:2119 ../client/pk-console.c:2128
+#: ../client/pk-console.c:2133 ../client/pk-console.c:2142
msgid "A list file to open is required"
msgstr "à®à®°à¯ பà®à¯à®à®¿à®¯à®²à¯ à®à¯à®ªà¯à®ªà®¿à®©à¯ திறபà¯à®ªà®¤à¯ தà¯à®µà¯à®ªà¯à®ªà®à¯à®à®¿à®±à®¤à¯"
#. TRANSLATORS: The user tried to use an unsupported option on the command line
-#: ../client/pk-console.c:2181
+#: ../client/pk-console.c:2195
#, c-format
msgid "Option '%s' is not supported"
msgstr " '%s' விரà¯à®ªà¯à®ªà®®à¯ தà¯à®£à¯à®ªà¯à®°à®¿à®¯à®µà®¿à®²à¯à®²à¯"
#. TRANSLATORS: User does not have permission to do this
-#: ../client/pk-console.c:2194
+#: ../client/pk-console.c:2208
msgid "Incorrect privileges for this operation"
msgstr "à®à®¨à¯à®¤ à®à¯à®¯à®²à¯à®ªà®¾à®à¯à®à¯à®à¯ தவறான à®®à¯à®©à¯à®©à¯à®°à®¿à®®à¯à®à®³à¯"
#. TRANSLATORS: Generic failure of what they asked to do
-#: ../client/pk-console.c:2197
+#: ../client/pk-console.c:2211
msgid "Command failed"
msgstr "à®à®à¯à®à®³à¯ தà¯à®²à¯à®µà®¿à®¯à¯à®±à¯à®±à®¤à¯"
commit ec73154bd654317e8b7a763ad13cef6a0b5c1744
Merge: ae90f7f... 4f6992f...
Author: Sebastian Heinlein <devel at glatzor.de>
Date: Sat Apr 11 22:12:04 2009 +0200
Merge branch 'master' of git+ssh://glatzor@git.packagekit.org/srv/git/PackageKit
commit 4f6992f0e3284371daf01eaabfefe8cc7ad81b01
Author: igor <igor at fedoraproject.org>
Date: Fri Apr 10 22:27:07 2009 +0000
Sending translation for Brazilian Portuguese
diff --git a/po/pt_BR.po b/po/pt_BR.po
index 8d24aad..fa357c8 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -8,8 +8,8 @@ msgid ""
msgstr ""
"Project-Id-Version: PackageKit\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-03-27 02:07+0000\n"
-"PO-Revision-Date: 2009-03-27 00:13-0300\n"
+"POT-Creation-Date: 2009-04-10 19:04+0000\n"
+"PO-Revision-Date: 2009-04-10 19:24-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"
@@ -449,64 +449,69 @@ msgstr "Erro:"
msgid "Package description"
msgstr "Descrição do pacote"
+#. TRANSLATORS: This a message (like a little note that may be of interest) from the transaction
+#: ../client/pk-console.c:1473
+msgid "Message:"
+msgstr "Mensagem:"
+
#. TRANSLATORS: This a list files contained in the package
-#: ../client/pk-console.c:1491
+#: ../client/pk-console.c:1501
msgid "Package files"
msgstr "Arquivos do pacote"
#. TRANSLATORS: This where the package has no files
-#: ../client/pk-console.c:1499
+#: ../client/pk-console.c:1509
msgid "No files"
msgstr "Nenhum arquivo"
#. TRANSLATORS: This a request for a GPG key signature from the backend, which the client will prompt for later
-#: ../client/pk-console.c:1522
+#: ../client/pk-console.c:1532
msgid "Repository signature required"
msgstr "A assinatura do repositório é necessária"
#. TRANSLATORS: This a prompt asking the user to import the security key
-#: ../client/pk-console.c:1532
+#: ../client/pk-console.c:1542
msgid "Do you accept this signature?"
msgstr "Você aceita essa assinatura?"
#. TRANSLATORS: This is where the user declined the security key
-#: ../client/pk-console.c:1536
+#: ../client/pk-console.c:1546
msgid "The signature was not accepted."
msgstr "A assinatura não foi aceita."
#. TRANSLATORS: This a request for a EULA
-#: ../client/pk-console.c:1570
+#: ../client/pk-console.c:1580
msgid "End user license agreement required"
msgstr "à necessário um contrato de licença para o usuário final"
#. TRANSLATORS: This a prompt asking the user to agree to the license
-#: ../client/pk-console.c:1577
+#: ../client/pk-console.c:1587
msgid "Do you agree to this license?"
msgstr "Você concorda com a licença?"
#. TRANSLATORS: This is where the user declined the license
-#: ../client/pk-console.c:1581
+#: ../client/pk-console.c:1591
msgid "The license was refused."
msgstr "A licença foi recusada."
#. TRANSLATORS: This is when the daemon crashed, and we are up shit creek without a paddle
-#: ../client/pk-console.c:1610
+#: ../client/pk-console.c:1620
msgid "The daemon crashed mid-transaction!"
msgstr "O daemon travou no meio da transação!"
#. TRANSLATORS: This is the header to the --help menu
-#: ../client/pk-console.c:1663
+#: ../client/pk-console.c:1673
msgid "PackageKit Console Interface"
msgstr "Interface em Console do PackageKit"
#. these are commands we can use with pkcon
-#: ../client/pk-console.c:1665
+#: ../client/pk-console.c:1675
msgid "Subcommands:"
msgstr "Subcomandos:"
#. TRANSLATORS: command line argument, if we should show debugging information
#. TRANSLATORS: if we should show debugging data
-#: ../client/pk-console.c:1757
+#: ../client/pk-console.c:1767
#: ../client/pk-generate-pack.c:185
#: ../client/pk-monitor.c:125
#: ../contrib/command-not-found/pk-command-not-found.c:518
@@ -515,155 +520,155 @@ msgid "Show extra debugging information"
msgstr "Mostrar informações extras de depuração"
#. TRANSLATORS: command line argument, just show the version string
-#: ../client/pk-console.c:1760
+#: ../client/pk-console.c:1770
#: ../client/pk-monitor.c:127
msgid "Show the program version and exit"
msgstr "Mostrar a versão do programa e sair"
#. TRANSLATORS: command line argument, use a filter to narrow down results
-#: ../client/pk-console.c:1763
+#: ../client/pk-console.c:1773
msgid "Set the filter, e.g. installed"
msgstr "Definir o filtro, p. ex.: instalados"
#. TRANSLATORS: command line argument, work asynchronously
-#: ../client/pk-console.c:1766
+#: ../client/pk-console.c:1776
msgid "Exit without waiting for actions to complete"
msgstr "Sair sem esperar pelo término das ações"
#. TRANSLATORS: This is when we could not connect to the system bus, and is fatal
-#: ../client/pk-console.c:1793
+#: ../client/pk-console.c:1803
msgid "This tool could not connect to system DBUS."
msgstr "Esta ferramenta não pôde conectar ao DBUS do sistema."
#. TRANSLATORS: The user specified an incorrect filter
-#: ../client/pk-console.c:1880
+#: ../client/pk-console.c:1894
msgid "The filter specified was invalid"
msgstr "O filtro especificado era inválido"
#. TRANSLATORS: a search type can be name, details, file, etc
-#: ../client/pk-console.c:1898
+#: ../client/pk-console.c:1912
msgid "A search type is required, e.g. name"
msgstr "Um tipo de pesquisa é requerido, p. ex. nome"
#. TRANSLATORS: the user needs to provide a search term
-#: ../client/pk-console.c:1904
-#: ../client/pk-console.c:1912
-#: ../client/pk-console.c:1920
-#: ../client/pk-console.c:1928
+#: ../client/pk-console.c:1918
+#: ../client/pk-console.c:1926
+#: ../client/pk-console.c:1934
+#: ../client/pk-console.c:1942
msgid "A search term is required"
msgstr "Um termo de pesquisa é requerido"
#. TRANSLATORS: the search type was provided, but invalid
-#: ../client/pk-console.c:1934
+#: ../client/pk-console.c:1948
msgid "Invalid search type"
msgstr "Tipo de pesquisa inválido"
#. TRANSLATORS: the user did not specify what they wanted to install
-#: ../client/pk-console.c:1940
+#: ../client/pk-console.c:1954
msgid "A package name or filename to install is required"
msgstr "O nome do pacote ou arquivo é requerido"
#. TRANSLATORS: geeky error, 99.9999% of users won't see this
-#: ../client/pk-console.c:1948
+#: ../client/pk-console.c:1962
msgid "A type, key_id and package_id are required"
msgstr "Um tipo, key_id e package_id são requeridos"
#. TRANSLATORS: the user did not specify what they wanted to remove
-#: ../client/pk-console.c:1956
+#: ../client/pk-console.c:1970
msgid "A package name to remove is required"
msgstr "O nome do pacote para remoção é requerido"
#. TRANSLATORS: the user did not specify anything about what to download or where
-#: ../client/pk-console.c:1963
+#: ../client/pk-console.c:1977
msgid "A destination directory and then the package names to download are required"
msgstr "O diretório de destino seguido dos nomes dos pacotes a serem baixados é requerido"
#. TRANSLATORS: the directory does not exist, so we can't continue
-#: ../client/pk-console.c:1969
+#: ../client/pk-console.c:1983
msgid "Directory not found"
msgstr "Diretório não encontrado"
#. TRANSLATORS: geeky error, 99.9999% of users won't see this
-#: ../client/pk-console.c:1976
+#: ../client/pk-console.c:1990
msgid "A licence identifier (eula-id) is required"
msgstr "Um identificador de licença (eula-id) é requerido"
#. TRANSLATORS: geeky error, 99.9999% of users won't see this
-#: ../client/pk-console.c:1985
+#: ../client/pk-console.c:1999
msgid "A transaction identifier (tid) is required"
msgstr "Um identificador de transação (tid) é requerido"
#. TRANSLATORS: The user did not specify a package name
-#: ../client/pk-console.c:2001
+#: ../client/pk-console.c:2015
msgid "A package name to resolve is required"
msgstr "O nome de pacote a ser analisado é requerido"
#. TRANSLATORS: The user did not specify a repository (software source) name
-#: ../client/pk-console.c:2009
-#: ../client/pk-console.c:2017
+#: ../client/pk-console.c:2023
+#: ../client/pk-console.c:2031
msgid "A repository name is required"
msgstr "O nome do repositório é requerido"
#. TRANSLATORS: The user didn't provide any data
-#: ../client/pk-console.c:2025
+#: ../client/pk-console.c:2039
msgid "A repo name, parameter and value are required"
msgstr "Um nome de repositório, parâmetro e um valor são requeridos"
#. TRANSLATORS: The user didn't specify what action to use
-#: ../client/pk-console.c:2038
+#: ../client/pk-console.c:2052
msgid "An action, e.g. 'update-system' is required"
msgstr "Uma ação, p. ex. \"update-system\" é requerida"
#. TRANSLATORS: The user specified an invalid action
-#: ../client/pk-console.c:2044
+#: ../client/pk-console.c:2058
msgid "A correct role is required"
msgstr "Um modo correto é requerido"
#. TRANSLATORS: we keep a database updated with the time that an action was last executed
-#: ../client/pk-console.c:2050
+#: ../client/pk-console.c:2064
msgid "Failed to get the time since this action was last completed"
msgstr "Falha ao obter o tempo em que essa ação foi completada pela última vez"
#. TRANSLATORS: The user did not provide a package name
#. TRANSLATORS: This is when the user fails to supply the package name
-#: ../client/pk-console.c:2059
-#: ../client/pk-console.c:2070
-#: ../client/pk-console.c:2078
-#: ../client/pk-console.c:2094
-#: ../client/pk-console.c:2102
+#: ../client/pk-console.c:2073
+#: ../client/pk-console.c:2084
+#: ../client/pk-console.c:2092
+#: ../client/pk-console.c:2108
+#: ../client/pk-console.c:2116
#: ../client/pk-generate-pack.c:241
msgid "A package name is required"
msgstr "O nome do pacote é requerido"
#. TRANSLATORS: each package "provides" certain things, e.g. mime(gstreamer-decoder-mp3), the user didn't specify it
-#: ../client/pk-console.c:2086
+#: ../client/pk-console.c:2100
msgid "A package provide string is required"
msgstr "à necessário especificar o que o pacote fornece"
#. TRANSLATORS: The user didn't specify a filename to create as a list
-#: ../client/pk-console.c:2110
+#: ../client/pk-console.c:2124
msgid "A list file name to create is required"
msgstr "O nome de arquivo da lista a ser criada é requerido"
#. TRANSLATORS: The user didn't specify a filename to open as a list
-#: ../client/pk-console.c:2119
-#: ../client/pk-console.c:2128
+#: ../client/pk-console.c:2133
+#: ../client/pk-console.c:2142
msgid "A list file to open is required"
msgstr "Uma lista de arquivos a serem abertos é requerida"
#. TRANSLATORS: The user tried to use an unsupported option on the command line
-#: ../client/pk-console.c:2181
+#: ../client/pk-console.c:2195
#, c-format
msgid "Option '%s' is not supported"
msgstr "A opção \"%s\" não é suportada"
#. TRANSLATORS: User does not have permission to do this
-#: ../client/pk-console.c:2194
+#: ../client/pk-console.c:2208
msgid "Incorrect privileges for this operation"
msgstr "Privilégios incorretos para esta operação"
#. TRANSLATORS: Generic failure of what they asked to do
-#: ../client/pk-console.c:2197
+#: ../client/pk-console.c:2211
msgid "Command failed"
msgstr "O comando falhou"
commit ae90f7fbc8ef6bbf274200ca2ffb1601345957a5
Author: Sebastian Heinlein <devel at glatzor.de>
Date: Fri Apr 10 21:21:01 2009 +0200
APT: Trivial update README
diff --git a/backends/apt/README.apt b/backends/apt/README.apt
index c1932ff..beee1e8 100644
--- a/backends/apt/README.apt
+++ b/backends/apt/README.apt
@@ -1,9 +1,9 @@
The name of this backend is apt
-It supports apt which is mainly used by Debian and its derivates. In contrast to
-the backend called apt this one uses DBus for the communication with the
-packagekit daemon. This allows to perform actions without having to reopen
-the cache for each one.
+It supports the Advanced Packaging Tool used by Debian and its derivates. The
+implementation was done in Python. The communication between the daemon and
+the backend process happens via stdin and stdout, it is a so called spawned
+backend using a dispatcher to allow the execution of several commands in a row.
To provide a tremendously fast search function a Xapian database is used.
It is provided by Enrico Zini's apt-xapian-index. Debtags will be used to
commit b9c15dce1c43167ed209ac969263cbc8ef0dbdfa
Author: Sebastian Heinlein <devel at glatzor.de>
Date: Fri Apr 10 21:17:19 2009 +0200
APT: Trivial rename of text files
diff --git a/backends/apt/HACKING b/backends/apt/HACKING
deleted file mode 100644
index 15894dc..0000000
--- a/backends/apt/HACKING
+++ /dev/null
@@ -1,16 +0,0 @@
-The backend can be tested by running it as root from the source code
-repository. Use the -t/--takeover command line switch to kill a perhaps already
-running apt backend before:
-
- sudo python aptDBUSBackend.py --debug --takeover
-
-Use the --help command line switch for more details.
-
-Some of the development takes place in python-apt. Since this means using
-not yet released code the corresponding work is done in PackageKit's
-apt-consolidate branch and in python-apt's consolidate branch.
-
-bzr branch lp:~glatzor/python-apt/consolidate
-
-Just place a symlink to the apt directory of the consolidate branch working
-directory to the apt backend directory.
diff --git a/backends/apt/HACKING.apt b/backends/apt/HACKING.apt
new file mode 100644
index 0000000..15894dc
--- /dev/null
+++ b/backends/apt/HACKING.apt
@@ -0,0 +1,16 @@
+The backend can be tested by running it as root from the source code
+repository. Use the -t/--takeover command line switch to kill a perhaps already
+running apt backend before:
+
+ sudo python aptDBUSBackend.py --debug --takeover
+
+Use the --help command line switch for more details.
+
+Some of the development takes place in python-apt. Since this means using
+not yet released code the corresponding work is done in PackageKit's
+apt-consolidate branch and in python-apt's consolidate branch.
+
+bzr branch lp:~glatzor/python-apt/consolidate
+
+Just place a symlink to the apt directory of the consolidate branch working
+directory to the apt backend directory.
diff --git a/backends/apt/README b/backends/apt/README
deleted file mode 100644
index c1932ff..0000000
--- a/backends/apt/README
+++ /dev/null
@@ -1,23 +0,0 @@
-The name of this backend is apt
-
-It supports apt which is mainly used by Debian and its derivates. In contrast to
-the backend called apt this one uses DBus for the communication with the
-packagekit daemon. This allows to perform actions without having to reopen
-the cache for each one.
-
-To provide a tremendously fast search function a Xapian database is used.
-It is provided by Enrico Zini's apt-xapian-index. Debtags will be used to
-enhance the quality of the search results further.
-
-A list of implemented functions are listed in the PackageKit FAQ:
-
-http://www.packagekit.org/pk-faq.html
-
-You can find packages for Ubuntu here:
-
-https://www.launchpad.net/~packagekit/+ppa
-
-Packages for Debian Unstable will be provided soon.
-
-Feel free to send comments or bug reports to the PackageKit mailing list
-or to the author.
diff --git a/backends/apt/README.apt b/backends/apt/README.apt
new file mode 100644
index 0000000..c1932ff
--- /dev/null
+++ b/backends/apt/README.apt
@@ -0,0 +1,23 @@
+The name of this backend is apt
+
+It supports apt which is mainly used by Debian and its derivates. In contrast to
+the backend called apt this one uses DBus for the communication with the
+packagekit daemon. This allows to perform actions without having to reopen
+the cache for each one.
+
+To provide a tremendously fast search function a Xapian database is used.
+It is provided by Enrico Zini's apt-xapian-index. Debtags will be used to
+enhance the quality of the search results further.
+
+A list of implemented functions are listed in the PackageKit FAQ:
+
+http://www.packagekit.org/pk-faq.html
+
+You can find packages for Ubuntu here:
+
+https://www.launchpad.net/~packagekit/+ppa
+
+Packages for Debian Unstable will be provided soon.
+
+Feel free to send comments or bug reports to the PackageKit mailing list
+or to the author.
diff --git a/backends/apt/TODO b/backends/apt/TODO
deleted file mode 100644
index affc71b..0000000
--- a/backends/apt/TODO
+++ /dev/null
@@ -1,27 +0,0 @@
-ISSUES:
-
- * Support delayed or hidden debconf questions
-
-Unresolved issues can be discussed at the following wiki page:
-http://wiki.debian.org/PackageKit
-
-
-TODO:
-
- * Implement all open backend methods. A list of implemented backend methods
- can be found in PackageKit FAQ or in pk-backend-apt.c.
-
- * Blacklist packages requiring input on the terminal and try to change
- the Debian policy in the long run. Way of automation?
-
- * Allow to reinject debtags into the search results to get
- similar software which not matches on the search terms
-
- * Index file list and add properties for package name and section to
- the xapian database to also make use of it in search group and
- search name (do we want this?)
-
- * Test and think about packages from cdroms
-
- * Talk to Sebastian Dröge about his new codec search implementation using
- debtags
diff --git a/backends/apt/TODO.apt b/backends/apt/TODO.apt
new file mode 100644
index 0000000..affc71b
--- /dev/null
+++ b/backends/apt/TODO.apt
@@ -0,0 +1,27 @@
+ISSUES:
+
+ * Support delayed or hidden debconf questions
+
+Unresolved issues can be discussed at the following wiki page:
+http://wiki.debian.org/PackageKit
+
+
+TODO:
+
+ * Implement all open backend methods. A list of implemented backend methods
+ can be found in PackageKit FAQ or in pk-backend-apt.c.
+
+ * Blacklist packages requiring input on the terminal and try to change
+ the Debian policy in the long run. Way of automation?
+
+ * Allow to reinject debtags into the search results to get
+ similar software which not matches on the search terms
+
+ * Index file list and add properties for package name and section to
+ the xapian database to also make use of it in search group and
+ search name (do we want this?)
+
+ * Test and think about packages from cdroms
+
+ * Talk to Sebastian Dröge about his new codec search implementation using
+ debtags
commit 6e9992491a277213a938fb8e5cd7d8f8d3a685a5
Author: Sebastian Heinlein <devel at glatzor.de>
Date: Fri Apr 10 16:42:05 2009 +0200
APT: trivial fix install-data-hook
diff --git a/backends/apt/Makefile.am b/backends/apt/Makefile.am
index 391e53a..29500d4 100644
--- a/backends/apt/Makefile.am
+++ b/backends/apt/Makefile.am
@@ -23,7 +23,7 @@ EXTRA_DIST = \
$(NULL)
install-data-hook:
- chmod a+rx $(DESTDIR)$(libexecdir)/*.py
+ chmod a+rx $(DESTDIR)$(helperdir)/*.py
clean-local :
rm -f *~
commit 0446c76e817a078eda6d30abd75234eeca7c11ef
Author: Sebastian Heinlein <devel at glatzor.de>
Date: Fri Apr 10 13:10:49 2009 +0200
APT: Fix a small lower/upper case issue
diff --git a/backends/apt/Makefile.am b/backends/apt/Makefile.am
index 356b1b7..391e53a 100644
--- a/backends/apt/Makefile.am
+++ b/backends/apt/Makefile.am
@@ -10,7 +10,7 @@ aptconf_DATA = 20packagekit
helperdir = $(datadir)/PackageKit/helpers/apt
dist_helper_DATA = \
- aptbackend.py \
+ aptBackend.py \
$(NULL)
sbin_SCRIPTS = \
commit 91d929528548133c07b20e1f277414dad97fd805
Author: Sebastian Heinlein <devel at glatzor.de>
Date: Fri Apr 10 12:34:23 2009 +0200
APT: Trivial. Fix a tab/spaces issue in the Makefile
diff --git a/backends/apt/Makefile.am b/backends/apt/Makefile.am
index ea3b3f1..356b1b7 100644
--- a/backends/apt/Makefile.am
+++ b/backends/apt/Makefile.am
@@ -9,9 +9,9 @@ aptconfdir = ${SYSCONFDIR}/apt/apt.conf.d
aptconf_DATA = 20packagekit
helperdir = $(datadir)/PackageKit/helpers/apt
-dist_helper_DATA =
- aptbackend.py \
- $(NULL)
+dist_helper_DATA = \
+ aptbackend.py \
+ $(NULL)
sbin_SCRIPTS = \
update-packagekit-app-data \
commit 6c6439a975130e6827c0c9cda61e992cce559110
Author: Sebastian Heinlein <devel at glatzor.de>
Date: Fri Apr 10 12:14:22 2009 +0200
APT: Follow the layout of other spawned backends regarding file locations and names
diff --git a/backends/apt/Makefile.am b/backends/apt/Makefile.am
index 476663a..ea3b3f1 100644
--- a/backends/apt/Makefile.am
+++ b/backends/apt/Makefile.am
@@ -10,11 +10,6 @@ aptconf_DATA = 20packagekit
helperdir = $(datadir)/PackageKit/helpers/apt
dist_helper_DATA =
- pk-backend-apt.py \
- $(NULL)
-
-packagekitpythondir = ${PYTHON_PACKAGE_DIR}
-packagekitpython_PYTHON = \
aptbackend.py \
$(NULL)
diff --git a/backends/apt/aptBackend.py b/backends/apt/aptBackend.py
new file mode 100755
index 0000000..ab64945
--- /dev/null
+++ b/backends/apt/aptBackend.py
@@ -0,0 +1,2003 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+Provides an apt backend to PackageKit
+
+Copyright (C) 2007 Ali Sabil <ali.sabil at gmail.com>
+Copyright (C) 2007 Tom Parker <palfrey at tevp.net>
+Copyright (C) 2008-2009 Sebastian Heinlein <glatzor at ubuntu.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.
+"""
+
+__author__ = "Sebastian Heinlein <devel at glatzor.de>"
+
+import errno
+import fcntl
+import gdbm
+import httplib
+import locale
+import logging
+import logging.handlers
+import optparse
+import os
+import pty
+import re
+import signal
+import shutil
+import socket
+import stat
+import string
+import subprocess
+import sys
+import time
+import urllib2
+import warnings
+
+import apt
+import apt.debfile
+import apt_pkg
+import dbus
+import dbus.glib
+import dbus.service
+import dbus.mainloop.glib
+import gobject
+
+from packagekit.backend import *
+from packagekit.progress import *
+from packagekit.package import *
+from packagekit.enums import *
+
+logging.basicConfig(format="%(levelname)s:%(message)s")
+pklog = logging.getLogger("PackageKitBackend")
+pklog.setLevel(logging.NOTSET)
+
+_syslog = logging.handlers.SysLogHandler("/dev/log",
+ logging.handlers.SysLogHandler.LOG_DAEMON)
+formatter = logging.Formatter('PackageKit: %(levelname)s: %(message)s')
+_syslog.setFormatter(formatter)
+pklog.addHandler(_syslog)
+
+# Xapian database is optionally used to speed up package description search
+XAPIAN_DB_PATH = os.environ.get("AXI_DB_PATH", "/var/lib/apt-xapian-index")
+XAPIAN_DB = XAPIAN_DB_PATH + "/index"
+XAPIAN_DB_VALUES = XAPIAN_DB_PATH + "/values"
+XAPIAN_SUPPORT = False
+try:
+ import xapian
+except ImportError:
+ pass
+else:
+ if os.access(XAPIAN_DB, os.R_OK):
+ pklog.debug("Use XAPIAN for the search")
+ XAPIAN_SUPPORT = True
+
+# SoftwareProperties is required to proivde information about repositories
+try:
+ import softwareproperties.SoftwareProperties
+except ImportError:
+ REPOS_SUPPORT = False
+else:
+ REPOS_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)
+
+# Required for daemon mode
+os.putenv("PATH",
+ "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin")
+# Avoid questions from the maintainer scripts as far as possible
+os.putenv("DEBIAN_FRONTEND", "noninteractive")
+os.putenv("APT_LISTCHANGES_FRONTEND", "none")
+
+# Map Debian sections to the PackageKit group name space
+SECTION_GROUP_MAP = {
+ "admin" : GROUP_ADMIN_TOOLS,
+ "base" : GROUP_SYSTEM,
+ "comm" : GROUP_COMMUNICATION,
+ "devel" : GROUP_PROGRAMMING,
+ "doc" : GROUP_DOCUMENTATION,
+ "editors" : GROUP_PUBLISHING,
+ "electronics" : GROUP_ELECTRONICS,
+ "embedded" : GROUP_SYSTEM,
+ "games" : GROUP_GAMES,
+ "gnome" : GROUP_DESKTOP_GNOME,
+ "graphics" : GROUP_GRAPHICS,
+ "hamradio" : GROUP_COMMUNICATION,
+ "interpreters" : GROUP_PROGRAMMING,
+ "kde" : GROUP_DESKTOP_KDE,
+ "libdevel" : GROUP_PROGRAMMING,
+ "libs" : GROUP_SYSTEM,
+ "mail" : GROUP_INTERNET,
+ "math" : GROUP_SCIENCE,
+ "misc" : GROUP_OTHER,
+ "net" : GROUP_NETWORK,
+ "news" : GROUP_INTERNET,
+ "oldlibs" : GROUP_LEGACY,
+ "otherosfs" : GROUP_SYSTEM,
+ "perl" : GROUP_PROGRAMMING,
+ "python" : GROUP_PROGRAMMING,
+ "science" : GROUP_SCIENCE,
+ "shells" : GROUP_SYSTEM,
+ "sound" : GROUP_MULTIMEDIA,
+ "tex" : GROUP_PUBLISHING,
+ "text" : GROUP_PUBLISHING,
+ "utils" : GROUP_ACCESSORIES,
+ "web" : GROUP_INTERNET,
+ "x11" : GROUP_DESKTOP_OTHER,
+ "unknown" : GROUP_UNKNOWN,
+ "alien" : GROUP_UNKNOWN,
+ "translations" : GROUP_LOCALIZATION,
+ "metapackages" : GROUP_COLLECTIONS }
+
+# Regular expressions to detect bug numbers in changelogs according to the
+# Debian Policy Chapter 4.4. For details see the footnote 16:
+# http://www.debian.org/doc/debian-policy/footnotes.html#f16
+MATCH_BUG_CLOSES_DEBIAN=r"closes:\s*(?:bug)?\#?\s?\d+(?:,\s*(?:bug)?\#?\s?\d+)*"
+MATCH_BUG_NUMBERS=r"\#?\s?(\d+)"
+# URL pointing to a bug in the Debian bug tracker
+HREF_BUG_DEBIAN="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=%s"
+
+# Regular expression to find cve references
+MATCH_CVE="CVE-\d{4}-\d{4}"
+HREF_CVE="http://web.nvd.nist.gov/view/vuln/detail?vulnId=%s"
+
+def unlock_cache_afterwards(func):
+ '''
+ Make sure that the package cache is unlocked after the decorated function
+ was called
+ '''
+ def wrapper(*args, **kwargs):
+ backend = args[0]
+ func(*args, **kwargs)
+ backend._unlock_cache()
+ wrapper.__name__ = func.__name__
+ return wrapper
+
+
+class PKError(Exception):
+ pass
+
+class PackageManagerFailedPKError(PKError):
+ def __init__(self, msg, pkg, output):
+ self.message = msg
+ self.package = pkg
+ self.output = output
+
+class InstallTimeOutPKError(PKError):
+ pass
+
+class PackageKitCache(apt.cache.Cache):
+ """
+ Enhanced version of the apt.cache.Cache class which supports some features
+ which can only be found in the consolidate branch of python-apt
+ """
+ def __iter__(self):
+ """
+ Let the cache behave like a sorted list of packages
+ """
+ for pkgname in sorted(self._dict.keys()):
+ yield self._dict[pkgname]
+ raise StopIteration
+
+
+class DpkgInstallProgress(apt.progress.InstallProgress):
+ """
+ Class to initiate and monitor installation of local package files with dpkg
+ """
+ #FIXME: Use the merged DpkgInstallProgress of python-apt
+ def recover(self):
+ """
+ Run "dpkg --configure -a"
+ """
+ cmd = ["/usr/bin/dpkg", "--status-fd", str(self.writefd),
+ "--root", apt_pkg.Config["Dir"],
+ "--force-confdef", "--force-confold",
+ "--configure", "-a"]
+ self.run(cmd)
+
+ def install(self, filenames):
+ """
+ Install the given package using a dpkg command line call
+ """
+ cmd = ["/usr/bin/dpkg", "--force-confdef", "--force-confold",
+ "--status-fd", str(self.writefd),
+ "--root", apt_pkg.Config["Dir"], "-i"]
+ cmd.extend(map(lambda f: str(f), filenames))
+ self.run(cmd)
+
+ def run(self, cmd):
+ """
+ Run and monitor a dpkg command line call
+ """
+ pklog.debug("Executing: %s" % cmd)
+ (self.master_fd, slave) = pty.openpty()
+ fcntl.fcntl(self.master_fd, fcntl.F_SETFL, os.O_NONBLOCK)
+ p = subprocess.Popen(cmd, stdout=slave, stdin=slave)
+ self.child_pid = p.pid
+ res = self.waitChild()
+ return res
+
+ def updateInterface(self):
+ """
+ Process status messages from dpkg
+ """
+ if self.statusfd == None:
+ return
+ try:
+ while not self.read.endswith("\n"):
+ self.read += os.read(self.statusfd.fileno(), 1)
+ except OSError, (error_no, error_str):
+ # resource temporarly unavailable is ignored
+ if error_no not in [errno.EAGAIN, errno.EWOULDBLOCK]:
+ pklog.warn(error_str)
+ if self.read.endswith("\n"):
+ statusl = string.split(self.read, ":")
+ if len(statusl) < 3:
+ pklog.warn("got garbage from dpkg: '%s'" % self.read)
+ self.read = ""
+ status = statusl[2].strip()
+ pkg = statusl[1].strip()
+ #print status
+ if status == "error":
+ self.error(pkg, status)
+ elif status == "conffile-prompt":
+ # we get a string like this:
+ # 'current-conffile' 'new-conffile' useredited distedited
+ match = re.search(".+conffile-prompt : '(.+)' '(.+)'",
+ self.read)
+ self.conffile(match.group(1), match.group(2))
+ else:
+ pklog.debug("Dpkg status: %s" % status)
+ self.status = status
+ self.read = ""
+
+
+class PackageKitOpProgress(apt.progress.OpProgress):
+ '''
+ Handle the cache opening process
+ '''
+ def __init__(self, backend, prange=(0,100), progress=True):
+ self._backend = backend
+ apt.progress.OpProgress.__init__(self)
+ self.steps = []
+ for v in [0.12, 0.25, 0.50, 0.75, 1.00]:
+ s = prange[0] + (prange[1] - prange[0]) * v
+ self.steps.append(s)
+ self.pstart = float(prange[0])
+ self.pend = self.steps.pop(0)
+ self.pprev = None
+ self.show_progress = progress
+
+ # OpProgress callbacks
+ def update(self, percent):
+ progress = int(self.pstart + percent / 100 * (self.pend - self.pstart))
+ if self.show_progress == True and self.pprev < progress:
+ self._backend.percentage(progress)
+ self.pprev = progress
+
+ def done(self):
+ self.pstart = self.pend
+ try:
+ self.pend = self.steps.pop(0)
+ except:
+ pklog.warning("An additional step to open the cache is required")
+
+
+class PackageKitFetchProgress(apt.progress.FetchProgress):
+ '''
+ Handle the package download process
+ '''
+ def __init__(self, backend, prange=(0,100)):
+ self._backend = backend
+ apt.progress.FetchProgress.__init__(self)
+ self.pstart = prange[0]
+ self.pend = prange[1]
+ self.pprev = None
+
+ def pulse(self):
+ apt.progress.FetchProgress.pulse(self)
+ progress = int(self.pstart + self.percent/100 * \
+ (self.pend - self.pstart))
+ if self.pprev < progress:
+ self._backend.percentage(progress)
+ self.pprev = progress
+ return True
+
+ def start(self):
+ self._backend.status(STATUS_DOWNLOAD)
+ self._backend.allow_cancel(True)
+
+ def stop(self):
+ self._backend.percentage(self.pend)
+ self._backend.allow_cancel(False)
+
+ def mediaChange(self, medium, drive):
+ #FIXME: Raise an expcetion and handle it in _commit_changes
+ # Strangly _commit_changes does not catch the expcetion
+ self._backend.message(MESSAGE_UNKNOWN,
+ "Installing from CD-Rom (%s) is not "
+ "supported." % medium)
+ return False
+
+
+class PackageKitInstallProgress(apt.progress.InstallProgress):
+ '''
+ Handle the installation and removal process. Bits taken from
+ DistUpgradeViewNonInteractive.
+ '''
+ def __init__(self, backend, prange=(0,100)):
+ apt.progress.InstallProgress.__init__(self)
+ self._backend = backend
+ self.pstart = prange[0]
+ self.pend = prange[1]
+ self.pprev = None
+ self.last_activity = None
+ self.conffile_prompts = set()
+ # insanly long timeout to be able to kill hanging maintainer scripts
+ self.timeout = 10 * 60
+ self.start_time = None
+ self.output = ""
+ self.master_fd = None
+ self.child_pid = None
+
+ def statusChange(self, pkg, percent, status):
+ self.last_activity = time.time()
+ progress = self.pstart + percent/100 * (self.pend - self.pstart)
+ if self.pprev < progress:
+ self._backend.percentage(int(progress))
+ self.pprev = progress
+ pklog.debug("APT status: %s" % status)
+
+ def startUpdate(self):
+ # The apt system lock was set by _lock_cache() before
+ self._backend._unlock_cache()
+ self._backend.status(STATUS_COMMIT)
+ self.last_activity = time.time()
+ self.start_time = time.time()
+
+ def fork(self):
+ pklog.debug("fork()")
+ (pid, self.master_fd) = pty.fork()
+ if pid != 0:
+ fcntl.fcntl(self.master_fd, fcntl.F_SETFL, os.O_NONBLOCK)
+ return pid
+
+ def updateInterface(self):
+ apt.progress.InstallProgress.updateInterface(self)
+ # Collect the output from the package manager
+ try:
+ out = os.read(self.master_fd, 512)
+ self.output = self.output + out
+ pklog.debug("APT out: %s " % out)
+ except OSError:
+ pass
+ # catch a time out by sending crtl+c
+ if self.last_activity + self.timeout < time.time():
+ pklog.critical("no activity for %s time sending ctrl-c" \
+ % self.timeout)
+ os.write(self.master_fd, chr(3))
+ #FIXME: include this into the normal install progress and add
+ # correct package information
+ raise InstallTimeOutPKError(self.output)
+
+ def conffile(self, current, new):
+ pklog.warning("Config file prompt: '%s' (sending no)" % current)
+ self.conffile_prompts.add(new)
+
+ def error(self, pkg, msg):
+ raise PackageManagerFailedPKError(pkg, msg, self.output)
+
+ def finishUpdate(self):
+ pklog.debug("finishUpdate()")
+ if self.conffile_prompts:
+ self._backend.message(MESSAGE_CONFIG_FILES_CHANGED,
+ "The following conffile prompts were found "
+ "and need investiagtion: %s" % \
+ "\n".join(self.conffile_prompts))
+ # Check for required restarts
+ if os.path.exists("/var/run/reboot-required") and \
+ os.path.getmtime("/var/run/reboot-required") > self.start_time:
+ self._backend.RequireRestart(RESTART_SYSTEM, "")
+
+
+class PackageKitDpkgInstallProgress(DpkgInstallProgress,
+ PackageKitInstallProgress):
+ """
+ Class to integrate the progress of core dpkg operations into PackageKit
+ """
+ def run(self, filenames):
+ return DpkgInstallProgress.run(self, filenames)
+
+ def updateInterface(self):
+ DpkgInstallProgress.updateInterface(self)
+ try:
+ out = os.read(self.master_fd, 512)
+ self.output += out
+ if out != "": pklog.debug("Dpkg out: %s" % out)
+ except OSError:
+ pass
+ # we timed out, send ctrl-c
+ if self.last_activity + self.timeout < time.time():
+ pklog.critical("no activity for %s time sending "
+ "ctrl-c" % self.timeout)
+ os.write(self.master_fd, chr(3))
+ raise InstallTimeOutPKError(self.output)
+
+
+if REPOS_SUPPORT == True:
+ class PackageKitSoftwareProperties(softwareproperties.SoftwareProperties.SoftwareProperties):
+ """
+ Helper class to fix a siily bug in python-software-properties
+ """
+ def set_modified_sourceslist(self):
+ self.save_sourceslist()
+
+
+class PackageKitAptBackend(PackageKitBaseBackend):
+ '''
+ PackageKit backend for apt
+ '''
+ def __init__(self, args):
+ pklog.info("Initializing APT backend")
+ signal.signal(signal.SIGQUIT, self._sigquit)
+ self._cache = None
+ self._last_cache_refresh = None
+ apt_pkg.InitConfig()
+ apt_pkg.Config.Set("DPkg::Options::", '--force-confdef')
+ apt_pkg.Config.Set("DPkg::Options::", '--force-confold')
+ PackageKitBaseBackend.__init__(self, args)
+ self._open_cache(progress=False)
+
+ # Methods ( client -> engine -> backend )
+
+ def search_file(self, filters, filename):
+ '''
+ Implement the apt2-search-file functionality
+
+ Apt specific: Works only for installed files. Since config files are
+ not removed by default even not installed packages can be reported.
+ '''
+ pklog.info("Searching for file: %s" % filename)
+ self.status(STATUS_QUERY)
+ self.percentage(None)
+ self._check_init(progress=False)
+ self.allow_cancel(True)
+
+ for pkg in self._cache:
+ for installed_file in self._get_installed_files(pkg):
+ if filename in installed_file:
+ self._emit_visible_package(filters, pkg)
+ break
+
+ def search_group(self, filters, group):
+ '''
+ Implement the apt2-search-group functionality
+ '''
+ pklog.info("Searching for group: %s" % group)
+ self.status(STATUS_QUERY)
+ self.percentage(None)
+ self._check_init(progress=False)
+ self.allow_cancel(True)
+
+ for pkg in self._cache:
+ if self._get_package_group(pkg) == group:
+ self._emit_visible_package(filters, pkg)
+
+ def search_name(self, filters, search):
+ '''
+ Implement the apt2-search-name functionality
+ '''
+ pklog.info("Searching for package name: %s" % search)
+ self.status(STATUS_QUERY)
+ self.percentage(None)
+ self._check_init(progress=False)
+ self.allow_cancel(True)
+
+ for pkg in self._cache:
+ if search in pkg.name:
+ self._emit_visible_package(filters, pkg)
+
+ def search_details(self, filters, search):
+ '''
+ Implement the apt2-search-details functionality
+ '''
+ pklog.info("Searching for package name: %s" % search)
+ self.status(STATUS_QUERY)
+ self.percentage(None)
+ self._check_init(progress=False)
+ self.allow_cancel(True)
+ results = []
+
+ if XAPIAN_SUPPORT == True:
+ search_flags = (xapian.QueryParser.FLAG_BOOLEAN |
+ xapian.QueryParser.FLAG_PHRASE |
+ xapian.QueryParser.FLAG_LOVEHATE |
+ xapian.QueryParser.FLAG_BOOLEAN_ANY_CASE)
+ pklog.debug("Performing xapian db based search")
+ db = xapian.Database(XAPIAN_DB)
+ parser = xapian.QueryParser()
+ query = parser.parse_query(unicode(search),
+ search_flags)
+ enquire = xapian.Enquire(db)
+ enquire.set_query(query)
+ matches = enquire.get_mset(0, 1000)
+ for r in map(lambda m: m[xapian.MSET_DOCUMENT].get_data(),
+ enquire.get_mset(0,1000)):
+ if self._cache.has_key(r):
+ results.append(self._cache[r])
+ else:
+ pklog.debug("Performing apt cache based search")
+ for p in self._cache._dict.values():
+ needle = search.strip().lower()
+ haystack = p.description.lower()
+ if p.name.find(needle) >= 0 or haystack.find(needle) >= 0:
+ results.append(p)
+
+ for r in results:
+ self._emit_visible_package(filters, r)
+
+ def get_distro_upgrades(self):
+ '''
+ Implement the {backend}-get-distro-upgrades functionality
+ '''
+ pklog.info("Get distro upgrades")
+ self.status(STATUS_INFO)
+ self.allow_cancel(False)
+ self.percentage(None)
+
+ if META_RELEASE_SUPPORT == False:
+ if self._cache.has_key("update-manager-core") and \
+ self._cache["update-manager-core"].isInstalled == False:
+ self.error(ERROR_UNKNOWN,
+ "Please install the package update-manager-core to "
+ "get notified of the latest distribution releases.")
+ else:
+ self.error(ERROR_UNKNOWN,
+ "Please make sure that update-manager-core is"
+ "correctly installed.")
+ 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.distro_ppgrade("stable",
+ "%s %s" % (meta_release.new_dist.name,
+ meta_release.new_dist.version),
+ "The latest stable release")
+
+ def get_updates(self, filters):
+ '''
+ Implement the {backend}-get-update functionality
+ '''
+ def succeeds_security_update(pkg):
+ """
+ Return True if an update succeeds a previous security update
+
+ An example would be a package with version 1.1 in the security
+ archive and 1.1.1 in the archive of proposed updates or the
+ same version in both archives.
+ """
+ inst_ver = pkg._pkg.CurrentVer
+ for ver in pkg._pkg.VersionList:
+ # Skip versions which are not later
+ if inst_ver and \
+ apt_pkg.VersionCompare(ver.VerStr, inst_ver.VerStr) <= 0:
+ continue
+ for(verFileIter, index) in ver.FileList:
+ if verFileIter.Origin in ["Debian", "Ubuntu"] and \
+ (verFileIter.Archive.endswith("-security") or \
+ verFileIter.Label == "Debian-Security"):
+ indexfile = pkg._list.FindIndex(verFileIter)
+ if indexfile and indexfile.IsTrusted:
+ return True
+ return False
+ #FIXME: Implment the basename filter
+ pklog.info("Get updates")
+ self.status(STATUS_QUERY)
+ self.allow_cancel(True)
+ self.percentage(None)
+ self._check_init(progress=False)
+ self._cache.upgrade(False)
+ updates = filter(lambda p: self._cache[p].isUpgradable,
+ self._cache.keys())
+ for pkg in self._cache.getChanges():
+ updates.remove(pkg.name)
+ info = INFO_NORMAL
+ archive = pkg.candidateOrigin[0].archive
+ origin = pkg.candidateOrigin[0].origin
+ trusted = pkg.candidateOrigin[0].trusted
+ label = pkg.candidateOrigin[0].label
+ if origin in ["Debian", "Ubuntu"] and trusted == True:
+ if archive.endswith("-security") or \
+ label == "Debian-Security":
+ info = INFO_SECURITY
+ elif succeeds_security_update(pkg):
+ pklog.debug("Update of %s succeeds a security "
+ "update. Raising its priority." % pkg.name)
+ info = INFO_SECURITY
+ elif archive.endswith("-backports"):
+ info = INFO_ENHANCEMENT
+ elif archive.endswith("-updates"):
+ info = INFO_BUGFIX
+ if origin in ["Backports.org archive"] and trusted == True:
+ info = INFO_ENHANCEMENT
+ self._emit_package(pkg, info, force_candidate=True)
+ # Report packages that are upgradable but cannot be upgraded
+ for missed in updates:
+ self._emit_package(self._cache[missed], INFO_BLOCKED)
+ self._cache.clear()
+
+ def get_update_detail(self, pkg_ids):
+ '''
+ Implement the {backend}-get-update-details functionality
+ '''
+ def get_bug_urls(changelog):
+ """
+ Create a list of urls pointing to closed bugs in the changelog
+ """
+ urls = []
+ #FIXME: Add support for Launchpad/Ubuntu
+ for r in re.findall(MATCH_BUG_CLOSES_DEBIAN, changelog,
+ re.IGNORECASE | re.MULTILINE):
+ urls.extend(map(lambda b: HREF_BUG_DEBIAN % b,
+ re.findall(MATCH_BUG_NUMBERS, r)))
+ return urls
+
+ def get_cve_urls(changelog):
+ """
+ Create a list of urls pointing to cves referred in the changelog
+ """
+ return map(lambda c: HREF_CVE % c,
+ re.findall(MATCH_CVE, changelog, re.MULTILINE))
+
+ pklog.info("Get update details of %s" % pkg_ids)
+ self.status(STATUS_INFO)
+ self.percentage(None)
+ self.allow_cancel(True)
+ self._check_init(progress=False)
+ for pkg_id in pkg_ids:
+ pkg = self._find_package_by_id(pkg_id)
+ if pkg == None:
+ self.error(ERROR_PACKAGE_NOT_FOUND,
+ "Package %s isn't available" % id)
+ return
+ # FIXME add some real data
+ updates = self.get_id_from_package(pkg, force_candidate=False)
+ obsoletes = ""
+ vendor_url = ""
+ restart = "none"
+ update_text = ""
+ state = ""
+ issued = ""
+ updated = ""
+ #FIXME: Replace this method with the python-apt one as soon as the
+ # consolidate branch gets merged
+ self.status(STATUS_DOWNLOAD_CHANGELOG)
+ changelog = self._get_changelog(pkg)
+ self.status(STATUS_INFO)
+ bugzilla_url = ";".join(get_bug_urls(changelog))
+ cve_url = ";".join(get_cve_urls(changelog))
+ self.update_detail(pkg_id, updates, obsoletes, vendor_url,
+ bugzilla_url, cve_url, restart, update_text,
+ _format_string(changelog), state, issued,
+ updated)
+
+ def get_details(self, pkg_ids):
+ '''
+ Implement the {backend}-get-details functionality
+ '''
+ pklog.info("Get details of %s" % pkg_ids)
+ self.status(STATUS_INFO)
+ self.percentage(None)
+ self.allow_cancel(True)
+ self._check_init(progress=False)
+ for pkg_id in pkg_ids:
+ pkg = self._find_package_by_id(pkg_id)
+ if pkg == None:
+ self.error(ERROR_PACKAGE_NOT_FOUND,
+ "Package %s isn't available" % id)
+ return
+ #FIXME: We need more fine grained license information!
+ candidate = pkg.candidateOrigin
+ if candidate != None and \
+ candidate[0].component in ["main", "universe"] and \
+ candidate[0].origin in ["Debian", "Ubuntu"]:
+ license = "free"
+ else:
+ license = "unknown"
+ group = self._get_package_group(pkg)
+ self.details(pkg_id, license, group,
+ _format_string(pkg.description),
+ pkg.homepage, pkg.packageSize)
+
+ @unlock_cache_afterwards
+ def update_system(self):
+ '''
+ Implement the {backend}-update-system functionality
+ '''
+ pklog.info("Upgrading system")
+ if not self._lock_cache(): return
+ self.status(STATUS_UPDATE)
+ self.allow_cancel(False)
+ self.percentage(0)
+ self._check_init(prange=(0,5))
+ try:
+ self._cache.upgrade(distUpgrade=False)
+ except:
+ self._cache.clear()
+ self.error(ERROR_DEP_RESOLUTION_FAILED,
+ "Failed to upgrade the system.")
+ return
+ if not self._commit_changes(): return False
+ self.percentage(100)
+
+ @unlock_cache_afterwards
+ def remove_packages(self, allowdeps, ids):
+ '''
+ Implement the {backend}-remove functionality
+ '''
+ pklog.info("Removing package(s): id %s" % ids)
+ if not self._lock_cache(): return
+ self.status(STATUS_REMOVE)
+ self.allow_cancel(False)
+ self.percentage(0)
+ self._check_init(prange=(0,10))
+ pkgs=[]
+ for id in ids:
+ pkg = self._find_package_by_id(id)
+ if pkg == None:
+ self.error(ERROR_PACKAGE_NOT_FOUND,
+ "Package %s isn't available" % id)
+ return
+ if not pkg.isInstalled:
+ self.error(ERROR_PACKAGE_NOT_INSTALLED,
+ "Package %s isn't installed" % pkg.name)
+ return
+ pkgs.append(pkg.name[:])
+ if pkg._pkg.Essential == True:
+ self.error(ERROR_CANNOT_REMOVE_SYSTEM_PACKAGE,
+ "Package %s cannot be removed." % pkg.name)
+ return
+ try:
+ pkg.markDelete()
+ except:
+ self._open_cache(prange=(90,99))
+ self.error(ERROR_UNKNOWN, "Removal of %s failed" % pkg.name)
+ return
+ if not self._commit_changes(fetch_range=(10,10),
+ install_range=(10,90)):
+ return False
+ self._open_cache(prange=(90,99))
+ for p in pkgs:
+ if self._cache.has_key(p) and self._cache[p].isInstalled:
+ self.error(ERROR_UNKNOWN, "%s is still installed" % p)
+ return
+ self.percentage(100)
+
+ def get_repo_list(self, filters):
+ '''
+ Implement the {backend}-get-repo-list functionality
+
+ FIXME: should we use the abstration of software-properties or provide
+ low level access using pure aptsources?
+ '''
+ pklog.info("Getting repository list: %s" % filters)
+ self.status(STATUS_INFO)
+ self.allow_cancel(False)
+ self.percentage(0)
+ if REPOS_SUPPORT == False:
+ if self._cache.has_key("python-software-properties") and \
+ self._cache["python-software-properties"].isInstalled == False:
+ self.error(ERROR_UNKNOWN,
+ "Please install the package "
+ "python-software-properties to handle repositories")
+ else:
+ self.error(ERROR_UNKNOWN,
+ "Please make sure that python-software-properties is"
+ "correctly installed.")
+ return
+ filter_list = filters.split(";")
+ repos = PackageKitSoftwareProperties()
+ # Emit distro components as virtual repositories
+ for comp in repos.distro.source_template.components:
+ repo_id = "%s_comp_%s" % (repos.distro.id, comp.name)
+ description = "%s %s - %s (%s)" % (repos.distro.id,
+ repos.distro.release,
+ comp.get_description(),
+ comp.name)
+ #FIXME: There is no inconsitent state in PackageKit
+ enabled = repos.get_comp_download_state(comp)[0]
+ if not FILTER_DEVELOPMENT in filter_list:
+ self.repo_detail(repo_id, description, enabled)
+ # Emit distro's virtual update repositories
+ for template in repos.distro.source_template.children:
+ repo_id = "%s_child_%s" % (repos.distro.id, template.name)
+ description = "%s %s - %s (%s)" % (repos.distro.id,
+ repos.distro.release,
+ template.description,
+ template.name)
+ #FIXME: There is no inconsitent state in PackageKit
+ enabled = repos.get_comp_child_state(template)[0]
+ if not FILTER_DEVELOPMENT in filter_list:
+ self.repo_detail(repo_id, description, enabled)
+ # Emit distro's cdrom sources
+ for source in repos.get_cdrom_sources():
+ if FILTER_NOT_DEVELOPMENT in filter_list and \
+ source.type in ("deb-src", "rpm-src"):
+ continue
+ enabled = not source.disabled
+ # Remove markups from the description
+ description = re.sub(r"</?b>", "", repos.render_source(source))
+ repo_id = "cdrom_%s_%s" % (source.uri, source.dist)
+ repo_id.join(map(lambda c: "_%s" % c, source.comps))
+ self.repo_detail(repo_id, description, enabled)
+ # Emit distro's virtual source code repositoriy
+ if not FILTER_NOT_DEVELOPMENT in filter_list:
+ repo_id = "%s_source" % repos.distro.id
+ enabled = repos.get_source_code_state() or False
+ #FIXME: no translation :(
+ description = "%s %s - Source code" % (repos.distro.id,
+ repos.distro.release)
+ self.repo_detail(repo_id, description, enabled)
+ # Emit third party repositories
+ for source in repos.get_isv_sources():
+ if FILTER_NOT_DEVELOPMENT in filter_list and \
+ source.type in ("deb-src", "rpm-src"):
+ continue
+ enabled = not source.disabled
+ # Remove markups from the description
+ description = re.sub(r"</?b>", "", repos.render_source(source))
+ repo_id = "isv_%s_%s" % (source.uri, source.dist)
+ repo_id.join(map(lambda c: "_%s" % c, source.comps))
+ self.repo_detail(repo_id, description, enabled)
+
+ def repo_enable(self, repo_id, enable):
+ '''
+ Implement the {backend}-repo-enable functionality
+
+ FIXME: should we use the abstration of software-properties or provide
+ low level access using pure aptsources?
+ '''
+ pklog.info("Enabling repository: %s %s" % (repo_id, enable))
+ self.status(STATUS_RUNNING)
+ self.allow_cancel(False)
+ self.percentage(0)
+ if REPOS_SUPPORT == False:
+ if self._cache.has_key("python-software-properties") and \
+ self._cache["python-software-properties"].isInstalled == False:
+ self.error(ERROR_UNKNOWN,
+ "Please install the package "
+ "python-software-properties to handle repositories")
+ else:
+ self.error(ERROR_UNKNOWN,
+ "Please make sure that python-software-properties is"
+ "correctly installed.")
+ return
+ repos = PackageKitSoftwareProperties()
+
+ found = False
+ # Check if the repo_id matches a distro component, e.g. main
+ if repo_id.startswith("%s_comp_" % repos.distro.id):
+ for comp in repos.distro.source_template.components:
+ if repo_id == "%s_comp_%s" % (repos.distro.id, comp.name):
+ if enable == repos.get_comp_download_state(comp)[0]:
+ pklog.debug("Repository is already enabled")
+ pass
+ if enable == True:
+ repos.enable_component(comp.name)
+ else:
+ repos.disable_component(comp.name)
+ found = True
+ break
+ # Check if the repo_id matches a distro child repository, e.g. hardy-updates
+ elif repo_id.startswith("%s_child_" % repos.distro.id):
+ for template in repos.distro.source_template.children:
+ if repo_id == "%s_child_%s" % (repos.distro.id, template.name):
+ if enable == repos.get_comp_child_state(template)[0]:
+ pklog.debug("Repository is already enabled")
+ pass
+ elif enable == True:
+ repos.enable_child_source(template)
+ else:
+ repos.disable_child_source(template)
+ found = True
+ break
+ # Check if the repo_id matches a cdrom repository
+ elif repo_id.startswith("cdrom_"):
+ for source in repos.get_isv_sources():
+ source_id = "cdrom_%s_%s" % (source.uri, source.dist)
+ source_id.join(map(lambda c: "_%s" % c, source.comps))
+ if repo_id == source_id:
+ if source.disabled == enable:
+ source.disabled = not enable
+ repos.save_sourceslist()
+ else:
+ pklog.debug("Repository is already enabled")
+ found = True
+ break
+ # Check if the repo_id matches an isv repository
+ elif repo_id.startswith("isv_"):
+ for source in repos.get_isv_sources():
+ source_id = "isv_%s_%s" % (source.uri, source.dist)
+ source_id.join(map(lambda c: "_%s" % c, source.comps))
+ if repo_id == source_id:
+ if source.disabled == enable:
+ source.disabled = not enable
+ repos.save_sourceslist()
+ else:
+ pklog.debug("Repository is already enabled")
+ found = True
+ break
+ if found == False:
+ self.error(ERROR_REPO_NOT_AVAILABLE,
+ "The repository of the id %s isn't available" % repo_id)
+ return
+
+ @unlock_cache_afterwards
+ def update_packages(self, ids):
+ '''
+ Implement the {backend}-update functionality
+ '''
+ pklog.info("Updating package with id %s" % ids)
+ if not self._lock_cache(): return
+ self.status(STATUS_UPDATE)
+ self.allow_cancel(False)
+ self.percentage(0)
+ self._check_init(prange=(0,10))
+ pkgs=[]
+ for id in ids:
+ pkg = self._find_package_by_id(id)
+ if pkg == None:
+ self.error(ERROR_PACKAGE_NOT_FOUND,
+ "Package %s isn't available" % id)
+ return
+ if not pkg.isUpgradable:
+ self.error(ERROR_PACKAGE_ALREADY_INSTALLED,
+ "Package %s is already up-to-date" % pkg.name)
+ return
+ pkgs.append(pkg.name[:])
+ try:
+ pkg.markUpgrade()
+ except:
+ self._open_cache(prange=(90,100))
+ self.error(ERROR_UNKNOWN,
+ "%s could not be queued for update" % pkg.name)
+ return
+ if not self._commit_changes(): return False
+ self._open_cache(prange=(90,100))
+ self.percentage(100)
+ pklog.debug("Checking success of operation")
+ for p in pkgs:
+ if not self._cache.has_key(p) or not self._cache[p].isInstalled \
+ or self._cache[p].isUpgradable:
+ self.error(ERROR_UNKNOWN, "%s was not updated" % p)
+ return
+ pklog.debug("Sending success signal")
+
+ def download_packages(self, dest, ids):
+ '''
+ Implement the {backend}-download-packages functionality
+ '''
+ def get_range(versions, total):
+ """
+ Calculate the start and end point of a package download progress.
+ """
+ downloaded = 0
+ for ver in versions:
+ start = downloaded * 100 / total
+ end = start + ver.size * 100 / total
+ yield ver, start, end
+ downloaded += ver.size
+ pklog.info("Downloading packages: %s" % ids)
+ self.status(STATUS_DOWNLOAD)
+ self.allow_cancel(True)
+ self.percentage(0)
+ # Check the destination directory
+ if not os.path.isdir(dest) or not os.access(dest, os.W_OK):
+ self.error(ERROR_UNKNOWN,
+ "The directory '%s' is not writable" % dest)
+ return
+ # Setup the fetcher
+ self._check_init(prange=(0,10))
+ versions = []
+ total = 0
+ # Check if all ids are vaild and calculate the total download size
+ for id in ids:
+ pkg_ver = self._get_pkg_version_by_id(id)
+ if pkg_ver is None:
+ self.error(ERROR_PACKAGE_NOT_FOUND,
+ "There is no package %s" % id)
+ return
+ if not pkg_ver.downloadable:
+ self.error(ERROR_PACKAGE_DOWNLOAD_FAILED,
+ "package %s isn't downloadable" % id)
+ return
+ total += pkg_ver.size
+ versions.append(pkg_ver)
+ # Start the download
+ for ver, start, end in get_range(versions, total):
+ progress = PackageKitFetchProgress(self, prange=(start, end))
+ try:
+ ver.fetch_binary(dest, progress)
+ except Exception, error:
+ self.error(ERROR_PACKAGE_DOWNLOAD_FAILED, error.message)
+ return
+ self.percentage(100)
+
+ @unlock_cache_afterwards
+ def install_packages(self, ids):
+ '''
+ Implement the {backend}-install functionality
+ '''
+ pklog.info("Installing package with id %s" % ids)
+ if not self._lock_cache(): return
+ self.status(STATUS_INSTALL)
+ self.allow_cancel(False)
+ self.percentage(0)
+ self._check_init(prange=(0,10))
+ pkgs=[]
+ for id in ids:
+ pkg = self._find_package_by_id(id)
+ if pkg == None:
+ self.error(ERROR_PACKAGE_NOT_FOUND,
+ "Package %s isn't available" % id)
+ return
+ if pkg.isInstalled:
+ self.error(ERROR_PACKAGE_ALREADY_INSTALLED,
+ "Package %s is already installed" % pkg.name)
+ return
+ pkgs.append(pkg.name[:])
+ try:
+ pkg.markInstall()
+ except Exception, e:
+ self._open_cache(prange=(90,100))
+ self.error(ERROR_UNKNOWN,
+ "%s could not be queued for "
+ "installation: %s" % (pkg.name,e))
+ return
+ if not self._commit_changes(): return False
+ self._open_cache(prange=(90,100))
+ self.percentage(100)
+ pklog.debug("Checking success of operation")
+ for p in pkgs:
+ if not self._cache.has_key(p) or not self._cache[p].isInstalled:
+ self.error(ERROR_UNKNOWN, "%s was not installed" % p)
+ return
+
+ @unlock_cache_afterwards
+ def install_files(self, trusted, inst_files):
+ '''
+ Implement install-files for the apt backend
+ Install local Debian package files
+ '''
+ pklog.info("Installing package files: %s" % inst_files)
+ if not self._lock_cache(): return
+ self.status(STATUS_INSTALL)
+ self.allow_cancel(False)
+ self.percentage(0)
+ self._check_init(prange=(0,10))
+ packages = []
+ # Collect all dependencies which need to be installed
+ self.status(STATUS_DEP_RESOLVE)
+ for path in inst_files:
+ deb = apt.debfile.DebPackage(path, self._cache)
+ packages.append(deb)
+ if not deb.check():
+ self.error(ERROR_UNKNOWN, deb._failureString)
+ return
+ (install, remove, unauthenticated) = deb.requiredChanges
+ pklog.debug("Changes: Install %s, Remove %s, Unauthenticated "
+ "%s" % (install, remove, unauthenticated))
+ if len(remove) > 0:
+ self.error(ERROR_DEP_RESOLUTION_FAILED,
+ "Remove the following packages "
+ "before: %s" % remove)
+ return
+ if deb.compare_to_version_in_cache() == \
+ apt.debfile.VERSION_OUTDATED:
+ self.message(MESSAGE_NEWER_PACKAGE_EXISTS,
+ "There is a later version of %s "
+ "available in the repositories." % deb.pkgname)
+ if len(self._cache.getChanges()) > 0 and not \
+ self._commit_changes((10,25), (25,50)):
+ return False
+ # Install the Debian package files
+ d = PackageKitDpkgInstallProgress(self)
+ try:
+ d.startUpdate()
+ d.install(inst_files)
+ d.finishUpdate()
+ except InstallTimeOutPKError, e:
+ self._recover()
+ #FIXME: should provide more information
+ self.error(ERROR_UNKNOWN,
+ "Transaction was cancelled since the installation "
+ "of a package hung.\n"
+ "This can be caused by maintainer scripts which "
+ "require input on the terminal:\n%s" % e.message)
+ return
+ except PackageManagerFailedPKError, e:
+ self._recover()
+ self.error(ERROR_UNKNOWN, "%s\n%s" % (e.message, e.output))
+ return
+ except Exception, e:
+ self._recover()
+ self.error(ERROR_INTERNAL_ERROR, e.message)
+ return
+ self.percentage(100)
+
+ @unlock_cache_afterwards
+ def refresh_cache(self):
+ '''
+ Implement the {backend}-refresh_cache functionality
+ '''
+ pklog.info("Refresh cache")
+ if not self._lock_cache(): return
+ self.status(STATUS_REFRESH_CACHE)
+ self.last_action_time = time.time()
+ self.allow_cancel(False);
+ self.percentage(0)
+ self._check_init((0,10))
+ try:
+ self._cache.update(PackageKitFetchProgress(self, prange=(10,95)))
+ except Exception, e:
+ self._open_cache(prange=(95,100))
+ self.error(ERROR_UNKNOWN,
+ "Refreshing cache failed: %s" % _format_string(e.message))
+ return
+ self._open_cache(prange=(95,100))
+ self.percentage(100)
+
+ def get_packages(self, filters):
+ '''
+ Implement the apt2-get-packages functionality
+ '''
+ pklog.info("Get all packages")
+ self.status(STATUS_QUERY)
+ self.percentage(None)
+ self._check_init(progress=False)
+ self.allow_cancel(True)
+
+ for pkg in self._cache:
+ if self._is_package_visible(pkg, filters):
+ self._emit_package(pkg)
+
+ def resolve(self, filters, names):
+ '''
+ Implement the apt2-resolve functionality
+ '''
+ pklog.info("Resolve")
+ self.status(STATUS_QUERY)
+ self.percentage(None)
+ self._check_init(progress=False)
+ self.allow_cancel(False)
+
+ for name in names:
+ if self._cache.has_key(name):
+ self._emit_visible_package(filters, self._cache[name])
+ else:
+ self.error(ERROR_PACKAGE_NOT_FOUND,
+ "Package name %s could not be resolved" % name)
+ return
+
+ def get_depends(self, filter, ids, recursive_text):
+ '''
+ Implement the apt2-get-depends functionality
+
+ Emit all packages that need to be installed or updated to install
+ the given package ids. It behaves like a preview of the changes
+ required for the installation. An error will be emitted if the
+ dependecies cannot be satisfied.
+ In contrast to the yum backend the whole dependency resoltions is done
+ by the package manager. Therefor the list of satisfied packages cannot
+ be computed easily. GDebi features this. Perhaps this should be moved
+ to python-apt.
+ '''
+ pklog.info("Get depends (%s,%s,%s)" % (filter, ids, recursive_text))
+ recursive = _text_to_bool(recursive_text)
+ #FIXME: recursive is not yet implemented
+ if recursive == True:
+ pklog.warn("Recursive dependencies are not implemented")
+ self.status(STATUS_QUERY)
+ self.percentage(None)
+ self._check_init(progress=False)
+ self.allow_cancel(True)
+
+ # Mark all packages for installation
+ pkgs = []
+ for id in ids:
+ pkg = self._find_package_by_id(id)
+ if pkg == None:
+ self.error(ERROR_PACKAGE_NOT_FOUND,
+ "Package %s isn't available" % id)
+ return
+ try:
+ pkg.markInstall()
+ except Exception, e:
+ #FIXME: Introduce a new info enumerate PK_INFO_MISSING for
+ # missing dependecies
+ self.error(ERROR_DEP_RESOLUTION_FAILED,
+ "Dependecies for %s cannot be satisfied: %s" % e)
+ return
+ pkgs.append(pkg)
+ # Check the status of the resulting changes
+ for p in self._cache.getChanges():
+ if p in pkgs: continue
+ if p.markedDelete:
+ # Packagekit policy forbids removing packages for installation
+ self.error(ERROR_DEP_RESOLUTION_FAILED,
+ "Remove the package %s before" % p.name)
+ return
+ elif p.markedInstall or p.markedUpgrade:
+ if self._is_package_visible(p, filter):
+ self._emit_package(p)
+ else:
+ self.error(ERROR_DEP_RESOLUTION_FAILED,
+ "Please use an advanced package management tool "
+ "e.g. Synaptic or aptitude, since there is a "
+ "complex dependency situation.")
+ return
+ # Clean up
+ self._cache.clear()
+
+ def get_requires(self, filter, ids, recursive_text):
+ '''
+ Implement the apt2-get-requires functionality
+ '''
+ pklog.info("Get requires (%s,%s,%s)" % (filter, ids, recursive_text))
+ recursive = _text_to_bool(rescursive_text)
+ #FIXME: recursive is not yet implemented
+ if recursive == True:
+ pklog.warn("Recursive dependencies are not implemented")
+ self.status(STATUS_DEP_RESOLVE)
+ self.percentage(None)
+ self._check_init(progress=False)
+ self.allow_cancel(True)
+ pkgs = []
+
+ # Mark all packages for installation
+ for id in ids:
+ pkg = self._find_package_by_id(id)
+ if pkg == None:
+ self.error(ERROR_PACKAGE_NOT_FOUND,
+ "Package %s isn't available" % id)
+ return
+ if pkg._pkg.Essential == True:
+ self.error(ERROR_CANNOT_REMOVE_SYSTEM_PACKAGE,
+ "Package %s cannot be removed." % pkg.name)
+ return
+ pkgs.append(pkg)
+ try:
+ pkg.markDelete()
+ except Exception, e:
+ #FIXME: Introduce a new info enumerate PK_INFO_MISSING for
+ # missing dependecies
+ self.error(ERROR_DEP_RESOLUTION_FAILED,
+ "Error removing %s: %s" % (pkg.name, e))
+ return
+ # Check the status of the resulting changes
+ for p in self._cache.getChanges():
+ if p.markedDelete:
+ if not p in pkgs and self._is_package_visible(p, filter):
+ self._emit_package(p)
+ else:
+ self.error(ERROR_DEP_RESOLUTION_FAILED,
+ "Please use an advanced package management tool "
+ "e.g. Synaptic or aptitude, since there is a "
+ "complex dependency situation.")
+ return
+ # Clean up
+ self._cache.clear()
+
+ def what_provides(self, filters, provides_type, search):
+ def get_mapping_db(path):
+ """
+ Return the gdbm database at the given path or send an
+ appropriate error message
+ """
+ if not os.access(path, os.R_OK):
+ if self._cache.has_key("app-install-data") and \
+ self._cache["app-install-data"].isInstalled == False:
+ self.error(ERROR_UNKNOWN,
+ "Please install the package "
+ "app-install data for a list of "
+ "applications that can handle files of "
+ "the given type")
+ else:
+ self.error(ERROR_UNKNOWN,
+ "The list of applications that can handle "
+ "files of the given type cannot be opened.\n"
+ "Try to reinstall the package "
+ "app-install-data.")
+ return None
+ try:
+ db = gdbm.open(path)
+ except:
+ self.error(ERROR_UNKNOWN,
+ "The list of applications that can handle "
+ "files of the given type cannot be opened.\n"
+ "Try to reinstall the package "
+ "app-install-data.")
+ return None
+ else:
+ return db
+
+ self.status(STATUS_QUERY)
+ self.percentage(None)
+ self._check_init(progress=False)
+ self.allow_cancel(False)
+ if provides_type == PROVIDES_CODEC:
+ # The search term from the codec helper looks like this one:
+ match = re.match(r"gstreamer([0-9\.]+)\((.+?)\)", search)
+ if not match:
+ self.error(ERROR_UNKNOWN,
+ "The search term is invalid")
+ return
+ codec = "%s:%s" % (match.group(1), match.group(2))
+ db = get_mapping_db("/var/lib/PackageKit/codec-map.gdbm")
+ if db == None:
+ self.error(ERROR_INTERNAL_ERROR,
+ "Failed to open codec mapping database")
+ return
+ if db.has_key(codec):
+ # The codec mapping db stores the packages as a string
+ # separated by spaces. Each package has its section
+ # prefixed and separated by a slash
+ # FIXME: Should make use of the section and emit a
+ # RepositoryRequired signal if the package does
+ # not exist
+ pkgs = map(lambda s: s.split("/")[1],
+ db[codec].split(" "))
+ self._emit_visible_packages_by_name(filters, pkgs)
+ elif provides_type == PROVIDES_MIMETYPE:
+ # Emit packages that contain an application that can handle
+ # the given mime type
+ handlers = set()
+ db = get_mapping_db("/var/lib/PackageKit/mime-map.gdbm")
+ if db == None:
+ return
+ if db.has_key(search):
+ pklog.debug("Mime type is registered: %s" % db[search])
+ # The mime type handler db stores the packages as a string
+ # separated by spaces. Each package has its section
+ # prefixed and separated by a slash
+ # FIXME: Should make use of the section and emit a
+ # RepositoryRequired signal if the package does not exist
+ handlers = map(lambda s: s.split("/")[1],
+ db[search].split(" "))
+ self._emit_visible_packages_by_name(filters, handlers)
+ else:
+ self.error(ERROR_NOT_SUPPORTED,
+ "This function is not implemented in this backend")
+ return
+
+ def get_files(self, package_ids):
+ """
+ Emit the Files signal which includes the files included in a package
+ Apt only supports this for installed packages
+ """
+ self.status(STATUS_INFO)
+ for id in package_ids:
+ pkg = self._find_package_by_id(id)
+ if pkg == None:
+ self.error(ERROR_PACKAGE_NOT_FOUND,
+ "Package %s doesn't exist" % pkg.name)
+ return
+ files = string.join(self._get_installed_files(pkg), ";")
+ self.files(id, files)
+
+ # Helpers
+
+ def _lock_cache(self):
+ """
+ Emit an error message and return true if the apt system lock cannot
+ be acquired.
+ """
+ try:
+ apt_pkg.PkgSystemLock()
+ except SystemError:
+ self.error(ERROR_CANNOT_GET_LOCK,
+ "Only use one package management programme at the "
+ "the same time.")
+ return False
+ return True
+
+ def _unlock_cache(self):
+ """
+ Unlock the system package cache
+ """
+ try:
+ apt_pkg.PkgSystemUnLock()
+ except SystemError:
+ return False
+ return True
+
+ def _open_cache(self, prange=(0,100), progress=True):
+ '''
+ (Re)Open the APT cache
+ '''
+ pklog.debug("Open APT cache")
+ self.status(STATUS_LOADING_CACHE)
+ try:
+ self._cache = PackageKitCache(PackageKitOpProgress(self, prange,
+ progress))
+ except:
+ self.error(ERROR_NO_CACHE, "Package cache could not be opened")
+ self.Exit()
+ return
+ if self._cache._depcache.BrokenCount > 0:
+ self.error(ERROR_DEP_RESOLUTION_FAILED,
+ "There are broken dependecies on your system. "
+ "Please use an advanced package manage e.g. "
+ "Synaptic or aptitude to resolve this situation.")
+ self.Exit()
+ return
+ self._last_cache_refresh = time.time()
+
+ def _recover(self, prange=(95,100)):
+ """
+ Try to recover from a package manager failure
+ """
+ self.status(STATUS_CLEANUP)
+ self.percentage(None)
+ try:
+ d = PackageKitDpkgInstallProgress(self)
+ d.startUpdate()
+ d.recover()
+ d.finishUpdate()
+ except:
+ pass
+ self._open_cache(prange)
+
+ def _commit_changes(self, fetch_range=(5,50), install_range=(50,90)):
+ """
+ Commit changes to the cache and handle errors
+ """
+ try:
+ self._cache.commit(PackageKitFetchProgress(self, fetch_range),
+ PackageKitInstallProgress(self, install_range))
+ except apt.cache.FetchFailedException, e:
+ self._open_cache(prange=(95,100))
+ pklog.critical(_format_string(e.message))
+ self.error(ERROR_PACKAGE_DOWNLOAD_FAILED, _format_string(e.message))
+ except apt.cache.FetchCancelledException:
+ self._open_cache(prange=(95,100))
+ self._canceled.clear()
+ except InstallTimeOutPKError, e:
+ self._recover()
+ self._open_cache(prange=(95,100))
+ #FIXME: should provide more information
+ self.error(ERROR_UNKNOWN,
+ "Transaction was cancelled since the installation "
+ "of a package hung.\n"
+ "This can be caused by maintainer scripts which "
+ "require input on the terminal:\n%s" % e.message)
+ except PackageManagerFailedPKError, e:
+ self._recover()
+ self.error(ERROR_UNKNOWN, "%s\n%s" % (e.message, e.output))
+ else:
+ return True
+ return False
+
+ def _check_init(self, prange=(0,10), progress=True):
+ '''
+ Check if the backend was initialized well and try to recover from
+ a broken setup
+ '''
+ pklog.debug("Checking apt cache and xapian database")
+ pkg_cache = os.path.join(apt_pkg.Config["Dir"],
+ apt_pkg.Config["Dir::Cache"],
+ apt_pkg.Config["Dir::Cache::pkgcache"])
+ src_cache = os.path.join(apt_pkg.Config["Dir"],
+ apt_pkg.Config["Dir::Cache"],
+ apt_pkg.Config["Dir::Cache::srcpkgcache"])
+ # Check if the cache instance is of the coorect class type, contains
+ # any broken packages and if the dpkg status or apt cache files have
+ # been changed since the last refresh
+ if not isinstance(self._cache, apt.cache.Cache) or \
+ (self._cache._depcache.BrokenCount > 0) or \
+ (os.stat(apt_pkg.Config["Dir::State::status"])[stat.ST_MTIME] > \
+ self._last_cache_refresh) or \
+ (os.stat(pkg_cache)[stat.ST_MTIME] > self._last_cache_refresh) or \
+ (os.stat(src_cache)[stat.ST_MTIME] > self._last_cache_refresh):
+ pklog.debug("Reloading the cache is required")
+ self._open_cache(prange, progress)
+ else:
+ pass
+ self._cache.clear()
+
+ def get_id_from_package(self, pkg, force_candidate=False):
+ '''
+ Return the packagekit id of package. By default this will be the
+ installed version for installed packages and the candidate version
+ for not installed packages.
+
+ The force_candidate option will also report the id of the candidate
+ version for installed packages.
+ '''
+ origin = ""
+ cand_origin = pkg.candidateOrigin
+ if not pkg.isInstalled or force_candidate:
+ version = pkg.candidateVersion
+ if cand_origin:
+ origin = cand_origin[0].label
+ else:
+ version = pkg.installedVersion
+ if cand_origin and cand_origin[0].site != "" and \
+ pkg.installedVersion == pkg.candidateVersion:
+ origin = cand_origin[0].label
+ id = self._get_package_id(pkg.name, version, pkg.architecture, origin)
+ return id
+
+ def _emit_package(self, pkg, info=None, force_candidate=False):
+ '''
+ Send the Package signal for a given apt package
+ '''
+ id = self.get_id_from_package(pkg, force_candidate)
+ section = pkg.section.split("/")[-1]
+ if info == None:
+ if pkg.isInstalled:
+ if section == "metapackages":
+ info = INFO_COLLECTION_INSTALLED
+ else:
+ info = INFO_INSTALLED
+ else:
+ if section == "metapackages":
+ info = INFO_COLLECTION_AVAILABLE
+ else:
+ info = INFO_AVAILABLE
+ summary = pkg.summary
+ self.package(id, info, summary)
+
+ def _emit_visible_package(self, filters, pkg, info=None):
+ """
+ Filter and emit a package
+ """
+ if self._is_package_visible(pkg, filters):
+ self._emit_package(pkg, info)
+
+ def _emit_visible_packages(self, filters, pkgs, info=None):
+ """
+ Filter and emit packages
+ """
+ for p in pkgs:
+ if self._is_package_visible(p, filters):
+ self._emit_package(p, info)
+
+ def _emit_visible_packages_by_name(self, filters, pkgs, info=None):
+ """
+ Find the packages with the given namens. Afterwards filter and emit
+ them
+ """
+ for name in pkgs:
+ if self._cache.has_key(name) and \
+ self._is_package_visible(self._cache[name], filters):
+ self._emit_package(self._cache[name], info)
+
+
+ def _is_package_visible(self, pkg, filters):
+ '''
+ Return True if the package should be shown in the user interface
+ '''
+ if filters == FILTER_NONE:
+ return True
+ for filter in filters.split(";"):
+ if (filter == FILTER_INSTALLED and not pkg.isInstalled) or \
+ (filter == FILTER_NOT_INSTALLED and pkg.isInstalled) or \
+ (filter == FILTER_SUPPORTED and not \
+ self._is_package_supported(pkg)) or \
+ (filter == FILTER_NOT_SUPPORTED and \
+ self._is_package_supported(pkg)) or \
+ (filter == FILTER_FREE and not self._is_package_free(pkg)) or \
+ (filter == FILTER_NOT_FREE and \
+ not self._is_package_not_free(pkg)) or \
+ (filter == FILTER_GUI and not self._has_package_gui(pkg)) or \
+ (filter == FILTER_NOT_GUI and self._has_package_gui(pkg)) or \
+ (filter == FILTER_COLLECTIONS and not \
+ self._is_package_collection(pkg)) or \
+ (filter == FILTER_NOT_COLLECTIONS and \
+ self._is_package_collection(pkg)) or\
+ (filter == FILTER_DEVELOPMENT and not \
+ self._is_package_devel(pkg)) or \
+ (filter == FILTER_NOT_DEVELOPMENT and \
+ self._is_package_devel(pkg)):
+ return False
+ return True
+
+ def _is_package_not_free(self, pkg):
+ """
+ Return True if we can be sure that the package's license isn't any
+ free one
+ """
+ candidate = pkg.candidateOrigin
+ return candidate != None and \
+ ((candidate[0].origin == "Ubuntu" and \
+ candidate[0].component in ["multiverse", "restricted"]) or \
+ (candidate[0].origin == "Debian" and \
+ candidate[0].component in ["contrib", "non-free"])) and \
+ candidate[0].trusted == True
+
+ def _is_package_collection(self, pkg):
+ """
+ Return True if the package is a metapackge
+ """
+ section = pkg.section.split("/")[-1]
+ return section == "metapackages"
+
+ def _is_package_free(self, pkg):
+ """
+ Return True if we can be sure that the package has got a free license
+ """
+ candidate = pkg.candidateOrigin
+ return candidate != None and \
+ ((candidate[0].origin == "Ubuntu" and \
+ candidate[0].component in ["main", "universe"]) or \
+ (candidate[0].origin == "Debian" and \
+ candidate[0].component == "main")) and\
+ candidate[0].trusted == True
+
+ def _has_package_gui(self, pkg):
+ #FIXME: should go to a modified Package class
+ #FIXME: take application data into account. perhaps checking for
+ # property in the xapian database
+ return pkg.section.split('/')[-1].lower() in ['x11', 'gnome', 'kde']
+
+ def _is_package_devel(self, pkg):
+ #FIXME: should go to a modified Package class
+ return pkg.name.endswith("-dev") or pkg.name.endswith("-dbg") or \
+ pkg.section.split('/')[-1].lower() in ['devel', 'libdevel']
+
+ def _is_package_supported(self, pkg):
+ candidate = pkg.candidateOrigin[0]
+ return candidate != None and \
+ candidate[0].origin == "Ubuntu" and \
+ candidate[0].component in ["main", "restricted"] and \
+ candidate[0].trusted == True
+
+ def _get_pkg_version_by_id(self, id):
+ '''
+ Return a package version matching the given package id or None.
+ '''
+ name, version, arch, data = id.split(";", 4)
+ if self._cache.has_key(name):
+ for pkg_ver in self._cache[name].versions:
+ if pkg_ver.version == version and \
+ pkg_ver.architecture == arch:
+ return pkg_ver
+ return None
+
+ def _find_package_by_id(self, id):
+ '''
+ Return a package matching to the given package id
+ '''
+ # FIXME: Should use package.Version
+ name, version, arch, data = id.split(";", 4)
+ if self._cache.has_key(name):
+ return self._cache[name]
+ else:
+ return None
+
+ def _get_installed_files(self, pkg):
+ """
+ Return the list of unicode names of the files which have
+ been installed by the package
+
+ This method should be obsolete by the apt.package.Package.installedFiles
+ attribute as soon as the consolidate branch of python-apt gets merged
+ """
+ path = os.path.join(apt_pkg.Config["Dir"],
+ "var/lib/dpkg/info/%s.list" % pkg.name)
+ try:
+ list = open(path)
+ files = list.read().decode().split("\n")
+ list.close()
+ except:
+ return []
+ return files
+
+ def _get_changelog(self, pkg, uri=None, cancel_lock=None):
+ """
+ Download the changelog of the package and return it as unicode
+ string
+
+ This method is already part of the consolidate branch of python-apt
+
+ uri: Is the uri to the changelog file. The following named variables
+ will be substituted: src_section, prefix, src_pkg and src_ver
+ For example the Ubuntu changelog:
+ uri = "http://changelogs.ubuntu.com/changelogs/pool" \\
+ "/%(src_section)s/%(prefix)s/%(src_pkg)s" \\
+ "/%(src_pkg)s_%(src_ver)s/changelog"
+ cancel_lock: If this threading.Lock() is set, the download will be
+ canceled
+ """
+ if uri == None:
+ if pkg.candidateOrigin[0].origin == "Debian":
+ uri = "http://packages.debian.org/changelogs/pool" \
+ "/%(src_section)s/%(prefix)s/%(src_pkg)s" \
+ "/%(src_pkg)s_%(src_ver)s/changelog"
+ elif pkg.candidateOrigin[0].origin == "Ubuntu":
+ uri = "http://changelogs.ubuntu.com/changelogs/pool" \
+ "/%(src_section)s/%(prefix)s/%(src_pkg)s" \
+ "/%(src_pkg)s_%(src_ver)s/changelog"
+ else:
+ return "The list of changes is not available"
+
+ # get the src package name
+ src_pkg = pkg.sourcePackageName
+
+ # assume "main" section
+ src_section = "main"
+ # use the section of the candidate as a starting point
+ section = self._cache._depcache.GetCandidateVer(pkg._pkg).Section
+
+ # get the source version, start with the binaries version
+ bin_ver = pkg.candidateVersion
+ src_ver = pkg.candidateVersion
+ #print "bin: %s" % binver
+ try:
+ # try to get the source version of the pkg, this differs
+ # for some (e.g. libnspr4 on ubuntu)
+ # this feature only works if the correct deb-src are in the
+ # sources.list
+ # otherwise we fall back to the binary version number
+ src_records = apt_pkg.GetPkgSrcRecords()
+ src_rec = src_records.Lookup(src_pkg)
+ if src_rec:
+ src_ver = src_records.Version
+ #if apt_pkg.VersionCompare(binver, srcver) > 0:
+ # srcver = binver
+ if not src_ver:
+ src_ver = bin_ver
+ #print "srcver: %s" % src_ver
+ section = src_records.Section
+ #print "srcsect: %s" % section
+ else:
+ # fail into the error handler
+ raise SystemError
+ except SystemError, e:
+ src_ver = bin_ver
+
+ l = section.split("/")
+ if len(l) > 1:
+ src_section = l[0]
+
+ # lib is handled special
+ prefix = src_pkg[0]
+ if src_pkg.startswith("lib"):
+ prefix = "lib" + src_pkg[3]
+
+ # stip epoch
+ l = src_ver.split(":")
+ if len(l) > 1:
+ src_ver = "".join(l[1:])
+
+ uri = uri % {"src_section" : src_section,
+ "prefix" : prefix,
+ "src_pkg" : src_pkg,
+ "src_ver" : src_ver}
+ try:
+ # Check if the download was canceled
+ if cancel_lock and cancel_lock.isSet(): return ""
+ changelog_file = urllib2.urlopen(uri)
+ # do only get the lines that are new
+ changelog = ""
+ regexp = "^%s \((.*)\)(.*)$" % (re.escape(src_pkg))
+
+ i=0
+ while True:
+ # Check if the download was canceled
+ if cancel_lock and cancel_lock.isSet(): return ""
+ # Read changelog line by line
+ line_raw = changelog_file.readline()
+ if line_raw == "":
+ break
+ # The changelog is encoded in utf-8, but since there isn't any
+ # http header, urllib2 seems to treat it as ascii
+ line = line_raw.decode("utf-8")
+
+ #print line.encode('utf-8')
+ match = re.match(regexp, line)
+ if match:
+ # strip epoch from installed version
+ # and from changelog too
+ installed = pkg.installedVersion
+ if installed and ":" in installed:
+ installed = installed.split(":",1)[1]
+ changelog_ver = match.group(1)
+ if changelog_ver and ":" in changelog_ver:
+ changelog_ver = changelog_ver.split(":", 1)[1]
+ if installed and \
+ apt_pkg.VersionCompare(changelog_ver, installed) <= 0:
+ break
+ # EOF (shouldn't really happen)
+ changelog += line
+
+ # Print an error if we failed to extract a changelog
+ if len(changelog) == 0:
+ changelog = "The list of changes is not available"
+ except urllib2.HTTPError,e:
+ return "The list of changes is not available yet.\n\n" \
+ "Please use http://launchpad.net/ubuntu/+source/%s/%s/" \
+ "+changelog\n" \
+ "until the changes become available or try again " \
+ "later." % (src_pkg, src_ver)
+ except IOError, httplib.BadStatusLine:
+ return "Failed to download the list of changes.\nPlease " \
+ "check your Internet connection."
+ return changelog
+
+ def _get_package_group(self, pkg):
+ """
+ Return the packagekit group corresponding to the package's section
+ """
+ section = pkg.section.split("/")[-1]
+ if SECTION_GROUP_MAP.has_key(section):
+ return SECTION_GROUP_MAP[section]
+ else:
+ pklog.debug("Unkown package section %s of %s" % (pkg.section,
+ pkg.name))
+ return GROUP_UNKNOWN
+
+ def _get_package_description(self, pkg):
+ """
+ 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 ""
+ # get the translated description
+ ver = self._cache._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)" % (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
+ raw_line = lines[i]
+ if raw_line.strip() == ".":
+ # The line is just line break
+ if not desc.endswith("\n"):
+ desc += "\n"
+ continue
+ 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:
+ line = raw_line
+ pklog.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
+
+ def _get_package_id(self, name, version, arch, data):
+ return ";".join((name, version, arch, data))
+
+ def _sigquit(self, signum, frame):
+ self._unlock_cache()
+ sys.exit(1)
+
+def debug_exception(type, value, tb):
+ """
+ Provides an interactive debugging session on unhandled exceptions
+ See http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65287
+ """
+ if hasattr(sys, 'ps1') or not sys.stderr.isatty() or \
+ not sys.stdin.isatty() or not sys.stdout.isatty() or type==SyntaxError:
+ # Calls the default handler in interactive mode, if output is·
+ # redirected or on syntax errors
+ sys.__excepthook__(type, value, tb)
+ else:
+ import traceback, pdb
+ traceback.print_exception(type, value, tb)
+ print
+ pdb.pm()
+
+def _text_to_bool(text):
+ """
+ Interpret a string as boolean value.
+ """
+ #FIXME: Should be part of the backend package
+ if text.lower() in ["yes", "true"]:
+ return True
+ return False
+
+def _format_string(txt, encoding='utf-8'):
+ #FIXME: Should be part of the backend package
+ if not isinstance(txt, unicode):
+ txt = unicode(txt, encoding, errors='replace')
+ return txt.replace("\n", ";")
+
+
+def run(args, single=False):
+ """
+ Start the apt backend
+ """
+ backend = PackageKitAptBackend("")
+ if single == True:
+ backend.dispatch_command(args[0], args[1:])
+ else:
+ backend.dispatcher(args)
+
+def main():
+ parser = optparse.OptionParser(description="APT backend for PackageKit")
+ parser.add_option("-r", "--root",
+ action="store", type="string", dest="root",
+ help="Use the given directory as the system root "
+ "(Only needed by developers)")
+ parser.add_option("-p", "--profile",
+ action="store", type="string", dest="profile",
+ help="Store profiling stats in the given file "
+ "(Only needed by developers)")
+ parser.add_option("-d", "--debug",
+ action="store_true", dest="debug",
+ help="Show a lot of additional information and drop to "
+ "a debugging console on unhandled exceptions "
+ "(Only needed by developers)")
+ parser.add_option("-s", "--single",
+ action="store_true", dest="single",
+ help="Only perform one command and don't listen on stdin "
+ "(Only needed by developers)")
+ (options, args) = parser.parse_args()
+ if options.debug:
+ pklog.setLevel(logging.DEBUG)
+ sys.excepthook = debug_exception
+
+ if options.root:
+ config = apt_pkg.Config
+ config.Set("Dir", options.root)
+ config.Set("Dir::State::status",
+ os.path.join(options.root, "/var/lib/dpkg/status"))
+
+ if options.profile:
+ import hotshot
+ prof = hotshot.Profile(options.profile)
+ prof.runcall(run, args, options.single)
+ prof.close()
+ else:
+ run(args, options.single)
+
+if __name__ == '__main__':
+ main()
+
+# vim: ts=4 et sts=4
diff --git a/backends/apt/aptbackend.py b/backends/apt/aptbackend.py
deleted file mode 100755
index ab64945..0000000
--- a/backends/apt/aptbackend.py
+++ /dev/null
@@ -1,2003 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-"""
-Provides an apt backend to PackageKit
-
-Copyright (C) 2007 Ali Sabil <ali.sabil at gmail.com>
-Copyright (C) 2007 Tom Parker <palfrey at tevp.net>
-Copyright (C) 2008-2009 Sebastian Heinlein <glatzor at ubuntu.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.
-"""
-
-__author__ = "Sebastian Heinlein <devel at glatzor.de>"
-
-import errno
-import fcntl
-import gdbm
-import httplib
-import locale
-import logging
-import logging.handlers
-import optparse
-import os
-import pty
-import re
-import signal
-import shutil
-import socket
-import stat
-import string
-import subprocess
-import sys
-import time
-import urllib2
-import warnings
-
-import apt
-import apt.debfile
-import apt_pkg
-import dbus
-import dbus.glib
-import dbus.service
-import dbus.mainloop.glib
-import gobject
-
-from packagekit.backend import *
-from packagekit.progress import *
-from packagekit.package import *
-from packagekit.enums import *
-
-logging.basicConfig(format="%(levelname)s:%(message)s")
-pklog = logging.getLogger("PackageKitBackend")
-pklog.setLevel(logging.NOTSET)
-
-_syslog = logging.handlers.SysLogHandler("/dev/log",
- logging.handlers.SysLogHandler.LOG_DAEMON)
-formatter = logging.Formatter('PackageKit: %(levelname)s: %(message)s')
-_syslog.setFormatter(formatter)
-pklog.addHandler(_syslog)
-
-# Xapian database is optionally used to speed up package description search
-XAPIAN_DB_PATH = os.environ.get("AXI_DB_PATH", "/var/lib/apt-xapian-index")
-XAPIAN_DB = XAPIAN_DB_PATH + "/index"
-XAPIAN_DB_VALUES = XAPIAN_DB_PATH + "/values"
-XAPIAN_SUPPORT = False
-try:
- import xapian
-except ImportError:
- pass
-else:
- if os.access(XAPIAN_DB, os.R_OK):
- pklog.debug("Use XAPIAN for the search")
- XAPIAN_SUPPORT = True
-
-# SoftwareProperties is required to proivde information about repositories
-try:
- import softwareproperties.SoftwareProperties
-except ImportError:
- REPOS_SUPPORT = False
-else:
- REPOS_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)
-
-# Required for daemon mode
-os.putenv("PATH",
- "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin")
-# Avoid questions from the maintainer scripts as far as possible
-os.putenv("DEBIAN_FRONTEND", "noninteractive")
-os.putenv("APT_LISTCHANGES_FRONTEND", "none")
-
-# Map Debian sections to the PackageKit group name space
-SECTION_GROUP_MAP = {
- "admin" : GROUP_ADMIN_TOOLS,
- "base" : GROUP_SYSTEM,
- "comm" : GROUP_COMMUNICATION,
- "devel" : GROUP_PROGRAMMING,
- "doc" : GROUP_DOCUMENTATION,
- "editors" : GROUP_PUBLISHING,
- "electronics" : GROUP_ELECTRONICS,
- "embedded" : GROUP_SYSTEM,
- "games" : GROUP_GAMES,
- "gnome" : GROUP_DESKTOP_GNOME,
- "graphics" : GROUP_GRAPHICS,
- "hamradio" : GROUP_COMMUNICATION,
- "interpreters" : GROUP_PROGRAMMING,
- "kde" : GROUP_DESKTOP_KDE,
- "libdevel" : GROUP_PROGRAMMING,
- "libs" : GROUP_SYSTEM,
- "mail" : GROUP_INTERNET,
- "math" : GROUP_SCIENCE,
- "misc" : GROUP_OTHER,
- "net" : GROUP_NETWORK,
- "news" : GROUP_INTERNET,
- "oldlibs" : GROUP_LEGACY,
- "otherosfs" : GROUP_SYSTEM,
- "perl" : GROUP_PROGRAMMING,
- "python" : GROUP_PROGRAMMING,
- "science" : GROUP_SCIENCE,
- "shells" : GROUP_SYSTEM,
- "sound" : GROUP_MULTIMEDIA,
- "tex" : GROUP_PUBLISHING,
- "text" : GROUP_PUBLISHING,
- "utils" : GROUP_ACCESSORIES,
- "web" : GROUP_INTERNET,
- "x11" : GROUP_DESKTOP_OTHER,
- "unknown" : GROUP_UNKNOWN,
- "alien" : GROUP_UNKNOWN,
- "translations" : GROUP_LOCALIZATION,
- "metapackages" : GROUP_COLLECTIONS }
-
-# Regular expressions to detect bug numbers in changelogs according to the
-# Debian Policy Chapter 4.4. For details see the footnote 16:
-# http://www.debian.org/doc/debian-policy/footnotes.html#f16
-MATCH_BUG_CLOSES_DEBIAN=r"closes:\s*(?:bug)?\#?\s?\d+(?:,\s*(?:bug)?\#?\s?\d+)*"
-MATCH_BUG_NUMBERS=r"\#?\s?(\d+)"
-# URL pointing to a bug in the Debian bug tracker
-HREF_BUG_DEBIAN="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=%s"
-
-# Regular expression to find cve references
-MATCH_CVE="CVE-\d{4}-\d{4}"
-HREF_CVE="http://web.nvd.nist.gov/view/vuln/detail?vulnId=%s"
-
-def unlock_cache_afterwards(func):
- '''
- Make sure that the package cache is unlocked after the decorated function
- was called
- '''
- def wrapper(*args, **kwargs):
- backend = args[0]
- func(*args, **kwargs)
- backend._unlock_cache()
- wrapper.__name__ = func.__name__
- return wrapper
-
-
-class PKError(Exception):
- pass
-
-class PackageManagerFailedPKError(PKError):
- def __init__(self, msg, pkg, output):
- self.message = msg
- self.package = pkg
- self.output = output
-
-class InstallTimeOutPKError(PKError):
- pass
-
-class PackageKitCache(apt.cache.Cache):
- """
- Enhanced version of the apt.cache.Cache class which supports some features
- which can only be found in the consolidate branch of python-apt
- """
- def __iter__(self):
- """
- Let the cache behave like a sorted list of packages
- """
- for pkgname in sorted(self._dict.keys()):
- yield self._dict[pkgname]
- raise StopIteration
-
-
-class DpkgInstallProgress(apt.progress.InstallProgress):
- """
- Class to initiate and monitor installation of local package files with dpkg
- """
- #FIXME: Use the merged DpkgInstallProgress of python-apt
- def recover(self):
- """
- Run "dpkg --configure -a"
- """
- cmd = ["/usr/bin/dpkg", "--status-fd", str(self.writefd),
- "--root", apt_pkg.Config["Dir"],
- "--force-confdef", "--force-confold",
- "--configure", "-a"]
- self.run(cmd)
-
- def install(self, filenames):
- """
- Install the given package using a dpkg command line call
- """
- cmd = ["/usr/bin/dpkg", "--force-confdef", "--force-confold",
- "--status-fd", str(self.writefd),
- "--root", apt_pkg.Config["Dir"], "-i"]
- cmd.extend(map(lambda f: str(f), filenames))
- self.run(cmd)
-
- def run(self, cmd):
- """
- Run and monitor a dpkg command line call
- """
- pklog.debug("Executing: %s" % cmd)
- (self.master_fd, slave) = pty.openpty()
- fcntl.fcntl(self.master_fd, fcntl.F_SETFL, os.O_NONBLOCK)
- p = subprocess.Popen(cmd, stdout=slave, stdin=slave)
- self.child_pid = p.pid
- res = self.waitChild()
- return res
-
- def updateInterface(self):
- """
- Process status messages from dpkg
- """
- if self.statusfd == None:
- return
- try:
- while not self.read.endswith("\n"):
- self.read += os.read(self.statusfd.fileno(), 1)
- except OSError, (error_no, error_str):
- # resource temporarly unavailable is ignored
- if error_no not in [errno.EAGAIN, errno.EWOULDBLOCK]:
- pklog.warn(error_str)
- if self.read.endswith("\n"):
- statusl = string.split(self.read, ":")
- if len(statusl) < 3:
- pklog.warn("got garbage from dpkg: '%s'" % self.read)
- self.read = ""
- status = statusl[2].strip()
- pkg = statusl[1].strip()
- #print status
- if status == "error":
- self.error(pkg, status)
- elif status == "conffile-prompt":
- # we get a string like this:
- # 'current-conffile' 'new-conffile' useredited distedited
- match = re.search(".+conffile-prompt : '(.+)' '(.+)'",
- self.read)
- self.conffile(match.group(1), match.group(2))
- else:
- pklog.debug("Dpkg status: %s" % status)
- self.status = status
- self.read = ""
-
-
-class PackageKitOpProgress(apt.progress.OpProgress):
- '''
- Handle the cache opening process
- '''
- def __init__(self, backend, prange=(0,100), progress=True):
- self._backend = backend
- apt.progress.OpProgress.__init__(self)
- self.steps = []
- for v in [0.12, 0.25, 0.50, 0.75, 1.00]:
- s = prange[0] + (prange[1] - prange[0]) * v
- self.steps.append(s)
- self.pstart = float(prange[0])
- self.pend = self.steps.pop(0)
- self.pprev = None
- self.show_progress = progress
-
- # OpProgress callbacks
- def update(self, percent):
- progress = int(self.pstart + percent / 100 * (self.pend - self.pstart))
- if self.show_progress == True and self.pprev < progress:
- self._backend.percentage(progress)
- self.pprev = progress
-
- def done(self):
- self.pstart = self.pend
- try:
- self.pend = self.steps.pop(0)
- except:
- pklog.warning("An additional step to open the cache is required")
-
-
-class PackageKitFetchProgress(apt.progress.FetchProgress):
- '''
- Handle the package download process
- '''
- def __init__(self, backend, prange=(0,100)):
- self._backend = backend
- apt.progress.FetchProgress.__init__(self)
- self.pstart = prange[0]
- self.pend = prange[1]
- self.pprev = None
-
- def pulse(self):
- apt.progress.FetchProgress.pulse(self)
- progress = int(self.pstart + self.percent/100 * \
- (self.pend - self.pstart))
- if self.pprev < progress:
- self._backend.percentage(progress)
- self.pprev = progress
- return True
-
- def start(self):
- self._backend.status(STATUS_DOWNLOAD)
- self._backend.allow_cancel(True)
-
- def stop(self):
- self._backend.percentage(self.pend)
- self._backend.allow_cancel(False)
-
- def mediaChange(self, medium, drive):
- #FIXME: Raise an expcetion and handle it in _commit_changes
- # Strangly _commit_changes does not catch the expcetion
- self._backend.message(MESSAGE_UNKNOWN,
- "Installing from CD-Rom (%s) is not "
- "supported." % medium)
- return False
-
-
-class PackageKitInstallProgress(apt.progress.InstallProgress):
- '''
- Handle the installation and removal process. Bits taken from
- DistUpgradeViewNonInteractive.
- '''
- def __init__(self, backend, prange=(0,100)):
- apt.progress.InstallProgress.__init__(self)
- self._backend = backend
- self.pstart = prange[0]
- self.pend = prange[1]
- self.pprev = None
- self.last_activity = None
- self.conffile_prompts = set()
- # insanly long timeout to be able to kill hanging maintainer scripts
- self.timeout = 10 * 60
- self.start_time = None
- self.output = ""
- self.master_fd = None
- self.child_pid = None
-
- def statusChange(self, pkg, percent, status):
- self.last_activity = time.time()
- progress = self.pstart + percent/100 * (self.pend - self.pstart)
- if self.pprev < progress:
- self._backend.percentage(int(progress))
- self.pprev = progress
- pklog.debug("APT status: %s" % status)
-
- def startUpdate(self):
- # The apt system lock was set by _lock_cache() before
- self._backend._unlock_cache()
- self._backend.status(STATUS_COMMIT)
- self.last_activity = time.time()
- self.start_time = time.time()
-
- def fork(self):
- pklog.debug("fork()")
- (pid, self.master_fd) = pty.fork()
- if pid != 0:
- fcntl.fcntl(self.master_fd, fcntl.F_SETFL, os.O_NONBLOCK)
- return pid
-
- def updateInterface(self):
- apt.progress.InstallProgress.updateInterface(self)
- # Collect the output from the package manager
- try:
- out = os.read(self.master_fd, 512)
- self.output = self.output + out
- pklog.debug("APT out: %s " % out)
- except OSError:
- pass
- # catch a time out by sending crtl+c
- if self.last_activity + self.timeout < time.time():
- pklog.critical("no activity for %s time sending ctrl-c" \
- % self.timeout)
- os.write(self.master_fd, chr(3))
- #FIXME: include this into the normal install progress and add
- # correct package information
- raise InstallTimeOutPKError(self.output)
-
- def conffile(self, current, new):
- pklog.warning("Config file prompt: '%s' (sending no)" % current)
- self.conffile_prompts.add(new)
-
- def error(self, pkg, msg):
- raise PackageManagerFailedPKError(pkg, msg, self.output)
-
- def finishUpdate(self):
- pklog.debug("finishUpdate()")
- if self.conffile_prompts:
- self._backend.message(MESSAGE_CONFIG_FILES_CHANGED,
- "The following conffile prompts were found "
- "and need investiagtion: %s" % \
- "\n".join(self.conffile_prompts))
- # Check for required restarts
- if os.path.exists("/var/run/reboot-required") and \
- os.path.getmtime("/var/run/reboot-required") > self.start_time:
- self._backend.RequireRestart(RESTART_SYSTEM, "")
-
-
-class PackageKitDpkgInstallProgress(DpkgInstallProgress,
- PackageKitInstallProgress):
- """
- Class to integrate the progress of core dpkg operations into PackageKit
- """
- def run(self, filenames):
- return DpkgInstallProgress.run(self, filenames)
-
- def updateInterface(self):
- DpkgInstallProgress.updateInterface(self)
- try:
- out = os.read(self.master_fd, 512)
- self.output += out
- if out != "": pklog.debug("Dpkg out: %s" % out)
- except OSError:
- pass
- # we timed out, send ctrl-c
- if self.last_activity + self.timeout < time.time():
- pklog.critical("no activity for %s time sending "
- "ctrl-c" % self.timeout)
- os.write(self.master_fd, chr(3))
- raise InstallTimeOutPKError(self.output)
-
-
-if REPOS_SUPPORT == True:
- class PackageKitSoftwareProperties(softwareproperties.SoftwareProperties.SoftwareProperties):
- """
- Helper class to fix a siily bug in python-software-properties
- """
- def set_modified_sourceslist(self):
- self.save_sourceslist()
-
-
-class PackageKitAptBackend(PackageKitBaseBackend):
- '''
- PackageKit backend for apt
- '''
- def __init__(self, args):
- pklog.info("Initializing APT backend")
- signal.signal(signal.SIGQUIT, self._sigquit)
- self._cache = None
- self._last_cache_refresh = None
- apt_pkg.InitConfig()
- apt_pkg.Config.Set("DPkg::Options::", '--force-confdef')
- apt_pkg.Config.Set("DPkg::Options::", '--force-confold')
- PackageKitBaseBackend.__init__(self, args)
- self._open_cache(progress=False)
-
- # Methods ( client -> engine -> backend )
-
- def search_file(self, filters, filename):
- '''
- Implement the apt2-search-file functionality
-
- Apt specific: Works only for installed files. Since config files are
- not removed by default even not installed packages can be reported.
- '''
- pklog.info("Searching for file: %s" % filename)
- self.status(STATUS_QUERY)
- self.percentage(None)
- self._check_init(progress=False)
- self.allow_cancel(True)
-
- for pkg in self._cache:
- for installed_file in self._get_installed_files(pkg):
- if filename in installed_file:
- self._emit_visible_package(filters, pkg)
- break
-
- def search_group(self, filters, group):
- '''
- Implement the apt2-search-group functionality
- '''
- pklog.info("Searching for group: %s" % group)
- self.status(STATUS_QUERY)
- self.percentage(None)
- self._check_init(progress=False)
- self.allow_cancel(True)
-
- for pkg in self._cache:
- if self._get_package_group(pkg) == group:
- self._emit_visible_package(filters, pkg)
-
- def search_name(self, filters, search):
- '''
- Implement the apt2-search-name functionality
- '''
- pklog.info("Searching for package name: %s" % search)
- self.status(STATUS_QUERY)
- self.percentage(None)
- self._check_init(progress=False)
- self.allow_cancel(True)
-
- for pkg in self._cache:
- if search in pkg.name:
- self._emit_visible_package(filters, pkg)
-
- def search_details(self, filters, search):
- '''
- Implement the apt2-search-details functionality
- '''
- pklog.info("Searching for package name: %s" % search)
- self.status(STATUS_QUERY)
- self.percentage(None)
- self._check_init(progress=False)
- self.allow_cancel(True)
- results = []
-
- if XAPIAN_SUPPORT == True:
- search_flags = (xapian.QueryParser.FLAG_BOOLEAN |
- xapian.QueryParser.FLAG_PHRASE |
- xapian.QueryParser.FLAG_LOVEHATE |
- xapian.QueryParser.FLAG_BOOLEAN_ANY_CASE)
- pklog.debug("Performing xapian db based search")
- db = xapian.Database(XAPIAN_DB)
- parser = xapian.QueryParser()
- query = parser.parse_query(unicode(search),
- search_flags)
- enquire = xapian.Enquire(db)
- enquire.set_query(query)
- matches = enquire.get_mset(0, 1000)
- for r in map(lambda m: m[xapian.MSET_DOCUMENT].get_data(),
- enquire.get_mset(0,1000)):
- if self._cache.has_key(r):
- results.append(self._cache[r])
- else:
- pklog.debug("Performing apt cache based search")
- for p in self._cache._dict.values():
- needle = search.strip().lower()
- haystack = p.description.lower()
- if p.name.find(needle) >= 0 or haystack.find(needle) >= 0:
- results.append(p)
-
- for r in results:
- self._emit_visible_package(filters, r)
-
- def get_distro_upgrades(self):
- '''
- Implement the {backend}-get-distro-upgrades functionality
- '''
- pklog.info("Get distro upgrades")
- self.status(STATUS_INFO)
- self.allow_cancel(False)
- self.percentage(None)
-
- if META_RELEASE_SUPPORT == False:
- if self._cache.has_key("update-manager-core") and \
- self._cache["update-manager-core"].isInstalled == False:
- self.error(ERROR_UNKNOWN,
- "Please install the package update-manager-core to "
- "get notified of the latest distribution releases.")
- else:
- self.error(ERROR_UNKNOWN,
- "Please make sure that update-manager-core is"
- "correctly installed.")
- 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.distro_ppgrade("stable",
- "%s %s" % (meta_release.new_dist.name,
- meta_release.new_dist.version),
- "The latest stable release")
-
- def get_updates(self, filters):
- '''
- Implement the {backend}-get-update functionality
- '''
- def succeeds_security_update(pkg):
- """
- Return True if an update succeeds a previous security update
-
- An example would be a package with version 1.1 in the security
- archive and 1.1.1 in the archive of proposed updates or the
- same version in both archives.
- """
- inst_ver = pkg._pkg.CurrentVer
- for ver in pkg._pkg.VersionList:
- # Skip versions which are not later
- if inst_ver and \
- apt_pkg.VersionCompare(ver.VerStr, inst_ver.VerStr) <= 0:
- continue
- for(verFileIter, index) in ver.FileList:
- if verFileIter.Origin in ["Debian", "Ubuntu"] and \
- (verFileIter.Archive.endswith("-security") or \
- verFileIter.Label == "Debian-Security"):
- indexfile = pkg._list.FindIndex(verFileIter)
- if indexfile and indexfile.IsTrusted:
- return True
- return False
- #FIXME: Implment the basename filter
- pklog.info("Get updates")
- self.status(STATUS_QUERY)
- self.allow_cancel(True)
- self.percentage(None)
- self._check_init(progress=False)
- self._cache.upgrade(False)
- updates = filter(lambda p: self._cache[p].isUpgradable,
- self._cache.keys())
- for pkg in self._cache.getChanges():
- updates.remove(pkg.name)
- info = INFO_NORMAL
- archive = pkg.candidateOrigin[0].archive
- origin = pkg.candidateOrigin[0].origin
- trusted = pkg.candidateOrigin[0].trusted
- label = pkg.candidateOrigin[0].label
- if origin in ["Debian", "Ubuntu"] and trusted == True:
- if archive.endswith("-security") or \
- label == "Debian-Security":
- info = INFO_SECURITY
- elif succeeds_security_update(pkg):
- pklog.debug("Update of %s succeeds a security "
- "update. Raising its priority." % pkg.name)
- info = INFO_SECURITY
- elif archive.endswith("-backports"):
- info = INFO_ENHANCEMENT
- elif archive.endswith("-updates"):
- info = INFO_BUGFIX
- if origin in ["Backports.org archive"] and trusted == True:
- info = INFO_ENHANCEMENT
- self._emit_package(pkg, info, force_candidate=True)
- # Report packages that are upgradable but cannot be upgraded
- for missed in updates:
- self._emit_package(self._cache[missed], INFO_BLOCKED)
- self._cache.clear()
-
- def get_update_detail(self, pkg_ids):
- '''
- Implement the {backend}-get-update-details functionality
- '''
- def get_bug_urls(changelog):
- """
- Create a list of urls pointing to closed bugs in the changelog
- """
- urls = []
- #FIXME: Add support for Launchpad/Ubuntu
- for r in re.findall(MATCH_BUG_CLOSES_DEBIAN, changelog,
- re.IGNORECASE | re.MULTILINE):
- urls.extend(map(lambda b: HREF_BUG_DEBIAN % b,
- re.findall(MATCH_BUG_NUMBERS, r)))
- return urls
-
- def get_cve_urls(changelog):
- """
- Create a list of urls pointing to cves referred in the changelog
- """
- return map(lambda c: HREF_CVE % c,
- re.findall(MATCH_CVE, changelog, re.MULTILINE))
-
- pklog.info("Get update details of %s" % pkg_ids)
- self.status(STATUS_INFO)
- self.percentage(None)
- self.allow_cancel(True)
- self._check_init(progress=False)
- for pkg_id in pkg_ids:
- pkg = self._find_package_by_id(pkg_id)
- if pkg == None:
- self.error(ERROR_PACKAGE_NOT_FOUND,
- "Package %s isn't available" % id)
- return
- # FIXME add some real data
- updates = self.get_id_from_package(pkg, force_candidate=False)
- obsoletes = ""
- vendor_url = ""
- restart = "none"
- update_text = ""
- state = ""
- issued = ""
- updated = ""
- #FIXME: Replace this method with the python-apt one as soon as the
- # consolidate branch gets merged
- self.status(STATUS_DOWNLOAD_CHANGELOG)
- changelog = self._get_changelog(pkg)
- self.status(STATUS_INFO)
- bugzilla_url = ";".join(get_bug_urls(changelog))
- cve_url = ";".join(get_cve_urls(changelog))
- self.update_detail(pkg_id, updates, obsoletes, vendor_url,
- bugzilla_url, cve_url, restart, update_text,
- _format_string(changelog), state, issued,
- updated)
-
- def get_details(self, pkg_ids):
- '''
- Implement the {backend}-get-details functionality
- '''
- pklog.info("Get details of %s" % pkg_ids)
- self.status(STATUS_INFO)
- self.percentage(None)
- self.allow_cancel(True)
- self._check_init(progress=False)
- for pkg_id in pkg_ids:
- pkg = self._find_package_by_id(pkg_id)
- if pkg == None:
- self.error(ERROR_PACKAGE_NOT_FOUND,
- "Package %s isn't available" % id)
- return
- #FIXME: We need more fine grained license information!
- candidate = pkg.candidateOrigin
- if candidate != None and \
- candidate[0].component in ["main", "universe"] and \
- candidate[0].origin in ["Debian", "Ubuntu"]:
- license = "free"
- else:
- license = "unknown"
- group = self._get_package_group(pkg)
- self.details(pkg_id, license, group,
- _format_string(pkg.description),
- pkg.homepage, pkg.packageSize)
-
- @unlock_cache_afterwards
- def update_system(self):
- '''
- Implement the {backend}-update-system functionality
- '''
- pklog.info("Upgrading system")
- if not self._lock_cache(): return
- self.status(STATUS_UPDATE)
- self.allow_cancel(False)
- self.percentage(0)
- self._check_init(prange=(0,5))
- try:
- self._cache.upgrade(distUpgrade=False)
- except:
- self._cache.clear()
- self.error(ERROR_DEP_RESOLUTION_FAILED,
- "Failed to upgrade the system.")
- return
- if not self._commit_changes(): return False
- self.percentage(100)
-
- @unlock_cache_afterwards
- def remove_packages(self, allowdeps, ids):
- '''
- Implement the {backend}-remove functionality
- '''
- pklog.info("Removing package(s): id %s" % ids)
- if not self._lock_cache(): return
- self.status(STATUS_REMOVE)
- self.allow_cancel(False)
- self.percentage(0)
- self._check_init(prange=(0,10))
- pkgs=[]
- for id in ids:
- pkg = self._find_package_by_id(id)
- if pkg == None:
- self.error(ERROR_PACKAGE_NOT_FOUND,
- "Package %s isn't available" % id)
- return
- if not pkg.isInstalled:
- self.error(ERROR_PACKAGE_NOT_INSTALLED,
- "Package %s isn't installed" % pkg.name)
- return
- pkgs.append(pkg.name[:])
- if pkg._pkg.Essential == True:
- self.error(ERROR_CANNOT_REMOVE_SYSTEM_PACKAGE,
- "Package %s cannot be removed." % pkg.name)
- return
- try:
- pkg.markDelete()
- except:
- self._open_cache(prange=(90,99))
- self.error(ERROR_UNKNOWN, "Removal of %s failed" % pkg.name)
- return
- if not self._commit_changes(fetch_range=(10,10),
- install_range=(10,90)):
- return False
- self._open_cache(prange=(90,99))
- for p in pkgs:
- if self._cache.has_key(p) and self._cache[p].isInstalled:
- self.error(ERROR_UNKNOWN, "%s is still installed" % p)
- return
- self.percentage(100)
-
- def get_repo_list(self, filters):
- '''
- Implement the {backend}-get-repo-list functionality
-
- FIXME: should we use the abstration of software-properties or provide
- low level access using pure aptsources?
- '''
- pklog.info("Getting repository list: %s" % filters)
- self.status(STATUS_INFO)
- self.allow_cancel(False)
- self.percentage(0)
- if REPOS_SUPPORT == False:
- if self._cache.has_key("python-software-properties") and \
- self._cache["python-software-properties"].isInstalled == False:
- self.error(ERROR_UNKNOWN,
- "Please install the package "
- "python-software-properties to handle repositories")
- else:
- self.error(ERROR_UNKNOWN,
- "Please make sure that python-software-properties is"
- "correctly installed.")
- return
- filter_list = filters.split(";")
- repos = PackageKitSoftwareProperties()
- # Emit distro components as virtual repositories
- for comp in repos.distro.source_template.components:
- repo_id = "%s_comp_%s" % (repos.distro.id, comp.name)
- description = "%s %s - %s (%s)" % (repos.distro.id,
- repos.distro.release,
- comp.get_description(),
- comp.name)
- #FIXME: There is no inconsitent state in PackageKit
- enabled = repos.get_comp_download_state(comp)[0]
- if not FILTER_DEVELOPMENT in filter_list:
- self.repo_detail(repo_id, description, enabled)
- # Emit distro's virtual update repositories
- for template in repos.distro.source_template.children:
- repo_id = "%s_child_%s" % (repos.distro.id, template.name)
- description = "%s %s - %s (%s)" % (repos.distro.id,
- repos.distro.release,
- template.description,
- template.name)
- #FIXME: There is no inconsitent state in PackageKit
- enabled = repos.get_comp_child_state(template)[0]
- if not FILTER_DEVELOPMENT in filter_list:
- self.repo_detail(repo_id, description, enabled)
- # Emit distro's cdrom sources
- for source in repos.get_cdrom_sources():
- if FILTER_NOT_DEVELOPMENT in filter_list and \
- source.type in ("deb-src", "rpm-src"):
- continue
- enabled = not source.disabled
- # Remove markups from the description
- description = re.sub(r"</?b>", "", repos.render_source(source))
- repo_id = "cdrom_%s_%s" % (source.uri, source.dist)
- repo_id.join(map(lambda c: "_%s" % c, source.comps))
- self.repo_detail(repo_id, description, enabled)
- # Emit distro's virtual source code repositoriy
- if not FILTER_NOT_DEVELOPMENT in filter_list:
- repo_id = "%s_source" % repos.distro.id
- enabled = repos.get_source_code_state() or False
- #FIXME: no translation :(
- description = "%s %s - Source code" % (repos.distro.id,
- repos.distro.release)
- self.repo_detail(repo_id, description, enabled)
- # Emit third party repositories
- for source in repos.get_isv_sources():
- if FILTER_NOT_DEVELOPMENT in filter_list and \
- source.type in ("deb-src", "rpm-src"):
- continue
- enabled = not source.disabled
- # Remove markups from the description
- description = re.sub(r"</?b>", "", repos.render_source(source))
- repo_id = "isv_%s_%s" % (source.uri, source.dist)
- repo_id.join(map(lambda c: "_%s" % c, source.comps))
- self.repo_detail(repo_id, description, enabled)
-
- def repo_enable(self, repo_id, enable):
- '''
- Implement the {backend}-repo-enable functionality
-
- FIXME: should we use the abstration of software-properties or provide
- low level access using pure aptsources?
- '''
- pklog.info("Enabling repository: %s %s" % (repo_id, enable))
- self.status(STATUS_RUNNING)
- self.allow_cancel(False)
- self.percentage(0)
- if REPOS_SUPPORT == False:
- if self._cache.has_key("python-software-properties") and \
- self._cache["python-software-properties"].isInstalled == False:
- self.error(ERROR_UNKNOWN,
- "Please install the package "
- "python-software-properties to handle repositories")
- else:
- self.error(ERROR_UNKNOWN,
- "Please make sure that python-software-properties is"
- "correctly installed.")
- return
- repos = PackageKitSoftwareProperties()
-
- found = False
- # Check if the repo_id matches a distro component, e.g. main
- if repo_id.startswith("%s_comp_" % repos.distro.id):
- for comp in repos.distro.source_template.components:
- if repo_id == "%s_comp_%s" % (repos.distro.id, comp.name):
- if enable == repos.get_comp_download_state(comp)[0]:
- pklog.debug("Repository is already enabled")
- pass
- if enable == True:
- repos.enable_component(comp.name)
- else:
- repos.disable_component(comp.name)
- found = True
- break
- # Check if the repo_id matches a distro child repository, e.g. hardy-updates
- elif repo_id.startswith("%s_child_" % repos.distro.id):
- for template in repos.distro.source_template.children:
- if repo_id == "%s_child_%s" % (repos.distro.id, template.name):
- if enable == repos.get_comp_child_state(template)[0]:
- pklog.debug("Repository is already enabled")
- pass
- elif enable == True:
- repos.enable_child_source(template)
- else:
- repos.disable_child_source(template)
- found = True
- break
- # Check if the repo_id matches a cdrom repository
- elif repo_id.startswith("cdrom_"):
- for source in repos.get_isv_sources():
- source_id = "cdrom_%s_%s" % (source.uri, source.dist)
- source_id.join(map(lambda c: "_%s" % c, source.comps))
- if repo_id == source_id:
- if source.disabled == enable:
- source.disabled = not enable
- repos.save_sourceslist()
- else:
- pklog.debug("Repository is already enabled")
- found = True
- break
- # Check if the repo_id matches an isv repository
- elif repo_id.startswith("isv_"):
- for source in repos.get_isv_sources():
- source_id = "isv_%s_%s" % (source.uri, source.dist)
- source_id.join(map(lambda c: "_%s" % c, source.comps))
- if repo_id == source_id:
- if source.disabled == enable:
- source.disabled = not enable
- repos.save_sourceslist()
- else:
- pklog.debug("Repository is already enabled")
- found = True
- break
- if found == False:
- self.error(ERROR_REPO_NOT_AVAILABLE,
- "The repository of the id %s isn't available" % repo_id)
- return
-
- @unlock_cache_afterwards
- def update_packages(self, ids):
- '''
- Implement the {backend}-update functionality
- '''
- pklog.info("Updating package with id %s" % ids)
- if not self._lock_cache(): return
- self.status(STATUS_UPDATE)
- self.allow_cancel(False)
- self.percentage(0)
- self._check_init(prange=(0,10))
- pkgs=[]
- for id in ids:
- pkg = self._find_package_by_id(id)
- if pkg == None:
- self.error(ERROR_PACKAGE_NOT_FOUND,
- "Package %s isn't available" % id)
- return
- if not pkg.isUpgradable:
- self.error(ERROR_PACKAGE_ALREADY_INSTALLED,
- "Package %s is already up-to-date" % pkg.name)
- return
- pkgs.append(pkg.name[:])
- try:
- pkg.markUpgrade()
- except:
- self._open_cache(prange=(90,100))
- self.error(ERROR_UNKNOWN,
- "%s could not be queued for update" % pkg.name)
- return
- if not self._commit_changes(): return False
- self._open_cache(prange=(90,100))
- self.percentage(100)
- pklog.debug("Checking success of operation")
- for p in pkgs:
- if not self._cache.has_key(p) or not self._cache[p].isInstalled \
- or self._cache[p].isUpgradable:
- self.error(ERROR_UNKNOWN, "%s was not updated" % p)
- return
- pklog.debug("Sending success signal")
-
- def download_packages(self, dest, ids):
- '''
- Implement the {backend}-download-packages functionality
- '''
- def get_range(versions, total):
- """
- Calculate the start and end point of a package download progress.
- """
- downloaded = 0
- for ver in versions:
- start = downloaded * 100 / total
- end = start + ver.size * 100 / total
- yield ver, start, end
- downloaded += ver.size
- pklog.info("Downloading packages: %s" % ids)
- self.status(STATUS_DOWNLOAD)
- self.allow_cancel(True)
- self.percentage(0)
- # Check the destination directory
- if not os.path.isdir(dest) or not os.access(dest, os.W_OK):
- self.error(ERROR_UNKNOWN,
- "The directory '%s' is not writable" % dest)
- return
- # Setup the fetcher
- self._check_init(prange=(0,10))
- versions = []
- total = 0
- # Check if all ids are vaild and calculate the total download size
- for id in ids:
- pkg_ver = self._get_pkg_version_by_id(id)
- if pkg_ver is None:
- self.error(ERROR_PACKAGE_NOT_FOUND,
- "There is no package %s" % id)
- return
- if not pkg_ver.downloadable:
- self.error(ERROR_PACKAGE_DOWNLOAD_FAILED,
- "package %s isn't downloadable" % id)
- return
- total += pkg_ver.size
- versions.append(pkg_ver)
- # Start the download
- for ver, start, end in get_range(versions, total):
- progress = PackageKitFetchProgress(self, prange=(start, end))
- try:
- ver.fetch_binary(dest, progress)
- except Exception, error:
- self.error(ERROR_PACKAGE_DOWNLOAD_FAILED, error.message)
- return
- self.percentage(100)
-
- @unlock_cache_afterwards
- def install_packages(self, ids):
- '''
- Implement the {backend}-install functionality
- '''
- pklog.info("Installing package with id %s" % ids)
- if not self._lock_cache(): return
- self.status(STATUS_INSTALL)
- self.allow_cancel(False)
- self.percentage(0)
- self._check_init(prange=(0,10))
- pkgs=[]
- for id in ids:
- pkg = self._find_package_by_id(id)
- if pkg == None:
- self.error(ERROR_PACKAGE_NOT_FOUND,
- "Package %s isn't available" % id)
- return
- if pkg.isInstalled:
- self.error(ERROR_PACKAGE_ALREADY_INSTALLED,
- "Package %s is already installed" % pkg.name)
- return
- pkgs.append(pkg.name[:])
- try:
- pkg.markInstall()
- except Exception, e:
- self._open_cache(prange=(90,100))
- self.error(ERROR_UNKNOWN,
- "%s could not be queued for "
- "installation: %s" % (pkg.name,e))
- return
- if not self._commit_changes(): return False
- self._open_cache(prange=(90,100))
- self.percentage(100)
- pklog.debug("Checking success of operation")
- for p in pkgs:
- if not self._cache.has_key(p) or not self._cache[p].isInstalled:
- self.error(ERROR_UNKNOWN, "%s was not installed" % p)
- return
-
- @unlock_cache_afterwards
- def install_files(self, trusted, inst_files):
- '''
- Implement install-files for the apt backend
- Install local Debian package files
- '''
- pklog.info("Installing package files: %s" % inst_files)
- if not self._lock_cache(): return
- self.status(STATUS_INSTALL)
- self.allow_cancel(False)
- self.percentage(0)
- self._check_init(prange=(0,10))
- packages = []
- # Collect all dependencies which need to be installed
- self.status(STATUS_DEP_RESOLVE)
- for path in inst_files:
- deb = apt.debfile.DebPackage(path, self._cache)
- packages.append(deb)
- if not deb.check():
- self.error(ERROR_UNKNOWN, deb._failureString)
- return
- (install, remove, unauthenticated) = deb.requiredChanges
- pklog.debug("Changes: Install %s, Remove %s, Unauthenticated "
- "%s" % (install, remove, unauthenticated))
- if len(remove) > 0:
- self.error(ERROR_DEP_RESOLUTION_FAILED,
- "Remove the following packages "
- "before: %s" % remove)
- return
- if deb.compare_to_version_in_cache() == \
- apt.debfile.VERSION_OUTDATED:
- self.message(MESSAGE_NEWER_PACKAGE_EXISTS,
- "There is a later version of %s "
- "available in the repositories." % deb.pkgname)
- if len(self._cache.getChanges()) > 0 and not \
- self._commit_changes((10,25), (25,50)):
- return False
- # Install the Debian package files
- d = PackageKitDpkgInstallProgress(self)
- try:
- d.startUpdate()
- d.install(inst_files)
- d.finishUpdate()
- except InstallTimeOutPKError, e:
- self._recover()
- #FIXME: should provide more information
- self.error(ERROR_UNKNOWN,
- "Transaction was cancelled since the installation "
- "of a package hung.\n"
- "This can be caused by maintainer scripts which "
- "require input on the terminal:\n%s" % e.message)
- return
- except PackageManagerFailedPKError, e:
- self._recover()
- self.error(ERROR_UNKNOWN, "%s\n%s" % (e.message, e.output))
- return
- except Exception, e:
- self._recover()
- self.error(ERROR_INTERNAL_ERROR, e.message)
- return
- self.percentage(100)
-
- @unlock_cache_afterwards
- def refresh_cache(self):
- '''
- Implement the {backend}-refresh_cache functionality
- '''
- pklog.info("Refresh cache")
- if not self._lock_cache(): return
- self.status(STATUS_REFRESH_CACHE)
- self.last_action_time = time.time()
- self.allow_cancel(False);
- self.percentage(0)
- self._check_init((0,10))
- try:
- self._cache.update(PackageKitFetchProgress(self, prange=(10,95)))
- except Exception, e:
- self._open_cache(prange=(95,100))
- self.error(ERROR_UNKNOWN,
- "Refreshing cache failed: %s" % _format_string(e.message))
- return
- self._open_cache(prange=(95,100))
- self.percentage(100)
-
- def get_packages(self, filters):
- '''
- Implement the apt2-get-packages functionality
- '''
- pklog.info("Get all packages")
- self.status(STATUS_QUERY)
- self.percentage(None)
- self._check_init(progress=False)
- self.allow_cancel(True)
-
- for pkg in self._cache:
- if self._is_package_visible(pkg, filters):
- self._emit_package(pkg)
-
- def resolve(self, filters, names):
- '''
- Implement the apt2-resolve functionality
- '''
- pklog.info("Resolve")
- self.status(STATUS_QUERY)
- self.percentage(None)
- self._check_init(progress=False)
- self.allow_cancel(False)
-
- for name in names:
- if self._cache.has_key(name):
- self._emit_visible_package(filters, self._cache[name])
- else:
- self.error(ERROR_PACKAGE_NOT_FOUND,
- "Package name %s could not be resolved" % name)
- return
-
- def get_depends(self, filter, ids, recursive_text):
- '''
- Implement the apt2-get-depends functionality
-
- Emit all packages that need to be installed or updated to install
- the given package ids. It behaves like a preview of the changes
- required for the installation. An error will be emitted if the
- dependecies cannot be satisfied.
- In contrast to the yum backend the whole dependency resoltions is done
- by the package manager. Therefor the list of satisfied packages cannot
- be computed easily. GDebi features this. Perhaps this should be moved
- to python-apt.
- '''
- pklog.info("Get depends (%s,%s,%s)" % (filter, ids, recursive_text))
- recursive = _text_to_bool(recursive_text)
- #FIXME: recursive is not yet implemented
- if recursive == True:
- pklog.warn("Recursive dependencies are not implemented")
- self.status(STATUS_QUERY)
- self.percentage(None)
- self._check_init(progress=False)
- self.allow_cancel(True)
-
- # Mark all packages for installation
- pkgs = []
- for id in ids:
- pkg = self._find_package_by_id(id)
- if pkg == None:
- self.error(ERROR_PACKAGE_NOT_FOUND,
- "Package %s isn't available" % id)
- return
- try:
- pkg.markInstall()
- except Exception, e:
- #FIXME: Introduce a new info enumerate PK_INFO_MISSING for
- # missing dependecies
- self.error(ERROR_DEP_RESOLUTION_FAILED,
- "Dependecies for %s cannot be satisfied: %s" % e)
- return
- pkgs.append(pkg)
- # Check the status of the resulting changes
- for p in self._cache.getChanges():
- if p in pkgs: continue
- if p.markedDelete:
- # Packagekit policy forbids removing packages for installation
- self.error(ERROR_DEP_RESOLUTION_FAILED,
- "Remove the package %s before" % p.name)
- return
- elif p.markedInstall or p.markedUpgrade:
- if self._is_package_visible(p, filter):
- self._emit_package(p)
- else:
- self.error(ERROR_DEP_RESOLUTION_FAILED,
- "Please use an advanced package management tool "
- "e.g. Synaptic or aptitude, since there is a "
- "complex dependency situation.")
- return
- # Clean up
- self._cache.clear()
-
- def get_requires(self, filter, ids, recursive_text):
- '''
- Implement the apt2-get-requires functionality
- '''
- pklog.info("Get requires (%s,%s,%s)" % (filter, ids, recursive_text))
- recursive = _text_to_bool(rescursive_text)
- #FIXME: recursive is not yet implemented
- if recursive == True:
- pklog.warn("Recursive dependencies are not implemented")
- self.status(STATUS_DEP_RESOLVE)
- self.percentage(None)
- self._check_init(progress=False)
- self.allow_cancel(True)
- pkgs = []
-
- # Mark all packages for installation
- for id in ids:
- pkg = self._find_package_by_id(id)
- if pkg == None:
- self.error(ERROR_PACKAGE_NOT_FOUND,
- "Package %s isn't available" % id)
- return
- if pkg._pkg.Essential == True:
- self.error(ERROR_CANNOT_REMOVE_SYSTEM_PACKAGE,
- "Package %s cannot be removed." % pkg.name)
- return
- pkgs.append(pkg)
- try:
- pkg.markDelete()
- except Exception, e:
- #FIXME: Introduce a new info enumerate PK_INFO_MISSING for
- # missing dependecies
- self.error(ERROR_DEP_RESOLUTION_FAILED,
- "Error removing %s: %s" % (pkg.name, e))
- return
- # Check the status of the resulting changes
- for p in self._cache.getChanges():
- if p.markedDelete:
- if not p in pkgs and self._is_package_visible(p, filter):
- self._emit_package(p)
- else:
- self.error(ERROR_DEP_RESOLUTION_FAILED,
- "Please use an advanced package management tool "
- "e.g. Synaptic or aptitude, since there is a "
- "complex dependency situation.")
- return
- # Clean up
- self._cache.clear()
-
- def what_provides(self, filters, provides_type, search):
- def get_mapping_db(path):
- """
- Return the gdbm database at the given path or send an
- appropriate error message
- """
- if not os.access(path, os.R_OK):
- if self._cache.has_key("app-install-data") and \
- self._cache["app-install-data"].isInstalled == False:
- self.error(ERROR_UNKNOWN,
- "Please install the package "
- "app-install data for a list of "
- "applications that can handle files of "
- "the given type")
- else:
- self.error(ERROR_UNKNOWN,
- "The list of applications that can handle "
- "files of the given type cannot be opened.\n"
- "Try to reinstall the package "
- "app-install-data.")
- return None
- try:
- db = gdbm.open(path)
- except:
- self.error(ERROR_UNKNOWN,
- "The list of applications that can handle "
- "files of the given type cannot be opened.\n"
- "Try to reinstall the package "
- "app-install-data.")
- return None
- else:
- return db
-
- self.status(STATUS_QUERY)
- self.percentage(None)
- self._check_init(progress=False)
- self.allow_cancel(False)
- if provides_type == PROVIDES_CODEC:
- # The search term from the codec helper looks like this one:
- match = re.match(r"gstreamer([0-9\.]+)\((.+?)\)", search)
- if not match:
- self.error(ERROR_UNKNOWN,
- "The search term is invalid")
- return
- codec = "%s:%s" % (match.group(1), match.group(2))
- db = get_mapping_db("/var/lib/PackageKit/codec-map.gdbm")
- if db == None:
- self.error(ERROR_INTERNAL_ERROR,
- "Failed to open codec mapping database")
- return
- if db.has_key(codec):
- # The codec mapping db stores the packages as a string
- # separated by spaces. Each package has its section
- # prefixed and separated by a slash
- # FIXME: Should make use of the section and emit a
- # RepositoryRequired signal if the package does
- # not exist
- pkgs = map(lambda s: s.split("/")[1],
- db[codec].split(" "))
- self._emit_visible_packages_by_name(filters, pkgs)
- elif provides_type == PROVIDES_MIMETYPE:
- # Emit packages that contain an application that can handle
- # the given mime type
- handlers = set()
- db = get_mapping_db("/var/lib/PackageKit/mime-map.gdbm")
- if db == None:
- return
- if db.has_key(search):
- pklog.debug("Mime type is registered: %s" % db[search])
- # The mime type handler db stores the packages as a string
- # separated by spaces. Each package has its section
- # prefixed and separated by a slash
- # FIXME: Should make use of the section and emit a
- # RepositoryRequired signal if the package does not exist
- handlers = map(lambda s: s.split("/")[1],
- db[search].split(" "))
- self._emit_visible_packages_by_name(filters, handlers)
- else:
- self.error(ERROR_NOT_SUPPORTED,
- "This function is not implemented in this backend")
- return
-
- def get_files(self, package_ids):
- """
- Emit the Files signal which includes the files included in a package
- Apt only supports this for installed packages
- """
- self.status(STATUS_INFO)
- for id in package_ids:
- pkg = self._find_package_by_id(id)
- if pkg == None:
- self.error(ERROR_PACKAGE_NOT_FOUND,
- "Package %s doesn't exist" % pkg.name)
- return
- files = string.join(self._get_installed_files(pkg), ";")
- self.files(id, files)
-
- # Helpers
-
- def _lock_cache(self):
- """
- Emit an error message and return true if the apt system lock cannot
- be acquired.
- """
- try:
- apt_pkg.PkgSystemLock()
- except SystemError:
- self.error(ERROR_CANNOT_GET_LOCK,
- "Only use one package management programme at the "
- "the same time.")
- return False
- return True
-
- def _unlock_cache(self):
- """
- Unlock the system package cache
- """
- try:
- apt_pkg.PkgSystemUnLock()
- except SystemError:
- return False
- return True
-
- def _open_cache(self, prange=(0,100), progress=True):
- '''
- (Re)Open the APT cache
- '''
- pklog.debug("Open APT cache")
- self.status(STATUS_LOADING_CACHE)
- try:
- self._cache = PackageKitCache(PackageKitOpProgress(self, prange,
- progress))
- except:
- self.error(ERROR_NO_CACHE, "Package cache could not be opened")
- self.Exit()
- return
- if self._cache._depcache.BrokenCount > 0:
- self.error(ERROR_DEP_RESOLUTION_FAILED,
- "There are broken dependecies on your system. "
- "Please use an advanced package manage e.g. "
- "Synaptic or aptitude to resolve this situation.")
- self.Exit()
- return
- self._last_cache_refresh = time.time()
-
- def _recover(self, prange=(95,100)):
- """
- Try to recover from a package manager failure
- """
- self.status(STATUS_CLEANUP)
- self.percentage(None)
- try:
- d = PackageKitDpkgInstallProgress(self)
- d.startUpdate()
- d.recover()
- d.finishUpdate()
- except:
- pass
- self._open_cache(prange)
-
- def _commit_changes(self, fetch_range=(5,50), install_range=(50,90)):
- """
- Commit changes to the cache and handle errors
- """
- try:
- self._cache.commit(PackageKitFetchProgress(self, fetch_range),
- PackageKitInstallProgress(self, install_range))
- except apt.cache.FetchFailedException, e:
- self._open_cache(prange=(95,100))
- pklog.critical(_format_string(e.message))
- self.error(ERROR_PACKAGE_DOWNLOAD_FAILED, _format_string(e.message))
- except apt.cache.FetchCancelledException:
- self._open_cache(prange=(95,100))
- self._canceled.clear()
- except InstallTimeOutPKError, e:
- self._recover()
- self._open_cache(prange=(95,100))
- #FIXME: should provide more information
- self.error(ERROR_UNKNOWN,
- "Transaction was cancelled since the installation "
- "of a package hung.\n"
- "This can be caused by maintainer scripts which "
- "require input on the terminal:\n%s" % e.message)
- except PackageManagerFailedPKError, e:
- self._recover()
- self.error(ERROR_UNKNOWN, "%s\n%s" % (e.message, e.output))
- else:
- return True
- return False
-
- def _check_init(self, prange=(0,10), progress=True):
- '''
- Check if the backend was initialized well and try to recover from
- a broken setup
- '''
- pklog.debug("Checking apt cache and xapian database")
- pkg_cache = os.path.join(apt_pkg.Config["Dir"],
- apt_pkg.Config["Dir::Cache"],
- apt_pkg.Config["Dir::Cache::pkgcache"])
- src_cache = os.path.join(apt_pkg.Config["Dir"],
- apt_pkg.Config["Dir::Cache"],
- apt_pkg.Config["Dir::Cache::srcpkgcache"])
- # Check if the cache instance is of the coorect class type, contains
- # any broken packages and if the dpkg status or apt cache files have
- # been changed since the last refresh
- if not isinstance(self._cache, apt.cache.Cache) or \
- (self._cache._depcache.BrokenCount > 0) or \
- (os.stat(apt_pkg.Config["Dir::State::status"])[stat.ST_MTIME] > \
- self._last_cache_refresh) or \
- (os.stat(pkg_cache)[stat.ST_MTIME] > self._last_cache_refresh) or \
- (os.stat(src_cache)[stat.ST_MTIME] > self._last_cache_refresh):
- pklog.debug("Reloading the cache is required")
- self._open_cache(prange, progress)
- else:
- pass
- self._cache.clear()
-
- def get_id_from_package(self, pkg, force_candidate=False):
- '''
- Return the packagekit id of package. By default this will be the
- installed version for installed packages and the candidate version
- for not installed packages.
-
- The force_candidate option will also report the id of the candidate
- version for installed packages.
- '''
- origin = ""
- cand_origin = pkg.candidateOrigin
- if not pkg.isInstalled or force_candidate:
- version = pkg.candidateVersion
- if cand_origin:
- origin = cand_origin[0].label
- else:
- version = pkg.installedVersion
- if cand_origin and cand_origin[0].site != "" and \
- pkg.installedVersion == pkg.candidateVersion:
- origin = cand_origin[0].label
- id = self._get_package_id(pkg.name, version, pkg.architecture, origin)
- return id
-
- def _emit_package(self, pkg, info=None, force_candidate=False):
- '''
- Send the Package signal for a given apt package
- '''
- id = self.get_id_from_package(pkg, force_candidate)
- section = pkg.section.split("/")[-1]
- if info == None:
- if pkg.isInstalled:
- if section == "metapackages":
- info = INFO_COLLECTION_INSTALLED
- else:
- info = INFO_INSTALLED
- else:
- if section == "metapackages":
- info = INFO_COLLECTION_AVAILABLE
- else:
- info = INFO_AVAILABLE
- summary = pkg.summary
- self.package(id, info, summary)
-
- def _emit_visible_package(self, filters, pkg, info=None):
- """
- Filter and emit a package
- """
- if self._is_package_visible(pkg, filters):
- self._emit_package(pkg, info)
-
- def _emit_visible_packages(self, filters, pkgs, info=None):
- """
- Filter and emit packages
- """
- for p in pkgs:
- if self._is_package_visible(p, filters):
- self._emit_package(p, info)
-
- def _emit_visible_packages_by_name(self, filters, pkgs, info=None):
- """
- Find the packages with the given namens. Afterwards filter and emit
- them
- """
- for name in pkgs:
- if self._cache.has_key(name) and \
- self._is_package_visible(self._cache[name], filters):
- self._emit_package(self._cache[name], info)
-
-
- def _is_package_visible(self, pkg, filters):
- '''
- Return True if the package should be shown in the user interface
- '''
- if filters == FILTER_NONE:
- return True
- for filter in filters.split(";"):
- if (filter == FILTER_INSTALLED and not pkg.isInstalled) or \
- (filter == FILTER_NOT_INSTALLED and pkg.isInstalled) or \
- (filter == FILTER_SUPPORTED and not \
- self._is_package_supported(pkg)) or \
- (filter == FILTER_NOT_SUPPORTED and \
- self._is_package_supported(pkg)) or \
- (filter == FILTER_FREE and not self._is_package_free(pkg)) or \
- (filter == FILTER_NOT_FREE and \
- not self._is_package_not_free(pkg)) or \
- (filter == FILTER_GUI and not self._has_package_gui(pkg)) or \
- (filter == FILTER_NOT_GUI and self._has_package_gui(pkg)) or \
- (filter == FILTER_COLLECTIONS and not \
- self._is_package_collection(pkg)) or \
- (filter == FILTER_NOT_COLLECTIONS and \
- self._is_package_collection(pkg)) or\
- (filter == FILTER_DEVELOPMENT and not \
- self._is_package_devel(pkg)) or \
- (filter == FILTER_NOT_DEVELOPMENT and \
- self._is_package_devel(pkg)):
- return False
- return True
-
- def _is_package_not_free(self, pkg):
- """
- Return True if we can be sure that the package's license isn't any
- free one
- """
- candidate = pkg.candidateOrigin
- return candidate != None and \
- ((candidate[0].origin == "Ubuntu" and \
- candidate[0].component in ["multiverse", "restricted"]) or \
- (candidate[0].origin == "Debian" and \
- candidate[0].component in ["contrib", "non-free"])) and \
- candidate[0].trusted == True
-
- def _is_package_collection(self, pkg):
- """
- Return True if the package is a metapackge
- """
- section = pkg.section.split("/")[-1]
- return section == "metapackages"
-
- def _is_package_free(self, pkg):
- """
- Return True if we can be sure that the package has got a free license
- """
- candidate = pkg.candidateOrigin
- return candidate != None and \
- ((candidate[0].origin == "Ubuntu" and \
- candidate[0].component in ["main", "universe"]) or \
- (candidate[0].origin == "Debian" and \
- candidate[0].component == "main")) and\
- candidate[0].trusted == True
-
- def _has_package_gui(self, pkg):
- #FIXME: should go to a modified Package class
- #FIXME: take application data into account. perhaps checking for
- # property in the xapian database
- return pkg.section.split('/')[-1].lower() in ['x11', 'gnome', 'kde']
-
- def _is_package_devel(self, pkg):
- #FIXME: should go to a modified Package class
- return pkg.name.endswith("-dev") or pkg.name.endswith("-dbg") or \
- pkg.section.split('/')[-1].lower() in ['devel', 'libdevel']
-
- def _is_package_supported(self, pkg):
- candidate = pkg.candidateOrigin[0]
- return candidate != None and \
- candidate[0].origin == "Ubuntu" and \
- candidate[0].component in ["main", "restricted"] and \
- candidate[0].trusted == True
-
- def _get_pkg_version_by_id(self, id):
- '''
- Return a package version matching the given package id or None.
- '''
- name, version, arch, data = id.split(";", 4)
- if self._cache.has_key(name):
- for pkg_ver in self._cache[name].versions:
- if pkg_ver.version == version and \
- pkg_ver.architecture == arch:
- return pkg_ver
- return None
-
- def _find_package_by_id(self, id):
- '''
- Return a package matching to the given package id
- '''
- # FIXME: Should use package.Version
- name, version, arch, data = id.split(";", 4)
- if self._cache.has_key(name):
- return self._cache[name]
- else:
- return None
-
- def _get_installed_files(self, pkg):
- """
- Return the list of unicode names of the files which have
- been installed by the package
-
- This method should be obsolete by the apt.package.Package.installedFiles
- attribute as soon as the consolidate branch of python-apt gets merged
- """
- path = os.path.join(apt_pkg.Config["Dir"],
- "var/lib/dpkg/info/%s.list" % pkg.name)
- try:
- list = open(path)
- files = list.read().decode().split("\n")
- list.close()
- except:
- return []
- return files
-
- def _get_changelog(self, pkg, uri=None, cancel_lock=None):
- """
- Download the changelog of the package and return it as unicode
- string
-
- This method is already part of the consolidate branch of python-apt
-
- uri: Is the uri to the changelog file. The following named variables
- will be substituted: src_section, prefix, src_pkg and src_ver
- For example the Ubuntu changelog:
- uri = "http://changelogs.ubuntu.com/changelogs/pool" \\
- "/%(src_section)s/%(prefix)s/%(src_pkg)s" \\
- "/%(src_pkg)s_%(src_ver)s/changelog"
- cancel_lock: If this threading.Lock() is set, the download will be
- canceled
- """
- if uri == None:
- if pkg.candidateOrigin[0].origin == "Debian":
- uri = "http://packages.debian.org/changelogs/pool" \
- "/%(src_section)s/%(prefix)s/%(src_pkg)s" \
- "/%(src_pkg)s_%(src_ver)s/changelog"
- elif pkg.candidateOrigin[0].origin == "Ubuntu":
- uri = "http://changelogs.ubuntu.com/changelogs/pool" \
- "/%(src_section)s/%(prefix)s/%(src_pkg)s" \
- "/%(src_pkg)s_%(src_ver)s/changelog"
- else:
- return "The list of changes is not available"
-
- # get the src package name
- src_pkg = pkg.sourcePackageName
-
- # assume "main" section
- src_section = "main"
- # use the section of the candidate as a starting point
- section = self._cache._depcache.GetCandidateVer(pkg._pkg).Section
-
- # get the source version, start with the binaries version
- bin_ver = pkg.candidateVersion
- src_ver = pkg.candidateVersion
- #print "bin: %s" % binver
- try:
- # try to get the source version of the pkg, this differs
- # for some (e.g. libnspr4 on ubuntu)
- # this feature only works if the correct deb-src are in the
- # sources.list
- # otherwise we fall back to the binary version number
- src_records = apt_pkg.GetPkgSrcRecords()
- src_rec = src_records.Lookup(src_pkg)
- if src_rec:
- src_ver = src_records.Version
- #if apt_pkg.VersionCompare(binver, srcver) > 0:
- # srcver = binver
- if not src_ver:
- src_ver = bin_ver
- #print "srcver: %s" % src_ver
- section = src_records.Section
- #print "srcsect: %s" % section
- else:
- # fail into the error handler
- raise SystemError
- except SystemError, e:
- src_ver = bin_ver
-
- l = section.split("/")
- if len(l) > 1:
- src_section = l[0]
-
- # lib is handled special
- prefix = src_pkg[0]
- if src_pkg.startswith("lib"):
- prefix = "lib" + src_pkg[3]
-
- # stip epoch
- l = src_ver.split(":")
- if len(l) > 1:
- src_ver = "".join(l[1:])
-
- uri = uri % {"src_section" : src_section,
- "prefix" : prefix,
- "src_pkg" : src_pkg,
- "src_ver" : src_ver}
- try:
- # Check if the download was canceled
- if cancel_lock and cancel_lock.isSet(): return ""
- changelog_file = urllib2.urlopen(uri)
- # do only get the lines that are new
- changelog = ""
- regexp = "^%s \((.*)\)(.*)$" % (re.escape(src_pkg))
-
- i=0
- while True:
- # Check if the download was canceled
- if cancel_lock and cancel_lock.isSet(): return ""
- # Read changelog line by line
- line_raw = changelog_file.readline()
- if line_raw == "":
- break
- # The changelog is encoded in utf-8, but since there isn't any
- # http header, urllib2 seems to treat it as ascii
- line = line_raw.decode("utf-8")
-
- #print line.encode('utf-8')
- match = re.match(regexp, line)
- if match:
- # strip epoch from installed version
- # and from changelog too
- installed = pkg.installedVersion
- if installed and ":" in installed:
- installed = installed.split(":",1)[1]
- changelog_ver = match.group(1)
- if changelog_ver and ":" in changelog_ver:
- changelog_ver = changelog_ver.split(":", 1)[1]
- if installed and \
- apt_pkg.VersionCompare(changelog_ver, installed) <= 0:
- break
- # EOF (shouldn't really happen)
- changelog += line
-
- # Print an error if we failed to extract a changelog
- if len(changelog) == 0:
- changelog = "The list of changes is not available"
- except urllib2.HTTPError,e:
- return "The list of changes is not available yet.\n\n" \
- "Please use http://launchpad.net/ubuntu/+source/%s/%s/" \
- "+changelog\n" \
- "until the changes become available or try again " \
- "later." % (src_pkg, src_ver)
- except IOError, httplib.BadStatusLine:
- return "Failed to download the list of changes.\nPlease " \
- "check your Internet connection."
- return changelog
-
- def _get_package_group(self, pkg):
- """
- Return the packagekit group corresponding to the package's section
- """
- section = pkg.section.split("/")[-1]
- if SECTION_GROUP_MAP.has_key(section):
- return SECTION_GROUP_MAP[section]
- else:
- pklog.debug("Unkown package section %s of %s" % (pkg.section,
- pkg.name))
- return GROUP_UNKNOWN
-
- def _get_package_description(self, pkg):
- """
- 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 ""
- # get the translated description
- ver = self._cache._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)" % (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
- raw_line = lines[i]
- if raw_line.strip() == ".":
- # The line is just line break
- if not desc.endswith("\n"):
- desc += "\n"
- continue
- 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:
- line = raw_line
- pklog.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
-
- def _get_package_id(self, name, version, arch, data):
- return ";".join((name, version, arch, data))
-
- def _sigquit(self, signum, frame):
- self._unlock_cache()
- sys.exit(1)
-
-def debug_exception(type, value, tb):
- """
- Provides an interactive debugging session on unhandled exceptions
- See http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65287
- """
- if hasattr(sys, 'ps1') or not sys.stderr.isatty() or \
- not sys.stdin.isatty() or not sys.stdout.isatty() or type==SyntaxError:
- # Calls the default handler in interactive mode, if output is·
- # redirected or on syntax errors
- sys.__excepthook__(type, value, tb)
- else:
- import traceback, pdb
- traceback.print_exception(type, value, tb)
- print
- pdb.pm()
-
-def _text_to_bool(text):
- """
- Interpret a string as boolean value.
- """
- #FIXME: Should be part of the backend package
- if text.lower() in ["yes", "true"]:
- return True
- return False
-
-def _format_string(txt, encoding='utf-8'):
- #FIXME: Should be part of the backend package
- if not isinstance(txt, unicode):
- txt = unicode(txt, encoding, errors='replace')
- return txt.replace("\n", ";")
-
-
-def run(args, single=False):
- """
- Start the apt backend
- """
- backend = PackageKitAptBackend("")
- if single == True:
- backend.dispatch_command(args[0], args[1:])
- else:
- backend.dispatcher(args)
-
-def main():
- parser = optparse.OptionParser(description="APT backend for PackageKit")
- parser.add_option("-r", "--root",
- action="store", type="string", dest="root",
- help="Use the given directory as the system root "
- "(Only needed by developers)")
- parser.add_option("-p", "--profile",
- action="store", type="string", dest="profile",
- help="Store profiling stats in the given file "
- "(Only needed by developers)")
- parser.add_option("-d", "--debug",
- action="store_true", dest="debug",
- help="Show a lot of additional information and drop to "
- "a debugging console on unhandled exceptions "
- "(Only needed by developers)")
- parser.add_option("-s", "--single",
- action="store_true", dest="single",
- help="Only perform one command and don't listen on stdin "
- "(Only needed by developers)")
- (options, args) = parser.parse_args()
- if options.debug:
- pklog.setLevel(logging.DEBUG)
- sys.excepthook = debug_exception
-
- if options.root:
- config = apt_pkg.Config
- config.Set("Dir", options.root)
- config.Set("Dir::State::status",
- os.path.join(options.root, "/var/lib/dpkg/status"))
-
- if options.profile:
- import hotshot
- prof = hotshot.Profile(options.profile)
- prof.runcall(run, args, options.single)
- prof.close()
- else:
- run(args, options.single)
-
-if __name__ == '__main__':
- main()
-
-# vim: ts=4 et sts=4
diff --git a/backends/apt/pk-backend-apt.c b/backends/apt/pk-backend-apt.c
index 9489ef4..7d66cd0 100644
--- a/backends/apt/pk-backend-apt.c
+++ b/backends/apt/pk-backend-apt.c
@@ -112,7 +112,7 @@ backend_download_packages (PkBackend *backend, gchar **package_ids, const gchar
/* send the complete list as stdin */
package_ids_temp = pk_package_ids_to_text (package_ids);
- pk_backend_spawn_helper (spawn, "pk-backend-apt.py", "download-packages", directory, package_ids_temp, NULL);
+ pk_backend_spawn_helper (spawn, "aptBackend.py", "download-packages", directory, package_ids_temp, NULL);
g_free (package_ids_temp);
}
@@ -126,7 +126,7 @@ backend_get_depends (PkBackend *backend, PkBitfield filters, gchar **package_ids
gchar *package_ids_temp;
package_ids_temp = pk_package_ids_to_text (package_ids);
filters_text = pk_filter_bitfield_to_text (filters);
- pk_backend_spawn_helper (spawn, "pk-backend-apt.py", "get-depends", filters_text, package_ids_temp, pk_backend_bool_to_text (recursive), NULL);
+ pk_backend_spawn_helper (spawn, "aptBackend.py", "get-depends", filters_text, package_ids_temp, pk_backend_bool_to_text (recursive), NULL);
g_free (filters_text);
g_free (package_ids_temp);
}
@@ -139,7 +139,7 @@ backend_get_details (PkBackend *backend, gchar **package_ids)
{
gchar *package_ids_temp;
package_ids_temp = pk_package_ids_to_text (package_ids);
- pk_backend_spawn_helper (spawn, "pk-backend-apt.py", "get-details", package_ids_temp, NULL);
+ pk_backend_spawn_helper (spawn, "aptBackend.py", "get-details", package_ids_temp, NULL);
g_free (package_ids_temp);
}
@@ -150,7 +150,7 @@ backend_get_details (PkBackend *backend, gchar **package_ids)
static void
backend_get_distro_upgrades (PkBackend *backend)
{
- pk_backend_spawn_helper (spawn, "pk-backend-apt.py", "get-distro-upgrades", NULL);
+ pk_backend_spawn_helper (spawn, "aptBackend.py", "get-distro-upgrades", NULL);
}
#endif /* HAVE_PYTHON_META_RELEASE */
@@ -162,7 +162,7 @@ backend_get_files (PkBackend *backend, gchar **package_ids)
{
gchar *package_ids_temp;
package_ids_temp = pk_package_ids_to_text (package_ids);
- pk_backend_spawn_helper (spawn, "pk-backend-apt.py", "get-files", package_ids_temp, NULL);
+ pk_backend_spawn_helper (spawn, "aptBackend.py", "get-files", package_ids_temp, NULL);
g_free (package_ids_temp);
}
@@ -176,7 +176,7 @@ backend_get_requires (PkBackend *backend, PkBitfield filters, gchar **package_id
gchar *filters_text;
package_ids_temp = pk_package_ids_to_text (package_ids);
filters_text = pk_filter_bitfield_to_text (filters);
- pk_backend_spawn_helper (spawn, "pk-backend-apt.py", "get-requires", filters_text, package_ids_temp, pk_backend_bool_to_text (recursive), NULL);
+ pk_backend_spawn_helper (spawn, "aptBackend.py", "get-requires", filters_text, package_ids_temp, pk_backend_bool_to_text (recursive), NULL);
g_free (filters_text);
g_free (package_ids_temp);
}
@@ -189,7 +189,7 @@ backend_get_updates (PkBackend *backend, PkBitfield filters)
{
gchar *filters_text;
filters_text = pk_filter_bitfield_to_text (filters);
- pk_backend_spawn_helper (spawn, "pk-backend-apt.py", "get-updates", filters_text, NULL);
+ pk_backend_spawn_helper (spawn, "aptBackend.py", "get-updates", filters_text, NULL);
g_free (filters_text);
}
@@ -201,7 +201,7 @@ backend_get_packages (PkBackend *backend, PkBitfield filters)
{
gchar *filters_text;
filters_text = pk_filter_bitfield_to_text (filters);
- pk_backend_spawn_helper (spawn, "pk-backend-apt.py", "get-packages", filters_text, NULL);
+ pk_backend_spawn_helper (spawn, "aptBackend.py", "get-packages", filters_text, NULL);
g_free (filters_text);
}
@@ -213,7 +213,7 @@ backend_get_update_detail (PkBackend *backend, gchar **package_ids)
{
gchar *package_ids_temp;
package_ids_temp = pk_package_ids_to_text (package_ids);
- pk_backend_spawn_helper (spawn, "pk-backend-apt.py", "get-update-detail", package_ids_temp, NULL);
+ pk_backend_spawn_helper (spawn, "aptBackend.py", "get-update-detail", package_ids_temp, NULL);
g_free (package_ids_temp);
}
@@ -227,7 +227,7 @@ backend_install_packages (PkBackend *backend, gchar **package_ids)
/* send the complete list as stdin */
package_ids_temp = pk_package_ids_to_text (package_ids);
- pk_backend_spawn_helper (spawn, "pk-backend-apt.py", "install-packages", package_ids_temp, NULL);
+ pk_backend_spawn_helper (spawn, "aptBackend.py", "install-packages", package_ids_temp, NULL);
g_free (package_ids_temp);
}
@@ -241,7 +241,7 @@ backend_install_files (PkBackend *backend, gboolean trusted, gchar **full_paths)
/* send the complete list as stdin */
package_ids_temp = g_strjoinv (PK_BACKEND_SPAWN_FILENAME_DELIM, full_paths);
- pk_backend_spawn_helper (spawn, "pk-backend-apt.py", "install-files", pk_backend_bool_to_text (trusted), package_ids_temp, NULL);
+ pk_backend_spawn_helper (spawn, "aptBackend.py", "install-files", pk_backend_bool_to_text (trusted), package_ids_temp, NULL);
g_free (package_ids_temp);
}
@@ -257,7 +257,7 @@ backend_install_signature (PkBackend *backend, PkSigTypeEnum type,
const gchar *type_text;
type_text = pk_sig_type_enum_to_text (type);
- pk_backend_spawn_helper (spawn, "pk-backend-apt.py", "install-signature", type_text, key_id, package_id, NULL);
+ pk_backend_spawn_helper (spawn, "aptBackend.py", "install-signature", type_text, key_id, package_id, NULL);
} */
/**
@@ -266,7 +266,7 @@ backend_install_signature (PkBackend *backend, PkSigTypeEnum type,
static void
backend_refresh_cache (PkBackend *backend, gboolean force)
{
- pk_backend_spawn_helper (spawn, "pk-backend-apt.py", "refresh-cache", NULL);
+ pk_backend_spawn_helper (spawn, "aptBackend.py", "refresh-cache", NULL);
}
/**
@@ -279,7 +279,7 @@ backend_remove_packages (PkBackend *backend, gchar **package_ids, gboolean allow
/* send the complete list as stdin */
package_ids_temp = pk_package_ids_to_text (package_ids);
- pk_backend_spawn_helper (spawn, "pk-backend-apt.py", "remove-packages", pk_backend_bool_to_text (allow_deps), package_ids_temp, NULL);
+ pk_backend_spawn_helper (spawn, "aptBackend.py", "remove-packages", pk_backend_bool_to_text (allow_deps), package_ids_temp, NULL);
g_free (package_ids_temp);
}
@@ -291,7 +291,7 @@ backend_search_details (PkBackend *backend, PkBitfield filters, const gchar *sea
{
gchar *filters_text;
filters_text = pk_filter_bitfield_to_text (filters);
- pk_backend_spawn_helper (spawn, "pk-backend-apt.py", "search-details", filters_text, search, NULL);
+ pk_backend_spawn_helper (spawn, "aptBackend.py", "search-details", filters_text, search, NULL);
g_free (filters_text);
}
@@ -303,7 +303,7 @@ 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, "pk-backend-apt.py", "search-file", filters_text, search, NULL);
+ pk_backend_spawn_helper (spawn, "aptBackend.py", "search-file", filters_text, search, NULL);
g_free (filters_text);
}
@@ -315,7 +315,7 @@ backend_search_group (PkBackend *backend, PkBitfield filters, const gchar *searc
{
gchar *filters_text;
filters_text = pk_filter_bitfield_to_text (filters);
- pk_backend_spawn_helper (spawn, "pk-backend-apt.py", "search-group", filters_text, search, NULL);
+ pk_backend_spawn_helper (spawn, "aptBackend.py", "search-group", filters_text, search, NULL);
g_free (filters_text);
}
@@ -327,7 +327,7 @@ backend_search_name (PkBackend *backend, PkBitfield filters, const gchar *search
{
gchar *filters_text;
filters_text = pk_filter_bitfield_to_text (filters);
- pk_backend_spawn_helper (spawn, "pk-backend-apt.py", "search-name", filters_text, search, NULL);
+ pk_backend_spawn_helper (spawn, "aptBackend.py", "search-name", filters_text, search, NULL);
g_free (filters_text);
}
@@ -341,7 +341,7 @@ backend_update_packages (PkBackend *backend, gchar **package_ids)
/* send the complete list as stdin */
package_ids_temp = pk_package_ids_to_text (package_ids);
- pk_backend_spawn_helper (spawn, "pk-backend-apt.py", "update-packages", package_ids_temp, NULL);
+ pk_backend_spawn_helper (spawn, "aptBackend.py", "update-packages", package_ids_temp, NULL);
g_free (package_ids_temp);
}
@@ -351,7 +351,7 @@ backend_update_packages (PkBackend *backend, gchar **package_ids)
static void
backend_update_system (PkBackend *backend)
{
- pk_backend_spawn_helper (spawn, "pk-backend-apt.py", "update-system", NULL);
+ pk_backend_spawn_helper (spawn, "aptBackend.py", "update-system", NULL);
}
/**
@@ -364,7 +364,7 @@ backend_resolve (PkBackend *backend, PkBitfield filters, gchar **package_ids)
gchar *package_ids_temp;
filters_text = pk_filter_bitfield_to_text (filters);
package_ids_temp = pk_package_ids_to_text (package_ids);
- pk_backend_spawn_helper (spawn, "pk-backend-apt.py", "resolve", filters_text, package_ids_temp, NULL);
+ pk_backend_spawn_helper (spawn, "aptBackend.py", "resolve", filters_text, package_ids_temp, NULL);
g_free (filters_text);
g_free (package_ids_temp);
}
@@ -378,7 +378,7 @@ backend_get_repo_list (PkBackend *backend, PkBitfield filters)
{
gchar *filters_text;
filters_text = pk_filter_bitfield_to_text (filters);
- pk_backend_spawn_helper (spawn, "pk-backend-apt.py", "get-repo-list", filters_text, NULL);
+ pk_backend_spawn_helper (spawn, "aptBackend.py", "get-repo-list", filters_text, NULL);
g_free (filters_text);
}
@@ -389,9 +389,9 @@ static void
backend_repo_enable (PkBackend *backend, const gchar *rid, gboolean enabled)
{
if (enabled == TRUE) {
- pk_backend_spawn_helper (spawn, "pk-backend-apt.py", "repo-enable", rid, "true", NULL);
+ pk_backend_spawn_helper (spawn, "aptBackend.py", "repo-enable", rid, "true", NULL);
} else {
- pk_backend_spawn_helper (spawn, "pk-backend-apt.py", "repo-enable", rid, "false", NULL);
+ pk_backend_spawn_helper (spawn, "aptBackend.py", "repo-enable", rid, "false", NULL);
}
}
@@ -403,7 +403,7 @@ FIXME: Not implemented
static void
backend_repo_set_data (PkBackend *backend, const gchar *rid, const gchar *parameter, const gchar *value)
{
- pk_backend_spawn_helper (spawn, "pk-backend-apt.py", "repo-set-data", rid, parameter, value, NULL);
+ pk_backend_spawn_helper (spawn, "aptBackend.py", "repo-set-data", rid, parameter, value, NULL);
}
*/
#endif /* HAVE_PYTHON_SOFTWARE_PROPERTIES */
@@ -418,7 +418,7 @@ backend_what_provides (PkBackend *backend, PkBitfield filters, PkProvidesEnum pr
const gchar *provides_text;
provides_text = pk_provides_enum_to_text (provides);
filters_text = pk_filter_bitfield_to_text (filters);
- pk_backend_spawn_helper (spawn, "pk-backend-apt.py", "what-provides", filters_text, provides_text, search, NULL);
+ pk_backend_spawn_helper (spawn, "aptBackend.py", "what-provides", filters_text, provides_text, search, NULL);
g_free (filters_text);
}
@@ -429,7 +429,7 @@ FIXME: Not implemented
static void
backend_get_categories (PkBackend *backend)
{
- pk_backend_spawn_helper (spawn, "pk-backend-apt.py", "get-categories", NULL);
+ pk_backend_spawn_helper (spawn, "aptBackend.py", "get-categories", NULL);
} */
/**
diff --git a/backends/apt/pk-backend-apt.py b/backends/apt/pk-backend-apt.py
deleted file mode 100755
index 0b057d8..0000000
--- a/backends/apt/pk-backend-apt.py
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-"""
-pk-backend-apt - Runs the PackageKit apt backend
-"""
-# Copyright (C) 2008 Sebastian Heinlein <devel at glatzor.de>
-#
-# 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
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-__author__ = "Sebastian Heinlein <devel at glatzor.de>"
-
-from packagekit.aptbackend import main
-
-main()
-
-# vim:ts=4:sw=4:et
commit 2c88f22467840bc86956e19ccbca4c56f24b815a
Author: elsupergomez <elsupergomez at fedoraproject.org>
Date: Thu Apr 9 15:37:13 2009 +0000
Sending translation for Spanish
diff --git a/po/es.po b/po/es.po
index e4d6926..faf6226 100644
--- a/po/es.po
+++ b/po/es.po
@@ -7,9 +7,9 @@ msgid ""
msgstr ""
"Project-Id-Version: packagekit\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-03-26 19:12+0000\n"
-"PO-Revision-Date: 2009-03-26 19:30-0600\n"
-"Last-Translator: Jorge A Gallegos <kad at blegh.net>\n"
+"POT-Creation-Date: 2009-04-09 14:03+0000\n"
+"PO-Revision-Date: 2009-04-09 12:35-0300\n"
+"Last-Translator: Claudio Rodrigo Pereyra Diaz <claudio at pereyradiaz.com.ar>\n"
"Language-Team: Fedora Spanish <fedora-trans-es at redhat.com>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -446,64 +446,69 @@ msgstr "Error:"
msgid "Package description"
msgstr "Descripción del paquete"
+#. TRANSLATORS: This a message (like a little note that may be of interest) from the transaction
+#: ../client/pk-console.c:1473
+msgid "Message:"
+msgstr "Mensaje:"
+
#. TRANSLATORS: This a list files contained in the package
-#: ../client/pk-console.c:1491
+#: ../client/pk-console.c:1501
msgid "Package files"
msgstr "Archivos del paquete"
#. TRANSLATORS: This where the package has no files
-#: ../client/pk-console.c:1499
+#: ../client/pk-console.c:1509
msgid "No files"
msgstr "No hay archivos"
#. TRANSLATORS: This a request for a GPG key signature from the backend, which the client will prompt for later
-#: ../client/pk-console.c:1522
+#: ../client/pk-console.c:1532
msgid "Repository signature required"
msgstr "Se requiere la firma del repositorio"
#. TRANSLATORS: This a prompt asking the user to import the security key
-#: ../client/pk-console.c:1532
+#: ../client/pk-console.c:1542
msgid "Do you accept this signature?"
msgstr "¿Acepta esta firma?"
#. TRANSLATORS: This is where the user declined the security key
-#: ../client/pk-console.c:1536
+#: ../client/pk-console.c:1546
msgid "The signature was not accepted."
msgstr "La firma no fue aceptada."
#. TRANSLATORS: This a request for a EULA
-#: ../client/pk-console.c:1570
+#: ../client/pk-console.c:1580
msgid "End user license agreement required"
msgstr "Se requiere un acuerdo de licencia de usuario final"
#. TRANSLATORS: This a prompt asking the user to agree to the license
-#: ../client/pk-console.c:1577
+#: ../client/pk-console.c:1587
msgid "Do you agree to this license?"
msgstr "¿Está de acuerdo con esta licencia?"
#. TRANSLATORS: This is where the user declined the license
-#: ../client/pk-console.c:1581
+#: ../client/pk-console.c:1591
msgid "The license was refused."
msgstr "La licencia fue rechazada."
#. TRANSLATORS: This is when the daemon crashed, and we are up shit creek without a paddle
-#: ../client/pk-console.c:1610
+#: ../client/pk-console.c:1620
msgid "The daemon crashed mid-transaction!"
msgstr "El servicio terminó en medio de una transacción!"
#. TRANSLATORS: This is the header to the --help menu
-#: ../client/pk-console.c:1663
+#: ../client/pk-console.c:1673
msgid "PackageKit Console Interface"
msgstr "Interfaz de Consola de PackageKit"
#. these are commands we can use with pkcon
-#: ../client/pk-console.c:1665
+#: ../client/pk-console.c:1675
msgid "Subcommands:"
msgstr "Subcomandos:"
#. TRANSLATORS: command line argument, if we should show debugging information
#. TRANSLATORS: if we should show debugging data
-#: ../client/pk-console.c:1757
+#: ../client/pk-console.c:1767
#: ../client/pk-generate-pack.c:185
#: ../client/pk-monitor.c:125
#: ../contrib/command-not-found/pk-command-not-found.c:518
@@ -512,155 +517,155 @@ msgid "Show extra debugging information"
msgstr "Mostrar información extra de depuración"
#. TRANSLATORS: command line argument, just show the version string
-#: ../client/pk-console.c:1760
+#: ../client/pk-console.c:1770
#: ../client/pk-monitor.c:127
msgid "Show the program version and exit"
msgstr "Mostrar la versión del programa y salir"
#. TRANSLATORS: command line argument, use a filter to narrow down results
-#: ../client/pk-console.c:1763
+#: ../client/pk-console.c:1773
msgid "Set the filter, e.g. installed"
msgstr "Defina el filtro, ej. installado"
#. TRANSLATORS: command line argument, work asynchronously
-#: ../client/pk-console.c:1766
+#: ../client/pk-console.c:1776
msgid "Exit without waiting for actions to complete"
msgstr "Salir sin esperar que las acciones se completen"
#. TRANSLATORS: This is when we could not connect to the system bus, and is fatal
-#: ../client/pk-console.c:1793
+#: ../client/pk-console.c:1803
msgid "This tool could not connect to system DBUS."
msgstr "Esta herramienta no se pudo conectar al DBUS del sistema."
#. TRANSLATORS: The user specified an incorrect filter
-#: ../client/pk-console.c:1880
+#: ../client/pk-console.c:1894
msgid "The filter specified was invalid"
msgstr "El filtro especificado fue inválido"
#. TRANSLATORS: a search type can be name, details, file, etc
-#: ../client/pk-console.c:1898
+#: ../client/pk-console.c:1912
msgid "A search type is required, e.g. name"
msgstr "Se necesita un tipo de búsqueda, por ejemplo, nombre"
#. TRANSLATORS: the user needs to provide a search term
-#: ../client/pk-console.c:1904
-#: ../client/pk-console.c:1912
-#: ../client/pk-console.c:1920
-#: ../client/pk-console.c:1928
+#: ../client/pk-console.c:1918
+#: ../client/pk-console.c:1926
+#: ../client/pk-console.c:1934
+#: ../client/pk-console.c:1942
msgid "A search term is required"
msgstr "Se necesita un término de búsqueda"
#. TRANSLATORS: the search type was provided, but invalid
-#: ../client/pk-console.c:1934
+#: ../client/pk-console.c:1948
msgid "Invalid search type"
msgstr "Tipo de búsqueda inválido"
#. TRANSLATORS: the user did not specify what they wanted to install
-#: ../client/pk-console.c:1940
+#: ../client/pk-console.c:1954
msgid "A package name or filename to install is required"
msgstr "Se requiere un nombre de paquete o nombre de archivo a instalar"
#. TRANSLATORS: geeky error, 99.9999% of users won't see this
-#: ../client/pk-console.c:1948
+#: ../client/pk-console.c:1962
msgid "A type, key_id and package_id are required"
msgstr "Se necesita un tipo, key_id y package_id"
#. TRANSLATORS: the user did not specify what they wanted to remove
-#: ../client/pk-console.c:1956
+#: ../client/pk-console.c:1970
msgid "A package name to remove is required"
msgstr "Necesita dar un nombre de paquete a eliminar"
#. TRANSLATORS: the user did not specify anything about what to download or where
-#: ../client/pk-console.c:1963
+#: ../client/pk-console.c:1977
msgid "A destination directory and then the package names to download are required"
msgstr "Debe especificar el directorio destino y luego los nombres paquetes a descargar"
#. TRANSLATORS: the directory does not exist, so we can't continue
-#: ../client/pk-console.c:1969
+#: ../client/pk-console.c:1983
msgid "Directory not found"
msgstr "Directorio no encontrado"
#. TRANSLATORS: geeky error, 99.9999% of users won't see this
-#: ../client/pk-console.c:1976
+#: ../client/pk-console.c:1990
msgid "A licence identifier (eula-id) is required"
msgstr "Se necesita un identificador de licencia (eula-id)"
#. TRANSLATORS: geeky error, 99.9999% of users won't see this
-#: ../client/pk-console.c:1985
+#: ../client/pk-console.c:1999
msgid "A transaction identifier (tid) is required"
msgstr "Se necesita un identificador de transacción (tid)"
#. TRANSLATORS: The user did not specify a package name
-#: ../client/pk-console.c:2001
+#: ../client/pk-console.c:2015
msgid "A package name to resolve is required"
msgstr "Se necesita un nombre de paquete a resolver"
#. TRANSLATORS: The user did not specify a repository (software source) name
-#: ../client/pk-console.c:2009
-#: ../client/pk-console.c:2017
+#: ../client/pk-console.c:2023
+#: ../client/pk-console.c:2031
msgid "A repository name is required"
msgstr "Se necesita un nombre de repositorio"
#. TRANSLATORS: The user didn't provide any data
-#: ../client/pk-console.c:2025
+#: ../client/pk-console.c:2039
msgid "A repo name, parameter and value are required"
msgstr "Debe especificar un nombre de repositorio, parametro y valor"
#. TRANSLATORS: The user didn't specify what action to use
-#: ../client/pk-console.c:2038
+#: ../client/pk-console.c:2052
msgid "An action, e.g. 'update-system' is required"
msgstr "Debe especificar una acción, por ejemplo, 'update-system'"
#. TRANSLATORS: The user specified an invalid action
-#: ../client/pk-console.c:2044
+#: ../client/pk-console.c:2058
msgid "A correct role is required"
msgstr "Se necesita el rol correcto"
#. TRANSLATORS: we keep a database updated with the time that an action was last executed
-#: ../client/pk-console.c:2050
+#: ../client/pk-console.c:2064
msgid "Failed to get the time since this action was last completed"
msgstr "Falló al obtener la hora de la última vez que se completó esta acción"
#. TRANSLATORS: The user did not provide a package name
#. TRANSLATORS: This is when the user fails to supply the package name
-#: ../client/pk-console.c:2059
-#: ../client/pk-console.c:2070
-#: ../client/pk-console.c:2078
-#: ../client/pk-console.c:2094
-#: ../client/pk-console.c:2102
+#: ../client/pk-console.c:2073
+#: ../client/pk-console.c:2084
+#: ../client/pk-console.c:2092
+#: ../client/pk-console.c:2108
+#: ../client/pk-console.c:2116
#: ../client/pk-generate-pack.c:241
msgid "A package name is required"
msgstr "Se necesita un nombre de paquete"
#. TRANSLATORS: each package "provides" certain things, e.g. mime(gstreamer-decoder-mp3), the user didn't specify it
-#: ../client/pk-console.c:2086
+#: ../client/pk-console.c:2100
msgid "A package provide string is required"
msgstr "Se necesita la cadena de lo que provee el paquete"
#. TRANSLATORS: The user didn't specify a filename to create as a list
-#: ../client/pk-console.c:2110
+#: ../client/pk-console.c:2124
msgid "A list file name to create is required"
msgstr "Se necesita un nombre de archivo de la lista"
#. TRANSLATORS: The user didn't specify a filename to open as a list
-#: ../client/pk-console.c:2119
-#: ../client/pk-console.c:2128
+#: ../client/pk-console.c:2133
+#: ../client/pk-console.c:2142
msgid "A list file to open is required"
msgstr "Se necesita un archivo de lista a abrir"
#. TRANSLATORS: The user tried to use an unsupported option on the command line
-#: ../client/pk-console.c:2181
+#: ../client/pk-console.c:2195
#, c-format
msgid "Option '%s' is not supported"
msgstr "La opción '%s' no está soportada"
#. TRANSLATORS: User does not have permission to do this
-#: ../client/pk-console.c:2194
+#: ../client/pk-console.c:2208
msgid "Incorrect privileges for this operation"
msgstr "Privilegios incorrectos para esta operación"
#. TRANSLATORS: Generic failure of what they asked to do
-#: ../client/pk-console.c:2197
+#: ../client/pk-console.c:2211
msgid "Command failed"
msgstr "Commando falló"
commit 16c6a5857578a2dd4d1a8db79de673b924b17672
Author: raven <raven at fedoraproject.org>
Date: Thu Apr 9 15:15:09 2009 +0000
Sending translation for Polish
diff --git a/po/pl.po b/po/pl.po
index b8fea2c..a782615 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -5,8 +5,8 @@ msgid ""
msgstr ""
"Project-Id-Version: pl\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-02-23 20:11+0100\n"
-"PO-Revision-Date: 2009-02-23 20:34+0100\n"
+"POT-Creation-Date: 2009-04-09 17:11+0200\n"
+"PO-Revision-Date: 2009-04-09 17:13+0200\n"
"Last-Translator: Piotr DrÄ
g <piotrdrag at gmail.com>\n"
"Language-Team: Polish <pl at li.org>\n"
"MIME-Version: 1.0\n"
@@ -14,230 +14,230 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
#. TRANSLATORS: this is an atomic transaction
-#: ../client/pk-console.c:230
+#: ../client/pk-console.c:234
msgid "Transaction"
msgstr "Transakcja"
#. TRANSLATORS: this is the time the transaction was started in system timezone
-#: ../client/pk-console.c:232
+#: ../client/pk-console.c:236
msgid "System time"
msgstr "Czas systemowy"
#. TRANSLATORS: this is if the transaction succeeded or not
-#: ../client/pk-console.c:234
+#: ../client/pk-console.c:238
msgid "Succeeded"
msgstr "Powodzenie"
#. TRANSLATORS: if the repo is enabled
-#: ../client/pk-console.c:234 ../client/pk-console.c:401
+#: ../client/pk-console.c:238 ../client/pk-console.c:405
msgid "True"
msgstr "Prawda"
-#: ../client/pk-console.c:234 ../client/pk-console.c:401
+#: ../client/pk-console.c:238 ../client/pk-console.c:405
msgid "False"
msgstr "FaÅsz"
#. TRANSLATORS: this is the transactions role, e.g. "update-system"
-#: ../client/pk-console.c:236
+#: ../client/pk-console.c:240
msgid "Role"
msgstr "Rola"
#. TRANSLATORS: this is The duration of the transaction
-#: ../client/pk-console.c:241
+#: ../client/pk-console.c:245
msgid "Duration"
msgstr "Czas trwania"
-#: ../client/pk-console.c:241
+#: ../client/pk-console.c:245
msgid "(seconds)"
msgstr "(sekundy)"
#. TRANSLATORS: this is The command line used to do the action
-#: ../client/pk-console.c:245
+#: ../client/pk-console.c:249
msgid "Command line"
msgstr "Wiersz poleceÅ"
#. TRANSLATORS: this is the user ID of the user that started the action
-#: ../client/pk-console.c:247
+#: ../client/pk-console.c:251
msgid "User ID"
msgstr "Identyfikator użytkownika"
#. TRANSLATORS: this is the username, e.g. hughsie
-#: ../client/pk-console.c:254
+#: ../client/pk-console.c:258
msgid "Username"
msgstr "Nazwa użytkownika"
#. TRANSLATORS: this is the users real name, e.g. "Richard Hughes"
-#: ../client/pk-console.c:258
+#: ../client/pk-console.c:262
msgid "Real name"
msgstr "ImiÄ i nazwisko"
-#: ../client/pk-console.c:266
+#: ../client/pk-console.c:270
msgid "Affected packages:"
msgstr "Dotyczy pakietów:"
-#: ../client/pk-console.c:268
+#: ../client/pk-console.c:272
msgid "Affected packages: None"
msgstr "Dotyczy pakietów: żadnych"
#. TRANSLATORS: this is the distro, e.g. Fedora 10
-#: ../client/pk-console.c:293
+#: ../client/pk-console.c:297
msgid "Distribution"
msgstr "Dystrybucja"
#. TRANSLATORS: this is type of update, stable or testing
-#: ../client/pk-console.c:295
+#: ../client/pk-console.c:299
msgid "Type"
msgstr "Typ"
#. TRANSLATORS: this is any summary text describing the upgrade
#. TRANSLATORS: this is the summary of the group
-#: ../client/pk-console.c:297 ../client/pk-console.c:320
+#: ../client/pk-console.c:301 ../client/pk-console.c:324
msgid "Summary"
msgstr "Podsumowanie"
#. TRANSLATORS: this is the group category name
-#: ../client/pk-console.c:309
+#: ../client/pk-console.c:313
msgid "Category"
msgstr "Kategoria"
#. TRANSLATORS: this is group identifier
-#: ../client/pk-console.c:311
+#: ../client/pk-console.c:315
msgid "ID"
msgstr "Identyfikator"
#. TRANSLATORS: this is the parent group
-#: ../client/pk-console.c:314
+#: ../client/pk-console.c:318
msgid "Parent"
msgstr "NadrzÄdna"
#. TRANSLATORS: this is the name of the parent group
-#: ../client/pk-console.c:317
+#: ../client/pk-console.c:321
msgid "Name"
msgstr "Nazwa"
#. TRANSLATORS: this is preferred icon for the group
-#: ../client/pk-console.c:323
+#: ../client/pk-console.c:327
msgid "Icon"
msgstr "Ikona"
#. TRANSLATORS: this is a header for the package that can be updated
-#: ../client/pk-console.c:338
+#: ../client/pk-console.c:342
msgid "Details about the update:"
msgstr "SzczegóÅy aktualizacji:"
#. TRANSLATORS: details about the update, package name and version
-#: ../client/pk-console.c:340
+#: ../client/pk-console.c:344
msgid "Package"
msgstr "Pakiet"
#. TRANSLATORS: details about the update, any packages that this update updates
-#: ../client/pk-console.c:343
+#: ../client/pk-console.c:347
msgid "Updates"
msgstr "Aktualizuje"
#. TRANSLATORS: details about the update, any packages that this update obsoletes
-#: ../client/pk-console.c:347
+#: ../client/pk-console.c:351
msgid "Obsoletes"
msgstr "ZastÄpuje"
#. TRANSLATORS: details about the update, the vendor URLs
-#: ../client/pk-console.c:351
+#: ../client/pk-console.c:355
msgid "Vendor"
msgstr "Producent"
#. TRANSLATORS: details about the update, the bugzilla URLs
-#: ../client/pk-console.c:355
+#: ../client/pk-console.c:359
msgid "Bugzilla"
msgstr "Bugzilla"
#. TRANSLATORS: details about the update, the CVE URLs
-#: ../client/pk-console.c:359
+#: ../client/pk-console.c:363
msgid "CVE"
msgstr "CVE"
#. TRANSLATORS: details about the update, if the package requires a restart
-#: ../client/pk-console.c:363
+#: ../client/pk-console.c:367
msgid "Restart"
msgstr "Uruchom ponownie"
#. TRANSLATORS: details about the update, any description of the update
-#: ../client/pk-console.c:367
+#: ../client/pk-console.c:371
msgid "Update text"
msgstr "Tekst aktualizacji"
#. TRANSLATORS: details about the update, the changelog for the package
-#: ../client/pk-console.c:371
+#: ../client/pk-console.c:375
msgid "Changes"
msgstr "Zmiany"
#. TRANSLATORS: details about the update, the ongoing state of the update
-#: ../client/pk-console.c:375
+#: ../client/pk-console.c:379
msgid "State"
msgstr "Stan"
#. TRANSLATORS: details about the update, date the update was issued
-#: ../client/pk-console.c:380
+#: ../client/pk-console.c:384
msgid "Issued"
msgstr "Wydano"
#. TRANSLATORS: details about the update, date the update was updated
-#: ../client/pk-console.c:385
+#: ../client/pk-console.c:389
msgid "Updated"
msgstr "Zaktualizowano"
-#: ../client/pk-console.c:472 ../client/pk-console.c:474
+#: ../client/pk-console.c:476 ../client/pk-console.c:478
msgid "Percentage"
msgstr "Procentowo"
-#: ../client/pk-console.c:474
+#: ../client/pk-console.c:478
msgid "Unknown"
msgstr "Nieznane"
#. TRANSLATORS: a package requires the system to be restarted
-#: ../client/pk-console.c:525
+#: ../client/pk-console.c:529
msgid "System restart required by:"
msgstr "Ponowne uruchomienie systemu jest wymagane przez:"
#. TRANSLATORS: a package requires the session to be restarted
-#: ../client/pk-console.c:528
+#: ../client/pk-console.c:532
msgid "Session restart required:"
msgstr "Wymagane jest ponowne uruchomienie sesji:"
#. TRANSLATORS: a package requires the application to be restarted
-#: ../client/pk-console.c:531
+#: ../client/pk-console.c:535
msgid "Application restart required by:"
msgstr "Ponowne uruchomienie programu jest wymagane przez:"
#. TRANSLATORS: a package needs to restart they system
-#: ../client/pk-console.c:568
+#: ../client/pk-console.c:572
msgid "Please restart the computer to complete the update."
msgstr "ProszÄ uruchomiÄ ponownie komputer, aby zakoÅczyÄ aktualizacjÄ."
#. TRANSLATORS: a package needs to restart the session
-#: ../client/pk-console.c:571
+#: ../client/pk-console.c:575
msgid "Please logout and login to complete the update."
msgstr "ProszÄ wylogowaÄ siÄ i zalogowaÄ, aby zakoÅczyÄ aktualizacjÄ."
#. TRANSLATORS: a package needs to restart the application
-#: ../client/pk-console.c:574
+#: ../client/pk-console.c:578
msgid "Please restart the application as it is being used."
msgstr "ProszÄ uruchomiÄ program ponownie, ponieważ jest używany."
#. TRANSLATORS: The package is already installed on the system
-#: ../client/pk-console.c:687
+#: ../client/pk-console.c:691
#, c-format
msgid "The package %s is already installed"
msgstr "Pakiet %s jest już zainstalowany"
#. TRANSLATORS: The package name was not found in any software sources. The detailed error follows
-#: ../client/pk-console.c:695
+#: ../client/pk-console.c:699
#, c-format
msgid "The package %s could not be installed: %s"
msgstr "Nie można zainstalowaÄ pakietu %s: %s"
#. TRANSLATORS: There was a programming error that shouldn't happen. The detailed error follows
-#: ../client/pk-console.c:720 ../client/pk-console.c:747
-#: ../client/pk-console.c:843 ../client/pk-console.c:960
+#: ../client/pk-console.c:724 ../client/pk-console.c:751
+#: ../client/pk-console.c:847 ../client/pk-console.c:964
#: ../client/pk-tools-common.c:62 ../client/pk-tools-common.c:81
#: ../client/pk-tools-common.c:89
#, c-format
@@ -245,399 +245,401 @@ msgid "Internal error: %s"
msgstr "WewnÄtrzny bÅÄ
d: %s"
#. TRANSLATORS: There was an error installing the packages. The detailed error follows
-#: ../client/pk-console.c:728 ../client/pk-console.c:1356
+#: ../client/pk-console.c:732 ../client/pk-console.c:1360
#, c-format
msgid "This tool could not install the packages: %s"
msgstr "To narzÄdzie nie może zainstalowaÄ pakietów: %s"
#. TRANSLATORS: There was an error installing the files. The detailed error follows
-#: ../client/pk-console.c:755
+#: ../client/pk-console.c:759
#, c-format
msgid "This tool could not install the files: %s"
msgstr "To narzÄdzie nie może zainstalowaÄ plików: %s"
#. TRANSLATORS: The package name was not found in the installed list. The detailed error follows
-#: ../client/pk-console.c:811
+#: ../client/pk-console.c:815
#, c-format
msgid "This tool could not remove %s: %s"
msgstr "To narzÄdzie nie może usunÄ
Ä %s: %s"
#. TRANSLATORS: There was an error removing the packages. The detailed error follows
-#: ../client/pk-console.c:834 ../client/pk-console.c:872
-#: ../client/pk-console.c:905
+#: ../client/pk-console.c:838 ../client/pk-console.c:876
+#: ../client/pk-console.c:909
#, c-format
msgid "This tool could not remove the packages: %s"
msgstr "To narzÄdzie nie może usunÄ
Ä pakietów: %s"
#. TRANSLATORS: When removing, we might have to remove other dependencies
-#: ../client/pk-console.c:884
+#: ../client/pk-console.c:888
msgid "The following packages have to be removed:"
msgstr "NastÄpujÄ
ce pakiety muszÄ
zostaÄ usuniÄte:"
#. TRANSLATORS: We are checking if it's okay to remove a list of packages
-#: ../client/pk-console.c:891
+#: ../client/pk-console.c:895
msgid "Proceed removing additional packages?"
msgstr "KontynuowaÄ usuwanie dodatkowych pakietów?"
#. TRANSLATORS: We did not remove any packages
-#: ../client/pk-console.c:896
+#: ../client/pk-console.c:900
msgid "The package removal was canceled!"
msgstr "Anulowano usuniÄcie pakietu!"
#. TRANSLATORS: The package name was not found in any software sources
-#: ../client/pk-console.c:937
+#: ../client/pk-console.c:941
#, c-format
msgid "This tool could not download the package %s as it could not be found"
msgstr "To narzÄdzie nie może pobraÄ pakietu %s, ponieważ nie można go znaleźÄ"
#. TRANSLATORS: Could not download the packages for some reason. The detailed error follows
-#: ../client/pk-console.c:968
+#: ../client/pk-console.c:972
#, c-format
msgid "This tool could not download the packages: %s"
msgstr "To narzÄdzie nie może pobraÄ pakietów: %s"
#. TRANSLATORS: There was an error getting the list of files for the package. The detailed error follows
-#: ../client/pk-console.c:995 ../client/pk-console.c:1004
+#: ../client/pk-console.c:999 ../client/pk-console.c:1008
#, c-format
msgid "This tool could not update %s: %s"
msgstr "To narzÄdzie nie może zaktualizowaÄ %s: %s"
#. TRANSLATORS: There was an error getting the list of files for the package. The detailed error follows
-#: ../client/pk-console.c:1026 ../client/pk-console.c:1034
+#: ../client/pk-console.c:1030 ../client/pk-console.c:1038
#, c-format
msgid "This tool could not get the requirements for %s: %s"
msgstr "To narzÄdzie nie może uzyskaÄ wymagaÅ dla %s: %s"
#. TRANSLATORS: There was an error getting the dependencies for the package. The detailed error follows
-#: ../client/pk-console.c:1056 ../client/pk-console.c:1064
+#: ../client/pk-console.c:1060 ../client/pk-console.c:1068
#, c-format
msgid "This tool could not get the dependencies for %s: %s"
msgstr "To narzÄdzie nie może uzyskaÄ zależnoÅci dla %s: %s"
#. TRANSLATORS: There was an error getting the details about the package. The detailed error follows
-#: ../client/pk-console.c:1086 ../client/pk-console.c:1094
+#: ../client/pk-console.c:1090 ../client/pk-console.c:1098
#, c-format
msgid "This tool could not get package details for %s: %s"
msgstr "To narzÄdzie nie może uzyskaÄ szczegóÅów pakietu %s: %s"
#. TRANSLATORS: The package name was not found in any software sources. The detailed error follows
-#: ../client/pk-console.c:1116
+#: ../client/pk-console.c:1120
#, c-format
msgid "This tool could not find the files for %s: %s"
msgstr "To narzÄdzie nie może znaleÅºÄ plików dla %s: %s"
#. TRANSLATORS: There was an error getting the list of files for the package. The detailed error follows
-#: ../client/pk-console.c:1124
+#: ../client/pk-console.c:1128
#, c-format
msgid "This tool could not get the file list for %s: %s"
msgstr "To narzÄdzie nie może uzyskaÄ listy plików dla %s: %s"
#. TRANSLATORS: There was an error getting the list of packages. The filename follows
-#: ../client/pk-console.c:1146
+#: ../client/pk-console.c:1150
#, c-format
msgid "File already exists: %s"
msgstr "Plik już istnieje: %s"
#. TRANSLATORS: follows a list of packages to install
-#: ../client/pk-console.c:1151 ../client/pk-console.c:1207
-#: ../client/pk-console.c:1282
+#: ../client/pk-console.c:1155 ../client/pk-console.c:1211
+#: ../client/pk-console.c:1286
msgid "Getting package list"
msgstr "Pobieranie listy pakietów"
#. TRANSLATORS: There was an error getting the list of packages. The detailed error follows
-#: ../client/pk-console.c:1157 ../client/pk-console.c:1213
-#: ../client/pk-console.c:1288
+#: ../client/pk-console.c:1161 ../client/pk-console.c:1217
+#: ../client/pk-console.c:1292
#, c-format
msgid "This tool could not get package list: %s"
msgstr "To narzÄdzie nie może pobraÄ listy pakietów: %s"
#. TRANSLATORS: There was an error saving the list
-#: ../client/pk-console.c:1168
+#: ../client/pk-console.c:1172
#, c-format
msgid "Failed to save to disk"
msgstr "Zapisanie na dysku nie powiodÅo siÄ"
#. TRANSLATORS: There was an error getting the list. The filename follows
-#: ../client/pk-console.c:1202 ../client/pk-console.c:1277
+#: ../client/pk-console.c:1206 ../client/pk-console.c:1281
#, c-format
msgid "File does not exist: %s"
msgstr "Plik nie istnieje: %s"
#. TRANSLATORS: header to a list of packages newly added
-#: ../client/pk-console.c:1234
+#: ../client/pk-console.c:1238
msgid "Packages to add"
msgstr "Pakiety do dodania"
#. TRANSLATORS: header to a list of packages removed
-#: ../client/pk-console.c:1242
+#: ../client/pk-console.c:1246
msgid "Packages to remove"
msgstr "Pakiety do usuniÄcia"
#. TRANSLATORS: We didn't find any differences
-#: ../client/pk-console.c:1310
+#: ../client/pk-console.c:1314
#, c-format
msgid "No new packages need to be installed"
msgstr "Nie trzeba instalowaÄ nowych pakietów"
#. TRANSLATORS: follows a list of packages to install
-#: ../client/pk-console.c:1316
+#: ../client/pk-console.c:1320
msgid "To install"
msgstr "Do zainstalowania"
#. TRANSLATORS: searching takes some time....
-#: ../client/pk-console.c:1328
+#: ../client/pk-console.c:1332
msgid "Searching for package: "
msgstr "Wyszukiwanie pakietu: "
#. TRANSLATORS: package was not found -- this is the end of a string ended in ...
-#: ../client/pk-console.c:1332
+#: ../client/pk-console.c:1336
msgid "not found."
msgstr "nie znaleziono."
#. TRANSLATORS: We didn't find any packages to install
-#: ../client/pk-console.c:1343
+#: ../client/pk-console.c:1347
#, c-format
msgid "No packages can be found to install"
msgstr "Nie można znaleÅºÄ pakietów do zainstalowania"
#. TRANSLATORS: installing new packages from package list
-#: ../client/pk-console.c:1349
+#: ../client/pk-console.c:1353
msgid "Installing packages"
msgstr "Instalowanie pakietów"
#. TRANSLATORS: The package name was not found in any software sources. The detailed error follows
-#: ../client/pk-console.c:1385
+#: ../client/pk-console.c:1389
#, c-format
msgid "This tool could not find the update details for %s: %s"
msgstr "To narzÄdzie nie może znaleÅºÄ szczegóÅów aktualizacji dla %s: %s"
#. TRANSLATORS: There was an error getting the details about the update for the package. The detailed error follows
-#: ../client/pk-console.c:1393
+#: ../client/pk-console.c:1397
#, c-format
msgid "This tool could not get the update details for %s: %s"
msgstr "To narzÄdzie nie może uzyskaÄ szczegóÅów aktualizacji dla %s: %s"
#. TRANSLATORS: This was an unhandled error, and we don't have _any_ context
-#: ../client/pk-console.c:1439
+#: ../client/pk-console.c:1443
msgid "Error:"
msgstr "BÅÄ
d:"
#. TRANSLATORS: This a list of details about the package
-#: ../client/pk-console.c:1453
+#: ../client/pk-console.c:1457
msgid "Package description"
msgstr "Opis pakietu"
+#. TRANSLATORS: This a message (like a little note that may be of interest) from the transaction
+#: ../client/pk-console.c:1473
+msgid "Message:"
+msgstr "Komunikat:"
+
#. TRANSLATORS: This a list files contained in the package
-#: ../client/pk-console.c:1487
+#: ../client/pk-console.c:1501
msgid "Package files"
msgstr "Pliki pakietu"
#. TRANSLATORS: This where the package has no files
-#: ../client/pk-console.c:1495
+#: ../client/pk-console.c:1509
msgid "No files"
msgstr "Brak plików"
#. TRANSLATORS: This a request for a GPG key signature from the backend, which the client will prompt for later
-#: ../client/pk-console.c:1518
+#: ../client/pk-console.c:1532
msgid "Repository signature required"
msgstr "Wymagany jest podpis repozytorium"
#. TRANSLATORS: This a prompt asking the user to import the security key
-#: ../client/pk-console.c:1528
+#: ../client/pk-console.c:1542
msgid "Do you accept this signature?"
msgstr "ZaakceptowaÄ ten podpis?"
#. TRANSLATORS: This is where the user declined the security key
-#: ../client/pk-console.c:1532
+#: ../client/pk-console.c:1546
msgid "The signature was not accepted."
msgstr "Podpis nie zostaÅ zaakceptowany."
#. TRANSLATORS: This a request for a EULA
-#: ../client/pk-console.c:1566
+#: ../client/pk-console.c:1580
msgid "End user license agreement required"
msgstr "Licencja jest wymagana"
#. TRANSLATORS: This a prompt asking the user to agree to the license
-#: ../client/pk-console.c:1573
+#: ../client/pk-console.c:1587
msgid "Do you agree to this license?"
msgstr "ZaakceptowaÄ tÄ licencjÄ?"
#. TRANSLATORS: This is where the user declined the license
-#: ../client/pk-console.c:1577
+#: ../client/pk-console.c:1591
msgid "The license was refused."
msgstr "Odrzucono licencjÄ."
#. TRANSLATORS: This is when the daemon crashed, and we are up shit creek without a paddle
-#: ../client/pk-console.c:1606
+#: ../client/pk-console.c:1620
msgid "The daemon crashed mid-transaction!"
msgstr "Demon zawiesiÅ siÄ w poÅowie transakcji!"
#. TRANSLATORS: This is the header to the --help menu
-#: ../client/pk-console.c:1659
+#: ../client/pk-console.c:1673
msgid "PackageKit Console Interface"
msgstr "Interfejs konsoli PackageKit"
#. these are commands we can use with pkcon
-#: ../client/pk-console.c:1661
+#: ../client/pk-console.c:1675
msgid "Subcommands:"
msgstr "Podpolecenia:"
#. TRANSLATORS: command line argument, if we should show debugging information
#. TRANSLATORS: if we should show debugging data
-#: ../client/pk-console.c:1753 ../client/pk-generate-pack.c:185
+#: ../client/pk-console.c:1767 ../client/pk-generate-pack.c:185
#: ../client/pk-monitor.c:125
-#: ../contrib/command-not-found/pk-command-not-found.c:510
-#: ../contrib/app-install/pk-app-install-add.c:244
-#: ../contrib/app-install/pk-app-install-create.c:48
-#: ../contrib/app-install/pk-app-install-generate.c:244
-#: ../contrib/app-install/pk-app-install-remove.c:87 ../src/pk-main.c:199
+#: ../contrib/command-not-found/pk-command-not-found.c:518
+#: ../src/pk-main.c:199
msgid "Show extra debugging information"
msgstr "WyÅwietla dodatkowe informacje o debugowaniu"
#. TRANSLATORS: command line argument, just show the version string
-#: ../client/pk-console.c:1756 ../client/pk-monitor.c:127
+#: ../client/pk-console.c:1770 ../client/pk-monitor.c:127
msgid "Show the program version and exit"
msgstr "WyÅwietla wersjÄ programu i wyÅÄ
cza"
#. TRANSLATORS: command line argument, use a filter to narrow down results
-#: ../client/pk-console.c:1759
+#: ../client/pk-console.c:1773
msgid "Set the filter, e.g. installed"
msgstr "Ustawia filtr, np. zainstalowane"
#. TRANSLATORS: command line argument, work asynchronously
-#: ../client/pk-console.c:1762
+#: ../client/pk-console.c:1776
msgid "Exit without waiting for actions to complete"
msgstr "WyÅÄ
cza bez oczekiwania na zakoÅczenie dziaÅaÅ"
#. TRANSLATORS: This is when we could not connect to the system bus, and is fatal
-#: ../client/pk-console.c:1789
+#: ../client/pk-console.c:1803
msgid "This tool could not connect to system DBUS."
msgstr "To narzÄdzie nie może poÅÄ
czyÄ siÄ z systemowym D-Bus."
#. TRANSLATORS: The user specified an incorrect filter
-#: ../client/pk-console.c:1876
+#: ../client/pk-console.c:1894
msgid "The filter specified was invalid"
msgstr "Podany filtr jest nieprawidÅowy"
#. TRANSLATORS: a search type can be name, details, file, etc
-#: ../client/pk-console.c:1894
+#: ../client/pk-console.c:1912
msgid "A search type is required, e.g. name"
msgstr "Wymagany jest typ wyszukiwania, np. nazwa"
#. TRANSLATORS: the user needs to provide a search term
-#: ../client/pk-console.c:1900 ../client/pk-console.c:1908
-#: ../client/pk-console.c:1916 ../client/pk-console.c:1924
+#: ../client/pk-console.c:1918 ../client/pk-console.c:1926
+#: ../client/pk-console.c:1934 ../client/pk-console.c:1942
msgid "A search term is required"
msgstr "Wymagany jest wyszukiwany termin"
#. TRANSLATORS: the search type was provided, but invalid
-#: ../client/pk-console.c:1930
+#: ../client/pk-console.c:1948
msgid "Invalid search type"
msgstr "NieprawidÅowy typ wyszukiwania"
#. TRANSLATORS: the user did not specify what they wanted to install
-#: ../client/pk-console.c:1936
+#: ../client/pk-console.c:1954
msgid "A package name or filename to install is required"
msgstr "Wymagana jest nazwa pakietu lub pliku do zainstalowania"
#. TRANSLATORS: geeky error, 99.9999% of users won't see this
-#: ../client/pk-console.c:1944
+#: ../client/pk-console.c:1962
msgid "A type, key_id and package_id are required"
msgstr "Wymagany jest typ, key_id i package_id"
#. TRANSLATORS: the user did not specify what they wanted to remove
-#: ../client/pk-console.c:1952
+#: ../client/pk-console.c:1970
msgid "A package name to remove is required"
msgstr "Wymagana jest nazwa pakietu do usuniÄcia"
#. TRANSLATORS: the user did not specify anything about what to download or where
-#: ../client/pk-console.c:1959
+#: ../client/pk-console.c:1977
msgid ""
"A destination directory and then the package names to download are required"
msgstr "Wymagany jest katalog docelowy, a nastÄpnie nazwy pakietów do pobrania"
#. TRANSLATORS: the directory does not exist, so we can't continue
-#: ../client/pk-console.c:1965
+#: ../client/pk-console.c:1983
msgid "Directory not found"
msgstr "Nie znaleziono katalogu"
#. TRANSLATORS: geeky error, 99.9999% of users won't see this
-#: ../client/pk-console.c:1972
+#: ../client/pk-console.c:1990
msgid "A licence identifier (eula-id) is required"
msgstr "Wymagany jest identyfikator licencji (eula-id)"
#. TRANSLATORS: geeky error, 99.9999% of users won't see this
-#: ../client/pk-console.c:1981
+#: ../client/pk-console.c:1999
msgid "A transaction identifier (tid) is required"
msgstr "Wymagany jest identyfikator transakcji (tid)"
#. TRANSLATORS: The user did not specify a package name
-#: ../client/pk-console.c:1997
+#: ../client/pk-console.c:2015
msgid "A package name to resolve is required"
msgstr "Wymagana jest nazwa pakietu do rozwiÄ
zania"
#. TRANSLATORS: The user did not specify a repository (software source) name
-#: ../client/pk-console.c:2005 ../client/pk-console.c:2013
+#: ../client/pk-console.c:2023 ../client/pk-console.c:2031
msgid "A repository name is required"
msgstr "Wymagana jest nazwa repozytorium"
#. TRANSLATORS: The user didn't provide any data
-#: ../client/pk-console.c:2021
+#: ../client/pk-console.c:2039
msgid "A repo name, parameter and value are required"
msgstr "Wymagana jest nazwa, parametr i wartoÅÄ repozytorium"
#. TRANSLATORS: The user didn't specify what action to use
-#: ../client/pk-console.c:2034
+#: ../client/pk-console.c:2052
msgid "An action, e.g. 'update-system' is required"
msgstr "Wymagane jest dziaÅanie, np. \"update-system\""
#. TRANSLATORS: The user specified an invalid action
-#: ../client/pk-console.c:2040
+#: ../client/pk-console.c:2058
msgid "A correct role is required"
msgstr "Wymagana jest bieżÄ
ca rola"
#. TRANSLATORS: we keep a database updated with the time that an action was last executed
-#: ../client/pk-console.c:2046
+#: ../client/pk-console.c:2064
msgid "Failed to get the time since this action was last completed"
msgstr ""
"Uzyskanie czasu od ostatniego zakoÅczenia tego dziaÅania nie powiodÅo siÄ"
#. TRANSLATORS: The user did not provide a package name
#. TRANSLATORS: This is when the user fails to supply the package name
-#: ../client/pk-console.c:2055 ../client/pk-console.c:2066
-#: ../client/pk-console.c:2074 ../client/pk-console.c:2090
-#: ../client/pk-console.c:2098 ../client/pk-generate-pack.c:241
+#: ../client/pk-console.c:2073 ../client/pk-console.c:2084
+#: ../client/pk-console.c:2092 ../client/pk-console.c:2108
+#: ../client/pk-console.c:2116 ../client/pk-generate-pack.c:241
msgid "A package name is required"
msgstr "Wymagana jest nazwa pakietu"
#. TRANSLATORS: each package "provides" certain things, e.g. mime(gstreamer-decoder-mp3), the user didn't specify it
-#: ../client/pk-console.c:2082
+#: ../client/pk-console.c:2100
msgid "A package provide string is required"
msgstr "Wymagany jest ÅaÅcuch dostarczania pakietu"
#. TRANSLATORS: The user didn't specify a filename to create as a list
-#: ../client/pk-console.c:2106
+#: ../client/pk-console.c:2124
msgid "A list file name to create is required"
msgstr "Wymagana jest lista nazw plików do utworzenia"
#. TRANSLATORS: The user didn't specify a filename to open as a list
-#: ../client/pk-console.c:2115 ../client/pk-console.c:2124
+#: ../client/pk-console.c:2133 ../client/pk-console.c:2142
msgid "A list file to open is required"
msgstr "Wymagana jest lista plików do otwarcia"
#. TRANSLATORS: The user tried to use an unsupported option on the command line
-#: ../client/pk-console.c:2177
+#: ../client/pk-console.c:2195
#, c-format
msgid "Option '%s' is not supported"
msgstr "Opcja \"%s\" nie jest obsÅugiwana"
#. TRANSLATORS: User does not have permission to do this
-#: ../client/pk-console.c:2190
+#: ../client/pk-console.c:2208
msgid "Incorrect privileges for this operation"
msgstr "Niepoprawne uprawnienia dla tego dziaÅania"
#. TRANSLATORS: Generic failure of what they asked to do
-#: ../client/pk-console.c:2193
+#: ../client/pk-console.c:2211
msgid "Command failed"
msgstr "Polecenie nie powiodÅo siÄ"
@@ -780,71 +782,71 @@ msgid "Please enter a number from 1 to %i: "
msgstr "ProszÄ podaÄ numer od 1 do %i: "
#. TRANSLATORS: we failed to find the package, this shouldn't happen
-#: ../contrib/command-not-found/pk-command-not-found.c:361
+#: ../contrib/command-not-found/pk-command-not-found.c:369
msgid "Failed to search for file"
msgstr "Znalezienie pliku nie powiodÅo siÄ"
#. TRANSLATORS: we failed to launch the executable, the error follows
-#: ../contrib/command-not-found/pk-command-not-found.c:485
+#: ../contrib/command-not-found/pk-command-not-found.c:493
msgid "Failed to launch:"
msgstr "Uruchomienie nie powiodÅo siÄ:"
#. TRANSLATORS: tool that gets called when the command is not found
-#: ../contrib/command-not-found/pk-command-not-found.c:526
+#: ../contrib/command-not-found/pk-command-not-found.c:534
msgid "PackageKit Command Not Found"
msgstr "Nie znaleziono polecenia PackageKit"
#. TRANSLATORS: the prefix of all the output telling the user why it's not executing
-#: ../contrib/command-not-found/pk-command-not-found.c:548
+#: ../contrib/command-not-found/pk-command-not-found.c:556
msgid "Command not found."
msgstr "Nie znaleziono polecenia."
#. TRANSLATORS: tell the user what we think the command is
-#: ../contrib/command-not-found/pk-command-not-found.c:555
+#: ../contrib/command-not-found/pk-command-not-found.c:563
msgid "Similar command is:"
msgstr "Podobne polecenie:"
#. TRANSLATORS: Ask the user if we should run the similar command
-#: ../contrib/command-not-found/pk-command-not-found.c:564
+#: ../contrib/command-not-found/pk-command-not-found.c:572
msgid "Run similar command:"
msgstr "Wykonaj podobne polecenie:"
#. TRANSLATORS: show the user a list of commands that they could have meant
#. TRANSLATORS: show the user a list of commands we could run
-#: ../contrib/command-not-found/pk-command-not-found.c:576
-#: ../contrib/command-not-found/pk-command-not-found.c:585
+#: ../contrib/command-not-found/pk-command-not-found.c:584
+#: ../contrib/command-not-found/pk-command-not-found.c:593
msgid "Similar commands are:"
msgstr "Podobne polecenia:"
#. TRANSLATORS: ask the user to choose a file to run
-#: ../contrib/command-not-found/pk-command-not-found.c:592
+#: ../contrib/command-not-found/pk-command-not-found.c:600
msgid "Please choose a command to run"
msgstr "ProszÄ wybraÄ polecenie do wykonania"
#. TRANSLATORS: tell the user what package provides the command
-#: ../contrib/command-not-found/pk-command-not-found.c:607
+#: ../contrib/command-not-found/pk-command-not-found.c:615
msgid "The package providing this file is:"
msgstr "Pakiet dostarczajÄ
cy ten plik:"
#. TRANSLATORS: as the user if we want to install a package to provide the command
-#: ../contrib/command-not-found/pk-command-not-found.c:612
+#: ../contrib/command-not-found/pk-command-not-found.c:620
#, c-format
msgid "Install package '%s' to provide command '%s'?"
msgstr "ZainstalowaÄ pakiet \"%s\", aby dostarczyÄ polecenie \"%s\"?"
#. TRANSLATORS: Show the user a list of packages that provide this command
-#: ../contrib/command-not-found/pk-command-not-found.c:633
+#: ../contrib/command-not-found/pk-command-not-found.c:641
msgid "Packages providing this file are:"
-msgstr "Pakiety dostarczajÄ
ce ten plik :"
+msgstr "Pakiety dostarczajÄ
ce ten plik:"
#. TRANSLATORS: Show the user a list of packages that they can install to provide this command
-#: ../contrib/command-not-found/pk-command-not-found.c:642
+#: ../contrib/command-not-found/pk-command-not-found.c:650
msgid "Suitable packages are:"
msgstr "Odpowiednie pakiety:"
#. get selection
#. TRANSLATORS: ask the user to choose a file to install
-#: ../contrib/command-not-found/pk-command-not-found.c:650
+#: ../contrib/command-not-found/pk-command-not-found.c:658
msgid "Please choose a package to install"
msgstr "ProszÄ wybraÄ pakiet do zainstalowania"
@@ -902,55 +904,6 @@ msgstr "Nie znaleziono pakietów dla systemu"
msgid "Installing..."
msgstr "Instalowanie..."
-#. TRANSLATORS: the action is non-localised
-#: ../contrib/app-install/pk-app-install-add.c:247
-#: ../contrib/app-install/pk-app-install-generate.c:247
-msgid "The action, one of 'create', 'add', or 'remove'"
-msgstr "DziaÅanie, jedno z \"create\", \"add\" lub \"remove\""
-
-#. TRANSLATORS: if we are specifing a out-of-tree database
-#: ../contrib/app-install/pk-app-install-add.c:250
-#: ../contrib/app-install/pk-app-install-generate.c:250
-#: ../contrib/app-install/pk-app-install-remove.c:90
-msgid "Main cache file to use (if not specififed, default is used)"
-msgstr ""
-"Używany gÅówny plik pamiÄci podrÄcznej (jeÅli nie podano, użyty zostanie "
-"domyÅlny)"
-
-#. TRANSLATORS: the source database, typically used for adding
-#: ../contrib/app-install/pk-app-install-add.c:253
-#: ../contrib/app-install/pk-app-install-generate.c:253
-msgid "Source cache file to add to the main database"
-msgstr "ŹródÅowy plik pamiÄci podrÄcznej do dodania do gÅównej bazy danych"
-
-#. TRANSLATORS: the icon directory
-#: ../contrib/app-install/pk-app-install-add.c:256
-#: ../contrib/app-install/pk-app-install-generate.c:256
-#: ../contrib/app-install/pk-app-install-remove.c:93
-msgid "Icon directory"
-msgstr "Katalog ikon"
-
-#. TRANSLATORS: the repo of the software source, e.g. fedora
-#: ../contrib/app-install/pk-app-install-add.c:259
-#: ../contrib/app-install/pk-app-install-generate.c:259
-#: ../contrib/app-install/pk-app-install-remove.c:96
-msgid "Name of the remote repo"
-msgstr "Nazwa zdalnego repozytorium"
-
-#. TRANSLATORS: tool that gets called when the command is not found
-#: ../contrib/app-install/pk-app-install-add.c:270
-#: ../contrib/app-install/pk-app-install-create.c:62
-#: ../contrib/app-install/pk-app-install-generate.c:270
-#: ../contrib/app-install/pk-app-install-remove.c:107
-msgid "PackageKit Application Database Installer"
-msgstr "Instalator bazy danych programów PackageKit"
-
-#. TRANSLATORS: if we are specifing a out-of-tree database
-#: ../contrib/app-install/pk-app-install-create.c:51
-msgid "Main database file to use (if not specififed, default is used)"
-msgstr ""
-"Używany gÅówny plik bazy danych (jeÅli nie podano, użyty zostanie domyÅlny)"
-
#: ../data/packagekit-catalog.xml.in.h:1
msgid "PackageKit Catalog"
msgstr "Katalog PackageKit"
commit 073923a28d12a19e4b3d432b4e0d215cfd07394f
Author: ruigo <ruigo at fedoraproject.org>
Date: Thu Apr 9 14:56:56 2009 +0000
Sending translation for Portuguese
diff --git a/po/pt.po b/po/pt.po
index a45c90d..c5a4a57 100644
--- a/po/pt.po
+++ b/po/pt.po
@@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: packagekit\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-03-25 11:09+0000\n"
+"POT-Creation-Date: 2009-04-09 14:03+0000\n"
"PO-Revision-Date: \n"
"Last-Translator: Rui Gouveia <rui.gouveia at globaltek.pt>\n"
"Language-Team: pt <fedora-trans-pt at redhat.com>\n"
@@ -443,64 +443,69 @@ msgstr "Erro:"
msgid "Package description"
msgstr "Descrição do pacote"
+#. TRANSLATORS: This a message (like a little note that may be of interest) from the transaction
+#: ../client/pk-console.c:1473
+msgid "Message:"
+msgstr "Mensagem:"
+
#. TRANSLATORS: This a list files contained in the package
-#: ../client/pk-console.c:1491
+#: ../client/pk-console.c:1501
msgid "Package files"
msgstr "Ficheiros do pacote"
#. TRANSLATORS: This where the package has no files
-#: ../client/pk-console.c:1499
+#: ../client/pk-console.c:1509
msgid "No files"
msgstr "Sem ficheiros"
#. TRANSLATORS: This a request for a GPG key signature from the backend, which the client will prompt for later
-#: ../client/pk-console.c:1522
+#: ../client/pk-console.c:1532
msgid "Repository signature required"
msgstr "A assinatura do repositório é necessária"
#. TRANSLATORS: This a prompt asking the user to import the security key
-#: ../client/pk-console.c:1532
+#: ../client/pk-console.c:1542
msgid "Do you accept this signature?"
msgstr "Aceita esta assinatura?"
#. TRANSLATORS: This is where the user declined the security key
-#: ../client/pk-console.c:1536
+#: ../client/pk-console.c:1546
msgid "The signature was not accepted."
msgstr "A assinatura não foi aceite."
#. TRANSLATORS: This a request for a EULA
-#: ../client/pk-console.c:1570
+#: ../client/pk-console.c:1580
msgid "End user license agreement required"
msgstr "O acordo de licenciamento com o utilizador final é necessário"
#. TRANSLATORS: This a prompt asking the user to agree to the license
-#: ../client/pk-console.c:1577
+#: ../client/pk-console.c:1587
msgid "Do you agree to this license?"
msgstr "Concorda com esta licença?"
#. TRANSLATORS: This is where the user declined the license
-#: ../client/pk-console.c:1581
+#: ../client/pk-console.c:1591
msgid "The license was refused."
msgstr "A licença foi recusada."
#. TRANSLATORS: This is when the daemon crashed, and we are up shit creek without a paddle
-#: ../client/pk-console.c:1610
+#: ../client/pk-console.c:1620
msgid "The daemon crashed mid-transaction!"
msgstr "O daemon morreu a meio de uma transacção!"
#. TRANSLATORS: This is the header to the --help menu
-#: ../client/pk-console.c:1663
+#: ../client/pk-console.c:1673
msgid "PackageKit Console Interface"
msgstr "Consola do PackaheKit"
#. these are commands we can use with pkcon
-#: ../client/pk-console.c:1665
+#: ../client/pk-console.c:1675
msgid "Subcommands:"
msgstr "Sub-comandos:"
#. TRANSLATORS: command line argument, if we should show debugging information
#. TRANSLATORS: if we should show debugging data
-#: ../client/pk-console.c:1757
+#: ../client/pk-console.c:1767
#: ../client/pk-generate-pack.c:185
#: ../client/pk-monitor.c:125
#: ../contrib/command-not-found/pk-command-not-found.c:518
@@ -509,155 +514,155 @@ msgid "Show extra debugging information"
msgstr "Mostrar informação de depuração adicional"
#. TRANSLATORS: command line argument, just show the version string
-#: ../client/pk-console.c:1760
+#: ../client/pk-console.c:1770
#: ../client/pk-monitor.c:127
msgid "Show the program version and exit"
msgstr "Mostrar a versão da aplicação e terminar"
#. TRANSLATORS: command line argument, use a filter to narrow down results
-#: ../client/pk-console.c:1763
+#: ../client/pk-console.c:1773
msgid "Set the filter, e.g. installed"
msgstr "Configurar o filtro, exemplo, instalado"
#. TRANSLATORS: command line argument, work asynchronously
-#: ../client/pk-console.c:1766
+#: ../client/pk-console.c:1776
msgid "Exit without waiting for actions to complete"
msgstr "Sair sem esperar que as acções completem"
#. TRANSLATORS: This is when we could not connect to the system bus, and is fatal
-#: ../client/pk-console.c:1793
+#: ../client/pk-console.c:1803
msgid "This tool could not connect to system DBUS."
msgstr "Esta ferramenta não conseguiu ligar ao sistema DBUS."
#. TRANSLATORS: The user specified an incorrect filter
-#: ../client/pk-console.c:1880
+#: ../client/pk-console.c:1894
msgid "The filter specified was invalid"
msgstr "O filtro especificado era inválido"
#. TRANSLATORS: a search type can be name, details, file, etc
-#: ../client/pk-console.c:1898
+#: ../client/pk-console.c:1912
msgid "A search type is required, e.g. name"
msgstr "Um tipo de pesquisa é necessário. Por exemplo, nome"
#. TRANSLATORS: the user needs to provide a search term
-#: ../client/pk-console.c:1904
-#: ../client/pk-console.c:1912
-#: ../client/pk-console.c:1920
-#: ../client/pk-console.c:1928
+#: ../client/pk-console.c:1918
+#: ../client/pk-console.c:1926
+#: ../client/pk-console.c:1934
+#: ../client/pk-console.c:1942
msgid "A search term is required"
msgstr "Um termo de pesquisa é necessário"
#. TRANSLATORS: the search type was provided, but invalid
-#: ../client/pk-console.c:1934
+#: ../client/pk-console.c:1948
msgid "Invalid search type"
msgstr "Tipo de pesquisa inválida"
#. TRANSLATORS: the user did not specify what they wanted to install
-#: ../client/pk-console.c:1940
+#: ../client/pk-console.c:1954
msgid "A package name or filename to install is required"
msgstr "à necessário um nome de pacote ou nome de ficheiro a instalar"
#. TRANSLATORS: geeky error, 99.9999% of users won't see this
-#: ../client/pk-console.c:1948
+#: ../client/pk-console.c:1962
msgid "A type, key_id and package_id are required"
msgstr "São necessários um tipo, id de chave e id de pacote"
#. TRANSLATORS: the user did not specify what they wanted to remove
-#: ../client/pk-console.c:1956
+#: ../client/pk-console.c:1970
msgid "A package name to remove is required"
msgstr "à necessário um nome de pacote para remover"
#. TRANSLATORS: the user did not specify anything about what to download or where
-#: ../client/pk-console.c:1963
+#: ../client/pk-console.c:1977
msgid "A destination directory and then the package names to download are required"
msgstr "São necessários uma directoria de destino assim como os nomes dos pacotes a transferir"
#. TRANSLATORS: the directory does not exist, so we can't continue
-#: ../client/pk-console.c:1969
+#: ../client/pk-console.c:1983
msgid "Directory not found"
msgstr "Directório não encontrado"
#. TRANSLATORS: geeky error, 99.9999% of users won't see this
-#: ../client/pk-console.c:1976
+#: ../client/pk-console.c:1990
msgid "A licence identifier (eula-id) is required"
msgstr "à necessário um identificador de licença (eula-id)"
#. TRANSLATORS: geeky error, 99.9999% of users won't see this
-#: ../client/pk-console.c:1985
+#: ../client/pk-console.c:1999
msgid "A transaction identifier (tid) is required"
msgstr "à necessário um identificador de transacção (tid)"
#. TRANSLATORS: The user did not specify a package name
-#: ../client/pk-console.c:2001
+#: ../client/pk-console.c:2015
msgid "A package name to resolve is required"
msgstr "à necessário indicar um nome de pacote"
#. TRANSLATORS: The user did not specify a repository (software source) name
-#: ../client/pk-console.c:2009
-#: ../client/pk-console.c:2017
+#: ../client/pk-console.c:2023
+#: ../client/pk-console.c:2031
msgid "A repository name is required"
msgstr "à obrigatório um nome de repositório"
#. TRANSLATORS: The user didn't provide any data
-#: ../client/pk-console.c:2025
+#: ../client/pk-console.c:2039
msgid "A repo name, parameter and value are required"
msgstr "à necessário indicar um repositório, parâmetro e valor"
#. TRANSLATORS: The user didn't specify what action to use
-#: ../client/pk-console.c:2038
+#: ../client/pk-console.c:2052
msgid "An action, e.g. 'update-system' is required"
msgstr "à necessária uma acção, por exemplo 'update-system'"
#. TRANSLATORS: The user specified an invalid action
-#: ../client/pk-console.c:2044
+#: ../client/pk-console.c:2058
msgid "A correct role is required"
msgstr "à necessária uma função correcta"
#. TRANSLATORS: we keep a database updated with the time that an action was last executed
-#: ../client/pk-console.c:2050
+#: ../client/pk-console.c:2064
msgid "Failed to get the time since this action was last completed"
msgstr "Não foi possÃvel obter a hora da última vez que esta acção foi concluÃda"
#. TRANSLATORS: The user did not provide a package name
#. TRANSLATORS: This is when the user fails to supply the package name
-#: ../client/pk-console.c:2059
-#: ../client/pk-console.c:2070
-#: ../client/pk-console.c:2078
-#: ../client/pk-console.c:2094
-#: ../client/pk-console.c:2102
+#: ../client/pk-console.c:2073
+#: ../client/pk-console.c:2084
+#: ../client/pk-console.c:2092
+#: ../client/pk-console.c:2108
+#: ../client/pk-console.c:2116
#: ../client/pk-generate-pack.c:241
msgid "A package name is required"
msgstr "à obrigatório um nome de pacote"
#. TRANSLATORS: each package "provides" certain things, e.g. mime(gstreamer-decoder-mp3), the user didn't specify it
-#: ../client/pk-console.c:2086
+#: ../client/pk-console.c:2100
msgid "A package provide string is required"
msgstr "à necessário especificar a string que define o que o pacote disponibiliza"
#. TRANSLATORS: The user didn't specify a filename to create as a list
-#: ../client/pk-console.c:2110
+#: ../client/pk-console.c:2124
msgid "A list file name to create is required"
msgstr "à necessário indicar o nome do ficheiro a criar com a lista"
#. TRANSLATORS: The user didn't specify a filename to open as a list
-#: ../client/pk-console.c:2119
-#: ../client/pk-console.c:2128
+#: ../client/pk-console.c:2133
+#: ../client/pk-console.c:2142
msgid "A list file to open is required"
msgstr "à necessária uma lista de ficheiros"
#. TRANSLATORS: The user tried to use an unsupported option on the command line
-#: ../client/pk-console.c:2181
+#: ../client/pk-console.c:2195
#, c-format
msgid "Option '%s' is not supported"
msgstr "A opção '%s' não é suportada"
#. TRANSLATORS: User does not have permission to do this
-#: ../client/pk-console.c:2194
+#: ../client/pk-console.c:2208
msgid "Incorrect privileges for this operation"
msgstr "Privilégios incorrectos para esta operação"
#. TRANSLATORS: Generic failure of what they asked to do
-#: ../client/pk-console.c:2197
+#: ../client/pk-console.c:2211
msgid "Command failed"
msgstr "Comando falhou"
commit 5716d5b7f01dca6afd11ea5e012eadb9960f585d
Author: Richard Hughes <richard at hughsie.com>
Date: Thu Apr 9 14:37:47 2009 +0100
trivial: add some more details to an error failure
diff --git a/src/pk-transaction.c b/src/pk-transaction.c
index be79ae4..ab26050 100644
--- a/src/pk-transaction.c
+++ b/src/pk-transaction.c
@@ -1574,7 +1574,9 @@ pk_transaction_cancel (PkTransaction *transaction, DBusGMethodInvocation *contex
/* check if it's safe to kill */
if (!transaction->priv->allow_cancel) {
error = g_error_new (PK_TRANSACTION_ERROR, PK_TRANSACTION_ERROR_CANNOT_CANCEL,
- "Tried to cancel a transaction that is not safe to kill");
+ "Tried to cancel %s (%s) that is not safe to kill",
+ transaction->priv->tid,
+ pk_role_enum_to_text (transaction->priv->role));
pk_transaction_dbus_return_error (context, error);
return;
}
commit 28151ea72bcdd826a2d3a3f9109a073e90962169
Author: Richard Hughes <richard at hughsie.com>
Date: Thu Apr 9 11:23:18 2009 +0100
bugfix: correct the logic for pk_client_set_synchronous so we can set this false without returning in the duplicate check
diff --git a/lib/packagekit-glib/pk-client.c b/lib/packagekit-glib/pk-client.c
index c293677..f4294e0 100644
--- a/lib/packagekit-glib/pk-client.c
+++ b/lib/packagekit-glib/pk-client.c
@@ -383,9 +383,10 @@ pk_client_set_synchronous (PkClient *client, gboolean synchronous, GError **erro
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
/* are we doing this without any need? */
- if (client->priv->synchronous) {
+ if ((client->priv->synchronous && synchronous) ||
+ (!client->priv->synchronous && !synchronous)) {
if (error != NULL)
- *error = g_error_new (PK_CLIENT_ERROR, PK_CLIENT_ERROR_FAILED, "already set synchronous!");
+ *error = g_error_new (PK_CLIENT_ERROR, PK_CLIENT_ERROR_FAILED, "already synchronous : %i!", synchronous);
return FALSE;
}
@@ -4732,13 +4733,33 @@ pk_client_test (EggTest *test)
g_free (file);
/************************************************************/
- egg_test_title (test, "get client, then unref");
+ egg_test_title (test, "get client");
client = pk_client_new ();
+ egg_test_assert (test, client != NULL);
+
+ /************************************************************/
+ egg_test_title (test, "set non synchronous (fail)");
+ ret = pk_client_set_synchronous (client, FALSE, NULL);
+ egg_test_assert (test, !ret);
+
+ /************************************************************/
+ egg_test_title (test, "set synchronous (pass)");
+ ret = pk_client_set_synchronous (client, TRUE, NULL);
+ egg_test_assert (test, ret);
+
+ /************************************************************/
+ egg_test_title (test, "set synchronous again (fail)");
+ ret = pk_client_set_synchronous (client, TRUE, NULL);
+ egg_test_assert (test, !ret);
+
+ /************************************************************/
+ egg_test_title (test, "set non synchronous (pass)");
+ ret = pk_client_set_synchronous (client, FALSE, NULL);
+ egg_test_assert (test, ret);
g_object_unref (client);
- egg_test_success (test, NULL);
/************************************************************/
- egg_test_title (test, "get client");
+ egg_test_title (test, "get new client");
client = pk_client_new ();
egg_test_assert (test, client != NULL);
@@ -4751,8 +4772,12 @@ pk_client_test (EggTest *test)
g_signal_connect (client, "finished",
G_CALLBACK (pk_client_test_finished_cb), test);
+ /************************************************************/
+ egg_test_title (test, "set synchronous after reset (pass)");
+ ret = pk_client_set_synchronous (client, TRUE, NULL);
+ egg_test_assert (test, ret);
+
/* run the method */
- pk_client_set_synchronous (client, TRUE, NULL);
ret = pk_client_search_name (client, PK_FILTER_ENUM_NONE, "power", NULL);
/************************************************************/
More information about the PackageKit-commit
mailing list