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

Richard Hughes hughsient at kemper.freedesktop.org
Tue Feb 1 03:22:48 PST 2011


 NEWS                                     |   74 ++++++++++++
 RELEASE                                  |    4 
 backends/aptcc/apt.cpp                   |   27 +---
 backends/conary/XMLCache.py              |  180 ++++++++++++++++-------------
 backends/conary/conaryBackend.py         |  188 ++++++++++++++-----------------
 backends/conary/conarypk.py              |   18 --
 backends/conary/pk-backend-conary.c      |   33 +++++
 backends/conary/test-label.xml           |   37 ++++++
 backends/conary/test.py                  |   47 +++++++
 backends/yum/yumBackend.py               |    3 
 configure.ac                             |    2 
 data/tests/test.catalog                  |    8 -
 docs/html/pk-download.html               |    1 
 lib/packagekit-glib2/pk-client-helper.c  |   13 +-
 lib/packagekit-glib2/pk-client.c         |  147 ++++++++++++++++--------
 lib/packagekit-glib2/pk-common.c         |   10 +
 lib/packagekit-glib2/pk-console-shared.c |    2 
 lib/packagekit-glib2/pk-control.c        |    4 
 lib/packagekit-glib2/pk-self-test.c      |   11 +
 po/as.po                                 |    2 
 po/bg.po                                 |   44 +++----
 po/bn_IN.po                              |    2 
 po/ca.po                                 |    2 
 po/cs.po                                 |   10 -
 po/el.po                                 |    2 
 po/es.po                                 |   12 -
 po/eu.po                                 |    2 
 po/gu.po                                 |    2 
 po/id.po                                 |    2 
 po/it.po                                 |    2 
 po/lt.po                                 |    2 
 po/mr.po                                 |    2 
 po/nb.po                                 |    2 
 po/nl.po                                 |    2 
 po/pa.po                                 |   22 +--
 po/pt.po                                 |    2 
 po/ru.po                                 |    2 
 po/sv.po                                 |   22 +--
 po/th.po                                 |    2 
 po/tr.po                                 |    2 
 40 files changed, 608 insertions(+), 343 deletions(-)

New commits:
commit 2dfcd20f9a2287d6e08edec549c9977352eef0fc
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Feb 1 11:21:47 2011 +0000

    Release version 0.6.12

diff --git a/NEWS b/NEWS
index ceb86bf..3bf9abe 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,77 @@
+Version 0.6.12
+~~~~~~~~~~~~~~
+Released: 2011-02-01
+
+Notes:
+ - There is a new 'Speed' API addition optionally available for backends.
+ - Multiple 'default' backends can be specified to allow fallbacks.
+
+Translations:
+ - Update Bulgarian translation (al_shopov)
+ - Update Czech translation (fri)
+ - Update Panjabi translation (aalam)
+ - Update Spanish translation (aloriel)
+ - Update Swedish translation (yeager)
+
+Libraries:
+ - glib: Allow the service pack self tests to run by setting the temp directory (Richard Hughes)
+ - glib: Avoid spamming lots of low level debugging to .xsession-errors. Fixes rh#668303 (Richard Hughes)
+ - glib: Check sscanf() returned the correct number of items before using the answer (Richard Hughes)
+ - glib: Do not return distro-specific id's whilst testing, to fix 'make check' on Debian (Richard Hughes)
+ - glib: Ensure we test for and always run the self-check-socket-program in 'make check' (Richard Hughes)
+ - glib: Only use g_time_val_from_iso8601() when we have a valid ISO8601 value (Richard Hughes)
+ - packagekit-qt: Do not cause a build error when building with -j4 (Richard Hughes)
+
+Backends:
+ - aptcc: Fix compile with GLib 2.24 (Matthias Klumpp)
+ - aptcc: Sanitize file descriptor handling (Matthias Klumpp)
+ - aptcc: Use a pty rather than a pipe for writing to apt (Colin Watson)
+ - conary: Add get_roles so pkcon correctly reports all supported commands (Jesse Zhang)
+ - conary: Fix get-details to really output the licenses (Jesse Zhang)
+ - conary: Fix get-files (Jesse Zhang)
+ - conary: Fix ~installed filter (Jesse Zhang)
+ - conary: Fix installed filter (Jesse Zhang)
+ - conary: Fix refresh-cache (Jesse Zhang)
+ - conary: Fix resolve to not do repo_query if trove is found locally (Jesse Zhang)
+ - conary: Fix resolve to show all versions of installed pkgs (Jesse Zhang)
+ - conary: Fix search-details (Jesse Zhang)
+ - conary: Fix search-group (Jesse Zhang)
+ - conary: Fix search-name (Jesse Zhang)
+ - conary: Fix search to show all versions of installed pkgs (Jesse Zhang)
+ - conary: Space means AND for search-name and search-details (Jesse Zhang)
+ - entropy: Fix compatibility with newer Entropy releases (Fabio Erculiani)
+ - entropy: Fix crash in dependencies removal calculation releases (Fabio Erculiani)
+ - yum: Correct three syntax errors that could cause a backtrace (Richard Hughes)
+ - yum: Do not attempt to call yum.repos twice when using RHN (Richard Hughes)
+ - yum: Do not block the update list on infrastructure packages it breaks auto-updating (Richard Hughes)
+ - yum: Ensure the category data is valid UTF8 (Richard Hughes)
+ - yum: Update the cached comps group list when enabling of disabling a repo. Fixes rh#629049 (Richard Hughes)
+ - zif: Do not crash when returning the package untrusted error (Richard Hughes)
+ - zif: Ensure we set the correct key for the metadata_expire value (Richard Hughes)
+ - zif: Return the correct error when a transaction needs further authorisation (Richard Hughes)
+ - zif: Support the new speed property (Richard Hughes)
+ - zypp: Consider autoremove in remove_packages (Zhang Qiang)
+ - zypp: Don't send package signal in DownloadProgressReportReceiver (Zhang Qiang)
+ - zypp: Erase system resolvables in zypp_build_pool (Zhang Qiang)
+ - zypp: Implement download packages (Zhang Qiang)
+ - zypp: Include system repo when install local rpm (Zhang Qiang)
+ - zypp: Refresh cache before searching (Zhang Qiang)
+ - zypp: Support download source RPM packages (Zhang Qiang)
+
+New Features:
+ - Add speed python backend method (Anders F Bjorklund)
+ - Allow the user to specify a comma delimited list of default backends (Richard Hughes)
+ - Provide a hook so spawned backends can report speed (Richard Hughes)
+
+Bugfixes:
+ - Do not enable command not found debugging by default. Fixes rh#666254 (Richard Hughes)
+ - Explictly include GIO in LDADD to fix a compile error on Debian (Matthias Klumpp, Richard Hughes)
+ - Fix calling pk_client_helper_start() with no environment set (Richard Hughes)
+ - Fix LP#591474 bug which caused a crash when the Section() of a package was NULL (Daniel Nicoletti)
+ - Only try to populate the command list in pkcon after the PkControl command has finished (Richard Hughes)
+ - pkcon: check PK error in pk_console_resolve_package (Zhang Qiang)
+ - Set client locale to LC_MESSAGES rather than LC_ALL (Colin Watson)
+
 Version 0.6.11
 ~~~~~~~~~~~~~~
 Released: 2010-12-13
diff --git a/RELEASE b/RELEASE
index 1aa5858..82a0a88 100644
--- a/RELEASE
+++ b/RELEASE
@@ -7,7 +7,7 @@ git shortlog PACKAGEKIT_0_6_11.. | grep -i -v trivial | grep -v Merge > NEWS.new
 --------------------------------------------------------------------------------
 Version 0.6.12
 ~~~~~~~~~~~~~~
-Released: 2010-xx-xx
+Released: 2011-xx-xx
 
 Notes:
 
@@ -59,7 +59,7 @@ tx push --source
 10. Send an email to packagekit at lists.freedesktop.org
 
 =================================================
-Subject: PackageKit 0.6.11 released!
+Subject: PackageKit 0.6.12 released!
 
 Tarballs available here: http://www.packagekit.org/releases/
 
diff --git a/configure.ac b/configure.ac
index f8ac0c0..b5df3ce 100644
--- a/configure.ac
+++ b/configure.ac
@@ -37,7 +37,7 @@ AC_SUBST(PK_VERSION)
 # AGE		If libpackagekit can be linked into executables which can be
 # 		built with previous versions of this library. Don't use.
 LT_CURRENT=14
-LT_REVISION=5
+LT_REVISION=6
 LT_AGE=0
 AC_SUBST(LT_CURRENT)
 AC_SUBST(LT_REVISION)
diff --git a/docs/html/pk-download.html b/docs/html/pk-download.html
index 5410b6b..7a9ebdf 100644
--- a/docs/html/pk-download.html
+++ b/docs/html/pk-download.html
@@ -72,6 +72,7 @@ Releases are normally on the first working Monday of each month.
 </p>
 <table>
 <tr><td><b>Version</b></td><td>&nbsp;&nbsp;</td><td><b>Date</b></td></tr>
+<tr><td>0.6.12</td><td></td><td>2011-02-01</td></tr>
 <tr><td>0.6.11</td><td></td><td>2010-12-13</td></tr>
 <tr><td>0.6.10</td><td></td><td>2010-11-01</td></tr>
 <tr><td>0.6.9</td><td></td><td>2010-10-04</td></tr>
diff --git a/po/as.po b/po/as.po
index f6e9579..5a502fe 100644
--- a/po/as.po
+++ b/po/as.po
@@ -8,7 +8,7 @@ msgstr ""
 "Project-Id-Version: PackageKit\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2010-12-13 12:23+0000\n"
-"PO-Revision-Date: 2010-12-13 12:52+0000\n"
+"PO-Revision-Date: 2011-02-01 10:45+0000\n"
 "Last-Translator: hughsie <richard at hughsie.com>\n"
 "Language-Team: LANGUAGE <LL at li.org>\n"
 "MIME-Version: 1.0\n"
diff --git a/po/bn_IN.po b/po/bn_IN.po
index 966e412..81427e9 100644
--- a/po/bn_IN.po
+++ b/po/bn_IN.po
@@ -8,7 +8,7 @@ msgstr ""
 "Project-Id-Version: PackageKit\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2010-12-13 12:23+0000\n"
-"PO-Revision-Date: 2010-12-13 12:52+0000\n"
+"PO-Revision-Date: 2011-02-01 10:45+0000\n"
 "Last-Translator: hughsie <richard at hughsie.com>\n"
 "Language-Team: LANGUAGE <LL at li.org>\n"
 "MIME-Version: 1.0\n"
diff --git a/po/ca.po b/po/ca.po
index f2d2e6a..239f96c 100644
--- a/po/ca.po
+++ b/po/ca.po
@@ -8,7 +8,7 @@ msgstr ""
 "Project-Id-Version: PackageKit\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2010-12-13 12:23+0000\n"
-"PO-Revision-Date: 2010-12-13 12:52+0000\n"
+"PO-Revision-Date: 2011-02-01 10:44+0000\n"
 "Last-Translator: hughsie <richard at hughsie.com>\n"
 "Language-Team: LANGUAGE <LL at li.org>\n"
 "MIME-Version: 1.0\n"
diff --git a/po/el.po b/po/el.po
index 7494ccf..467fdbf 100644
--- a/po/el.po
+++ b/po/el.po
@@ -8,7 +8,7 @@ msgstr ""
 "Project-Id-Version: PackageKit\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2010-12-13 12:23+0000\n"
-"PO-Revision-Date: 2010-12-13 12:52+0000\n"
+"PO-Revision-Date: 2011-02-01 10:44+0000\n"
 "Last-Translator: hughsie <richard at hughsie.com>\n"
 "Language-Team: LANGUAGE <LL at li.org>\n"
 "MIME-Version: 1.0\n"
diff --git a/po/eu.po b/po/eu.po
index bfeb4e4..fae206b 100644
--- a/po/eu.po
+++ b/po/eu.po
@@ -8,7 +8,7 @@ msgstr ""
 "Project-Id-Version: PackageKit\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2010-12-13 12:23+0000\n"
-"PO-Revision-Date: 2010-12-13 12:52+0000\n"
+"PO-Revision-Date: 2011-02-01 10:45+0000\n"
 "Last-Translator: hughsie <richard at hughsie.com>\n"
 "Language-Team: Basque <None>\n"
 "MIME-Version: 1.0\n"
diff --git a/po/gu.po b/po/gu.po
index 51d1ea5..6c8dd76 100644
--- a/po/gu.po
+++ b/po/gu.po
@@ -8,7 +8,7 @@ msgstr ""
 "Project-Id-Version: PackageKit\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2010-12-13 12:23+0000\n"
-"PO-Revision-Date: 2010-12-13 12:52+0000\n"
+"PO-Revision-Date: 2011-02-01 10:44+0000\n"
 "Last-Translator: hughsie <richard at hughsie.com>\n"
 "Language-Team: LANGUAGE <LL at li.org>\n"
 "MIME-Version: 1.0\n"
diff --git a/po/id.po b/po/id.po
index f54f214..f195386 100644
--- a/po/id.po
+++ b/po/id.po
@@ -8,7 +8,7 @@ msgstr ""
 "Project-Id-Version: PackageKit\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2010-12-13 12:23+0000\n"
-"PO-Revision-Date: 2010-12-13 12:52+0000\n"
+"PO-Revision-Date: 2011-02-01 10:45+0000\n"
 "Last-Translator: hughsie <richard at hughsie.com>\n"
 "Language-Team: LANGUAGE <LL at li.org>\n"
 "MIME-Version: 1.0\n"
diff --git a/po/it.po b/po/it.po
index de6e6ba..fdf6ef4 100644
--- a/po/it.po
+++ b/po/it.po
@@ -8,7 +8,7 @@ msgstr ""
 "Project-Id-Version: PackageKit\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2010-12-13 12:23+0000\n"
-"PO-Revision-Date: 2010-12-13 12:52+0000\n"
+"PO-Revision-Date: 2011-02-01 10:44+0000\n"
 "Last-Translator: hughsie <richard at hughsie.com>\n"
 "Language-Team: LANGUAGE <LL at li.org>\n"
 "MIME-Version: 1.0\n"
diff --git a/po/lt.po b/po/lt.po
index 63b3325..4e6c9dc 100644
--- a/po/lt.po
+++ b/po/lt.po
@@ -8,7 +8,7 @@ msgstr ""
 "Project-Id-Version: PackageKit\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2010-12-13 12:23+0000\n"
-"PO-Revision-Date: 2010-12-13 13:11+0000\n"
+"PO-Revision-Date: 2011-02-01 10:45+0000\n"
 "Last-Translator: hughsie <richard at hughsie.com>\n"
 "Language-Team: LANGUAGE <LL at li.org>\n"
 "MIME-Version: 1.0\n"
diff --git a/po/mr.po b/po/mr.po
index 2f4c999..e57f39d 100644
--- a/po/mr.po
+++ b/po/mr.po
@@ -8,7 +8,7 @@ msgstr ""
 "Project-Id-Version: PackageKit\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2010-12-13 12:23+0000\n"
-"PO-Revision-Date: 2010-12-13 12:52+0000\n"
+"PO-Revision-Date: 2011-02-01 10:44+0000\n"
 "Last-Translator: hughsie <richard at hughsie.com>\n"
 "Language-Team: LANGUAGE <LL at li.org>\n"
 "MIME-Version: 1.0\n"
diff --git a/po/nb.po b/po/nb.po
index eb06097..393eb92 100644
--- a/po/nb.po
+++ b/po/nb.po
@@ -8,7 +8,7 @@ msgstr ""
 "Project-Id-Version: PackageKit\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2010-12-13 12:23+0000\n"
-"PO-Revision-Date: 2010-12-13 13:04+0000\n"
+"PO-Revision-Date: 2011-02-01 10:45+0000\n"
 "Last-Translator: hughsie <richard at hughsie.com>\n"
 "Language-Team: LANGUAGE <LL at li.org>\n"
 "MIME-Version: 1.0\n"
diff --git a/po/nl.po b/po/nl.po
index 1696868..23b1d53 100644
--- a/po/nl.po
+++ b/po/nl.po
@@ -8,7 +8,7 @@ msgstr ""
 "Project-Id-Version: PackageKit\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2010-12-13 12:23+0000\n"
-"PO-Revision-Date: 2010-12-13 12:53+0000\n"
+"PO-Revision-Date: 2011-02-01 10:45+0000\n"
 "Last-Translator: hughsie <richard at hughsie.com>\n"
 "Language-Team: LANGUAGE <LL at li.org>\n"
 "MIME-Version: 1.0\n"
diff --git a/po/pt.po b/po/pt.po
index 23d9ca0..9c26b78 100644
--- a/po/pt.po
+++ b/po/pt.po
@@ -8,7 +8,7 @@ msgstr ""
 "Project-Id-Version: PackageKit\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2010-12-13 12:23+0000\n"
-"PO-Revision-Date: 2010-12-13 13:04+0000\n"
+"PO-Revision-Date: 2011-02-01 10:45+0000\n"
 "Last-Translator: hughsie <richard at hughsie.com>\n"
 "Language-Team: LANGUAGE <LL at li.org>\n"
 "MIME-Version: 1.0\n"
diff --git a/po/ru.po b/po/ru.po
index 73ecc3a..276e765 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -8,7 +8,7 @@ msgstr ""
 "Project-Id-Version: PackageKit\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2010-12-13 12:23+0000\n"
-"PO-Revision-Date: 2010-12-13 12:52+0000\n"
+"PO-Revision-Date: 2011-02-01 10:45+0000\n"
 "Last-Translator: hughsie <richard at hughsie.com>\n"
 "Language-Team: LANGUAGE <LL at li.org>\n"
 "MIME-Version: 1.0\n"
diff --git a/po/th.po b/po/th.po
index 58002fb..07e3f40 100644
--- a/po/th.po
+++ b/po/th.po
@@ -8,7 +8,7 @@ msgstr ""
 "Project-Id-Version: PackageKit\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2010-12-13 12:23+0000\n"
-"PO-Revision-Date: 2010-12-13 13:11+0000\n"
+"PO-Revision-Date: 2011-02-01 10:46+0000\n"
 "Last-Translator: hughsie <richard at hughsie.com>\n"
 "Language-Team: LANGUAGE <LL at li.org>\n"
 "MIME-Version: 1.0\n"
diff --git a/po/tr.po b/po/tr.po
index a6c2891..8baa2a9 100644
--- a/po/tr.po
+++ b/po/tr.po
@@ -8,7 +8,7 @@ msgstr ""
 "Project-Id-Version: PackageKit\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2010-12-13 12:23+0000\n"
-"PO-Revision-Date: 2010-12-13 13:10+0000\n"
+"PO-Revision-Date: 2011-02-01 10:45+0000\n"
 "Last-Translator: hughsie <richard at hughsie.com>\n"
 "Language-Team: LANGUAGE <LL at li.org>\n"
 "MIME-Version: 1.0\n"
commit 23b4d884fd446cdd557880944162c8aba657088a
Author: aalam <apreet.alam at gmail.com>
Date:   Tue Feb 1 10:51:29 2011 +0000

    Update Panjabi translation
    
    Signed-off-by: Richard Hughes <richard at hughsie.com>

diff --git a/po/pa.po b/po/pa.po
index 6b3599c..148867b 100644
--- a/po/pa.po
+++ b/po/pa.po
@@ -8,9 +8,9 @@ msgstr ""
 "Project-Id-Version: PackageKit\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2010-12-13 12:23+0000\n"
-"PO-Revision-Date: 2010-12-13 13:11+0000\n"
-"Last-Translator: hughsie <richard at hughsie.com>\n"
-"Language-Team: LANGUAGE <LL at li.org>\n"
+"PO-Revision-Date: 2011-02-01 10:46+0000\n"
+"Last-Translator: aalam <apreet.alam at gmail.com>\n"
+"Language-Team: Panjabi (Punjabi) <None>\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
@@ -287,7 +287,7 @@ msgstr "ਘਾਤਕ ਗਲਤੀ"
 #. can be updated
 #: ../client/pk-console.c:701
 msgid "There are no packages to update."
-msgstr ""
+msgstr "ਅੱਪਡੇਟ ਕਰਨ ਲਈ ਕੋਈ ਪੈਕੇਜ ਨਹੀਂ ਹੈ।"
 
 #. TRANSLATORS: the transaction failed in a way we could not expect
 #: ../client/pk-console.c:704
@@ -428,7 +428,7 @@ msgstr "ਐਨੀਮੇਟਡ ਵਿਡਜੈੱਟ ਵਰਤਣ ਦੀ ਬਜ
 #. TRANSLATORS: command line argument, just output without fancy formatting
 #: ../client/pk-console.c:1296
 msgid "The maximum metadata cache age. Use -1 for 'never'."
-msgstr ""
+msgstr "ਮੇਟਾਡਾਟਾ ਦੀ ਵੱਧ ਤੋਂ ਵੱਧ ਉਮਰ ਹੈ। 'ਕਦੇ ਨਹੀਂ never' ਲਈ -1 ਵਰਤੋਂ।"
 
 #. TRANSLATORS: we failed to contact the daemon
 #: ../client/pk-console.c:1333
@@ -549,12 +549,12 @@ msgstr "ਪੈਕੇਜ ਦੇਣ ਵਾਲੀ ਸਤਰ ਲੋੜੀਦੀ ਹ
 #. TRANSLATORS: The user did not provide a distro name
 #: ../client/pk-console.c:1714
 msgid "A distribution name is required"
-msgstr ""
+msgstr "ਡਿਸਟਰੀਬਿਊਸ਼ਨ ਨਾਂ ਚਾਹੀਦਾ ਹੈ"
 
 #. TRANSLATORS: The user did not provide an upgrade type
 #: ../client/pk-console.c:1720
 msgid "An upgrade type is required, e.g. 'minimal', 'default' or 'complete'"
-msgstr ""
+msgstr "ਅੱਪਗਰੇਡ ਕਿਸਮ ਚਾਹੀਦੀ ਹੈ, ਜਿਵੇਂ 'ਘੱਟੋ-ਘੱਟ', 'ਡਿਫਾਲਟ', ਜਾਂ 'ਪੂਰਾ'"
 
 #. TRANSLATORS: The user tried to use an unsupported option on the command
 #. line
@@ -777,7 +777,7 @@ msgstr "ਫਾਇਲ ਲਈ ਖੋਜ ਫੇਲ੍ਹ ਹੈ"
 #. TRANSLATORS: the transaction failed in a way we could not expect
 #: ../contrib/command-not-found/pk-command-not-found.c:456
 msgid "Getting the list of files failed"
-msgstr ""
+msgstr "ਫਾਇਲਾਂ ਦੀ ਲਿਸਟ ਲੈਣ ਲਈ ਫੇਲ੍ਹ ਹੈ"
 
 #. TRANSLATORS: we failed to launch the executable, the error follows
 #: ../contrib/command-not-found/pk-command-not-found.c:602
@@ -799,7 +799,7 @@ msgstr "ਪੈਕੇਜਕਿੱਟ ਕਮਾਂਡ ਨਹੀਂ ਲੱਭੀ"
 #. * the style of bash itself -- apologies
 #: ../contrib/command-not-found/pk-command-not-found.c:739
 msgid "command not found"
-msgstr ""
+msgstr "ਕਮਾਂਡ ਨਹੀਂ ਲੱਭੀ"
 
 #. TRANSLATORS: tell the user what we think the command is
 #: ../contrib/command-not-found/pk-command-not-found.c:757
@@ -1846,7 +1846,7 @@ msgstr "ਪੈਕੇਜ ਅੱਪਡੇਟ ਕਰਨ ਵਾਸਤੇ ਪਰਮ
 
 #: ../policy/org.freedesktop.packagekit.policy.in.h:21
 msgid "Authentication is required to upgrade the operating system"
-msgstr ""
+msgstr "ਓਪਰੇਟਿੰਗ ਸਿਸਟਮ ਅੱਪਗਰੇਡ ਕਰਨ ਲਈ ਪਰਮਾਣਿਤ ਹੋਣ ਦੀ ਲੋੜ ਹੈ"
 
 #. SECURITY:
 #. - Normal users are allowed to cancel their own task without
@@ -1973,7 +1973,7 @@ msgstr "ਪੈਕੇਜ ਅੱਪਡੇਟ"
 #. 
 #: ../policy/org.freedesktop.packagekit.policy.in.h:109
 msgid "Upgrade System"
-msgstr ""
+msgstr "ਸਿਸਟਮ ਅੱਪਗਰੇਡ ਕਰੋ"
 
 #. TRANSLATORS: failed due to DBus security
 #: ../src/pk-main.c:87
commit 3ae779c53fe68b416f468d63a5333e310d18fc97
Author: fri <pavelfric at seznam.cz>
Date:   Tue Feb 1 10:50:50 2011 +0000

    Update Czech translation
    
    Signed-off-by: Richard Hughes <richard at hughsie.com>

diff --git a/po/cs.po b/po/cs.po
index 8e34344..bd816dd 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -8,8 +8,8 @@ msgstr ""
 "Project-Id-Version: PackageKit\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2010-12-13 12:23+0000\n"
-"PO-Revision-Date: 2010-12-13 12:52+0000\n"
-"Last-Translator: hughsie <richard at hughsie.com>\n"
+"PO-Revision-Date: 2011-02-01 10:45+0000\n"
+"Last-Translator: fri <pavelfric at seznam.cz>\n"
 "Language-Team: Czech <None>\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -143,9 +143,9 @@ msgstr "Podrobnosti k aktualizaci:"
 #: ../src/pk-polkit-action-lookup.c:357
 msgid "Package"
 msgid_plural "Packages"
-msgstr[0] ""
-msgstr[1] ""
-msgstr[2] ""
+msgstr[0] "Balíček"
+msgstr[1] "Balíčky"
+msgstr[2] "Balíčků"
 
 #. TRANSLATORS: details about the update, any packages that this update
 #. updates
commit c0fd3f893eb66f5a9d5c106dc57cc9a80b40ec8f
Author: aloriel <aloriel at gmail.com>
Date:   Tue Feb 1 10:50:03 2011 +0000

    Update Spanish translation
    
    Signed-off-by: Richard Hughes <richard at hughsie.com>

diff --git a/po/es.po b/po/es.po
index 9c1a723..024fe92 100644
--- a/po/es.po
+++ b/po/es.po
@@ -8,8 +8,8 @@ msgstr ""
 "Project-Id-Version: PackageKit\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2010-12-13 12:23+0000\n"
-"PO-Revision-Date: 2010-12-13 12:52+0000\n"
-"Last-Translator: hughsie <richard at hughsie.com>\n"
+"PO-Revision-Date: 2011-02-01 10:45+0000\n"
+"Last-Translator: aloriel <aloriel at gmail.com>\n"
 "Language-Team: Spanish (Castilian) <None>\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -549,12 +549,12 @@ msgstr "Se necesita la cadena de lo que proporciona el paquete"
 #. TRANSLATORS: The user did not provide a distro name
 #: ../client/pk-console.c:1714
 msgid "A distribution name is required"
-msgstr ""
+msgstr "Se necesita un nombre de distribución"
 
 #. TRANSLATORS: The user did not provide an upgrade type
 #: ../client/pk-console.c:1720
 msgid "An upgrade type is required, e.g. 'minimal', 'default' or 'complete'"
-msgstr ""
+msgstr "Se necesita un tipo de actualización, ej. «mínima», «predeterminada» o «completa»"
 
 #. TRANSLATORS: The user tried to use an unsupported option on the command
 #. line
@@ -1846,7 +1846,7 @@ msgstr "Es necesario autenticarse para actualizar paquetes"
 
 #: ../policy/org.freedesktop.packagekit.policy.in.h:21
 msgid "Authentication is required to upgrade the operating system"
-msgstr ""
+msgstr "Se necesita autenticación para actualizar el sistema"
 
 #. SECURITY:
 #. - Normal users are allowed to cancel their own task without
@@ -1973,7 +1973,7 @@ msgstr "Actualizar paquetes"
 #. 
 #: ../policy/org.freedesktop.packagekit.policy.in.h:109
 msgid "Upgrade System"
-msgstr ""
+msgstr "Actualizar el sistema"
 
 #. TRANSLATORS: failed due to DBus security
 #: ../src/pk-main.c:87
commit 0300e100c91dca5140308bb2752c4f6d5be55a21
Author: al_shopov <ash at kambanaria.org>
Date:   Tue Feb 1 10:49:26 2011 +0000

    Update Bulgarian translation
    
    Signed-off-by: Richard Hughes <richard at hughsie.com>

diff --git a/po/bg.po b/po/bg.po
index 823283f..9f125fa 100644
--- a/po/bg.po
+++ b/po/bg.po
@@ -8,9 +8,9 @@ msgstr ""
 "Project-Id-Version: PackageKit\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2010-12-13 12:23+0000\n"
-"PO-Revision-Date: 2010-12-13 12:52+0000\n"
-"Last-Translator: hughsie <richard at hughsie.com>\n"
-"Language-Team: LANGUAGE <LL at li.org>\n"
+"PO-Revision-Date: 2011-02-01 10:45+0000\n"
+"Last-Translator: al_shopov <ash at kambanaria.org>\n"
+"Language-Team: Bulgarian <dict at fsa-bg.org>\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
@@ -287,7 +287,7 @@ msgstr "Фатална грешка"
 #. can be updated
 #: ../client/pk-console.c:701
 msgid "There are no packages to update."
-msgstr ""
+msgstr "Няма обновления."
 
 #. TRANSLATORS: the transaction failed in a way we could not expect
 #: ../client/pk-console.c:704
@@ -302,7 +302,7 @@ msgstr "В момента няма налични обновления."
 
 #: ../client/pk-console.c:756
 msgid "There are no upgrades available at this time."
-msgstr ""
+msgstr "В момента няма налични надграждания."
 
 #. TRANSLATORS: a package needs to restart their system
 #: ../client/pk-console.c:823
@@ -329,7 +329,7 @@ msgstr "Излезте и влезте отново в системата, за
 #: ../client/pk-console.c:858
 #, c-format
 msgid "Expected package name, actually got file. Try using 'pkcon install-local %s' instead."
-msgstr ""
+msgstr "Очаквано бе име на пакет, а бе получено име на файл. Пробвайте с „pkcon install-local %s“."
 
 #. TRANSLATORS: There was an error getting the list of files for the package.
 #. The detailed error follows
@@ -402,7 +402,7 @@ msgstr "Задаване на филтър, напр. „инсталирани
 #. TRANSLATORS: command line argument, use a non-standard install prefix
 #: ../client/pk-console.c:1281
 msgid "Set the install root, e.g. '/' or '/mnt/ltsp'"
-msgstr ""
+msgstr "Задаване на папката за инсталиране, напр „/“, „/mnt/ltsp“…"
 
 #. TRANSLATORS: command line argument, work asynchronously
 #: ../client/pk-console.c:1284
@@ -428,7 +428,7 @@ msgstr "Отпечатване на машинно четим изход без
 #. TRANSLATORS: command line argument, just output without fancy formatting
 #: ../client/pk-console.c:1296
 msgid "The maximum metadata cache age. Use -1 for 'never'."
-msgstr ""
+msgstr "Максималната възраст за временните файлове. „-1“ — без ограничение."
 
 #. TRANSLATORS: we failed to contact the daemon
 #: ../client/pk-console.c:1333
@@ -438,12 +438,12 @@ msgstr "Неуспех при свързване с PackageKit"
 #. TRANSLATORS: The user specified an incorrect filter
 #: ../client/pk-console.c:1381
 msgid "The proxy could not be set"
-msgstr ""
+msgstr "Сървърът-посредник не може да бъде зададен"
 
 #. TRANSLATORS: The user specified an incorrect filter
 #: ../client/pk-console.c:1393
 msgid "The install root could not be set"
-msgstr ""
+msgstr "Основната папка при инсталиране не може да е тази"
 
 #. TRANSLATORS: The user specified an incorrect filter
 #: ../client/pk-console.c:1405
@@ -549,12 +549,12 @@ msgstr "Трябва да укажете име на пакет, предост
 #. TRANSLATORS: The user did not provide a distro name
 #: ../client/pk-console.c:1714
 msgid "A distribution name is required"
-msgstr ""
+msgstr "Трябва да укажете име на дистрибуция"
 
 #. TRANSLATORS: The user did not provide an upgrade type
 #: ../client/pk-console.c:1720
 msgid "An upgrade type is required, e.g. 'minimal', 'default' or 'complete'"
-msgstr ""
+msgstr "Трябва да укажете вида на надграждането — „minimal“ (минимално), „default“ (стандартно) или „complete“ (пълно)"
 
 #. TRANSLATORS: The user tried to use an unsupported option on the command
 #. line
@@ -577,7 +577,7 @@ msgstr "Задайте името на файла със зависимости
 #. TRANSLATORS: the output location
 #: ../client/pk-generate-pack.c:256
 msgid "The output file or directory (the current directory is used if omitted)"
-msgstr ""
+msgstr "Изходния файл или папка (ползва се текущата, ако изрично не е указана друга)"
 
 #. TRANSLATORS: put a list of packages in the pack
 #: ../client/pk-generate-pack.c:259
@@ -608,7 +608,7 @@ msgstr "Трябва да укажете изходен файл или папк
 #. startup
 #: ../client/pk-generate-pack.c:340
 msgid "The daemon failed to startup"
-msgstr ""
+msgstr "Неуспешно стартиране на демона"
 
 #. TRANSLATORS: This is when the backend doesn't have the capability to get-
 #. depends
@@ -688,7 +688,7 @@ msgstr "Състоянието на демона не може да се пол
 
 #: ../client/pk-monitor.c:349
 msgid "Failed to get properties"
-msgstr ""
+msgstr "Неуспешно получаване на свойствата"
 
 #. TRANSLATORS: this is a program that monitors PackageKit
 #: ../client/pk-monitor.c:387
@@ -777,7 +777,7 @@ msgstr "Неуспешно търсене на файл"
 #. TRANSLATORS: the transaction failed in a way we could not expect
 #: ../contrib/command-not-found/pk-command-not-found.c:456
 msgid "Getting the list of files failed"
-msgstr ""
+msgstr "Неуспешно изтегляне на списък с файлове"
 
 #. TRANSLATORS: we failed to launch the executable, the error follows
 #: ../contrib/command-not-found/pk-command-not-found.c:602
@@ -799,7 +799,7 @@ msgstr "Командата на PackageKit не е открита"
 #. * the style of bash itself -- apologies
 #: ../contrib/command-not-found/pk-command-not-found.c:739
 msgid "command not found"
-msgstr ""
+msgstr "командата не е открита."
 
 #. TRANSLATORS: tell the user what we think the command is
 #: ../contrib/command-not-found/pk-command-not-found.c:757
@@ -1598,7 +1598,7 @@ msgstr "Приемане на EULA"
 #. TRANSLATORS: The role of the transaction, in present tense
 #: ../lib/packagekit-glib2/pk-console-shared.c:665
 msgid "Getting upgrades"
-msgstr "Получаване на обновления"
+msgstr "Получаване на надграждания"
 
 #. TRANSLATORS: The role of the transaction, in present tense
 #: ../lib/packagekit-glib2/pk-console-shared.c:669
@@ -1806,7 +1806,7 @@ msgstr "За промяната на хранилищата се изисква
 
 #: ../policy/org.freedesktop.packagekit.policy.in.h:11
 msgid "Authentication is required to change the location used to decompress packages"
-msgstr ""
+msgstr "За смяната на мястото за разархивиране на пакети се изисква идентификация"
 
 #: ../policy/org.freedesktop.packagekit.policy.in.h:12
 msgid "Authentication is required to consider a key used for signing packages as trusted"
@@ -1846,7 +1846,7 @@ msgstr "За обновяването на пакети се изисква ид
 
 #: ../policy/org.freedesktop.packagekit.policy.in.h:21
 msgid "Authentication is required to upgrade the operating system"
-msgstr ""
+msgstr "За надграждането на дистрибуцията се изисква идентификация"
 
 #. SECURITY:
 #. - Normal users are allowed to cancel their own task without
@@ -1865,7 +1865,7 @@ msgstr "Отмяна на чуждата задача"
 #. 
 #: ../policy/org.freedesktop.packagekit.policy.in.h:34
 msgid "Change location that packages are installed"
-msgstr ""
+msgstr "Промяна на папката за инсталация на пакети"
 
 #. SECURITY:
 #. - Normal users require admin authentication to enable or disable
@@ -1973,7 +1973,7 @@ msgstr "Обновяване на пакети"
 #. 
 #: ../policy/org.freedesktop.packagekit.policy.in.h:109
 msgid "Upgrade System"
-msgstr ""
+msgstr "Надграждане на системата"
 
 #. TRANSLATORS: failed due to DBus security
 #: ../src/pk-main.c:87
commit f88df78390b36aa686513c21a59571b77c3deccf
Author: yeager <po at danielnylander.se>
Date:   Tue Feb 1 10:48:40 2011 +0000

    Update Swedish translation
    
    Signed-off-by: Richard Hughes <richard at hughsie.com>

diff --git a/po/sv.po b/po/sv.po
index 98b8a4f..3b11b67 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -8,9 +8,9 @@ msgstr ""
 "Project-Id-Version: PackageKit\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2010-12-13 12:23+0000\n"
-"PO-Revision-Date: 2010-12-13 12:52+0000\n"
-"Last-Translator: hughsie <richard at hughsie.com>\n"
-"Language-Team: LANGUAGE <LL at li.org>\n"
+"PO-Revision-Date: 2011-02-01 10:45+0000\n"
+"Last-Translator: yeager <po at danielnylander.se>\n"
+"Language-Team: Swedish <None>\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
@@ -287,7 +287,7 @@ msgstr "Ödesdigert fel"
 #. can be updated
 #: ../client/pk-console.c:701
 msgid "There are no packages to update."
-msgstr ""
+msgstr "Det finns inga paket att uppdatera."
 
 #. TRANSLATORS: the transaction failed in a way we could not expect
 #: ../client/pk-console.c:704
@@ -428,7 +428,7 @@ msgstr "Skriv ut maskinläsbart utdata på skärmen istället för att använda
 #. TRANSLATORS: command line argument, just output without fancy formatting
 #: ../client/pk-console.c:1296
 msgid "The maximum metadata cache age. Use -1 for 'never'."
-msgstr ""
+msgstr "Maximal ålder för metadata-cache. Använd -1 för \"never\"."
 
 #. TRANSLATORS: we failed to contact the daemon
 #: ../client/pk-console.c:1333
@@ -549,12 +549,12 @@ msgstr "En sträng för vad paketet tillhandahåller krävs"
 #. TRANSLATORS: The user did not provide a distro name
 #: ../client/pk-console.c:1714
 msgid "A distribution name is required"
-msgstr ""
+msgstr "Ett distributionsnamn krävs"
 
 #. TRANSLATORS: The user did not provide an upgrade type
 #: ../client/pk-console.c:1720
 msgid "An upgrade type is required, e.g. 'minimal', 'default' or 'complete'"
-msgstr ""
+msgstr "En uppgraderingstyp krävs, t.ex. \"minimal\", \"default\" eller \"complete\""
 
 #. TRANSLATORS: The user tried to use an unsupported option on the command
 #. line
@@ -777,7 +777,7 @@ msgstr "Misslyckades med att söka efter filen"
 #. TRANSLATORS: the transaction failed in a way we could not expect
 #: ../contrib/command-not-found/pk-command-not-found.c:456
 msgid "Getting the list of files failed"
-msgstr ""
+msgstr "Hämtning av fillistorna misslyckades"
 
 #. TRANSLATORS: we failed to launch the executable, the error follows
 #: ../contrib/command-not-found/pk-command-not-found.c:602
@@ -799,7 +799,7 @@ msgstr "PackageKit - Kommandot hittades inte"
 #. * the style of bash itself -- apologies
 #: ../contrib/command-not-found/pk-command-not-found.c:739
 msgid "command not found"
-msgstr ""
+msgstr "kommandot hittades inte"
 
 #. TRANSLATORS: tell the user what we think the command is
 #: ../contrib/command-not-found/pk-command-not-found.c:757
@@ -1846,7 +1846,7 @@ msgstr "Autentisering krävs för att uppdatera paket"
 
 #: ../policy/org.freedesktop.packagekit.policy.in.h:21
 msgid "Authentication is required to upgrade the operating system"
-msgstr ""
+msgstr "Autentisering krävs för att uppgradera operativsystemet"
 
 #. SECURITY:
 #. - Normal users are allowed to cancel their own task without
@@ -1973,7 +1973,7 @@ msgstr "Uppdatera paket"
 #. 
 #: ../policy/org.freedesktop.packagekit.policy.in.h:109
 msgid "Upgrade System"
-msgstr ""
+msgstr "Uppgradera systemet"
 
 #. TRANSLATORS: failed due to DBus security
 #: ../src/pk-main.c:87
commit bb43ac9197a0060237af7e5c8203ddbeece8feeb
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Feb 1 10:19:00 2011 +0000

    glib: allow the service pack self tests to run by setting the temp directory

diff --git a/lib/packagekit-glib2/pk-client.c b/lib/packagekit-glib2/pk-client.c
index 160f1e9..4c96bff 100644
--- a/lib/packagekit-glib2/pk-client.c
+++ b/lib/packagekit-glib2/pk-client.c
@@ -2524,6 +2524,7 @@ pk_client_download_packages_async (PkClient *client, gchar **package_ids, const
 	g_return_if_fail (callback_ready != NULL);
 	g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
 	g_return_if_fail (package_ids != NULL);
+	g_return_if_fail (directory != NULL);
 
 	res = g_simple_async_result_new (G_OBJECT (client), callback_ready, user_data, pk_client_download_packages_async);
 
diff --git a/lib/packagekit-glib2/pk-self-test.c b/lib/packagekit-glib2/pk-self-test.c
index 27c5a00..f1081c6 100644
--- a/lib/packagekit-glib2/pk-self-test.c
+++ b/lib/packagekit-glib2/pk-self-test.c
@@ -1709,10 +1709,14 @@ pk_test_service_pack_func (void)
 {
 	PkServicePack *pack;
 	gchar **package_ids;
+	gboolean ret;
 
 	pack = pk_service_pack_new ();
 	g_assert (pack != NULL);
 
+	ret = pk_service_pack_set_temp_directory (pack, NULL);
+	g_assert (ret);
+
 	/* install package */
 	package_ids = pk_package_ids_from_id ("glib2;2.14.0;i386;fedora");
 	pk_service_pack_create_for_package_ids_async (pack, "dave.servicepack", package_ids, NULL, NULL,
commit 08f68c5b17a72120e1477fa2cf8060d4ef66b47a
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Feb 1 10:00:55 2011 +0000

    glib: only use g_time_val_from_iso8601() when we have a valid ISO8601 value
    
    The ABI of glib seems to have changed (or a bug has been fixed)
    where values like g_time_val_from_iso8601('2008-08-23') used to
    fail, and now passes (with invalid results).

diff --git a/lib/packagekit-glib2/pk-common.c b/lib/packagekit-glib2/pk-common.c
index a186889..31055c1 100644
--- a/lib/packagekit-glib2/pk-common.c
+++ b/lib/packagekit-glib2/pk-common.c
@@ -91,7 +91,7 @@ pk_iso8601_from_date (const GDate *date)
 GDate *
 pk_iso8601_to_date (const gchar *iso_date)
 {
-	gboolean ret;
+	gboolean ret = FALSE;
 	guint retval;
 	guint d = 0;
 	guint m = 0;
@@ -103,8 +103,10 @@ pk_iso8601_to_date (const gchar *iso_date)
 		goto out;
 
 	/* try to parse complete ISO8601 date */
-	ret = g_time_val_from_iso8601 (iso_date, &time_val);
+	if (g_strstr_len (iso_date, -1, " ") != NULL)
+		ret = g_time_val_from_iso8601 (iso_date, &time_val);
 	if (ret && time_val.tv_sec != 0) {
+		g_debug ("Parsed %s %i", iso_date, ret);
 		date = g_date_new ();
 		g_date_set_time_val (date, &time_val);
 		goto out;
commit 1730723c5c35a7247f2efdb652881522cc2071d7
Author: Jesse Zhang <zh.jesse at gmail.com>
Date:   Tue Feb 1 13:34:07 2011 +0800

    conary: space means AND for search-name and search-details
    
    As specified in the reference manual, "search can contain many words
    separated by spaces. In this case, the search operator is AND."

diff --git a/backends/conary/XMLCache.py b/backends/conary/XMLCache.py
index 3247a0a..1a5a9b7 100644
--- a/backends/conary/XMLCache.py
+++ b/backends/conary/XMLCache.py
@@ -40,6 +40,23 @@ def mapGroup(categorieList):
                     where[group] = 1
     return where
 #}}}
+
+def _in_list(lst, value):
+    '''Return True if value is a substring of any element in list @lst
+    '''
+    for i in lst:
+        if value in i:
+            return True
+    return False
+
+def _is_sub_list(lst, values):
+    '''Return True if all values appear as substrings in any element of @lst
+    '''
+    for s in values:
+        if not _in_list(lst, s):
+            return False
+    return True
+
 class XMLRepo:
 
     # Let's only get XML data from things that we support.
@@ -153,11 +170,11 @@ class XMLRepo:
         '''
         doc = self._open()
         results = []
+        searchlist = [s.lower() for s in searchlist]
         for package in doc.findall("Package"):
-            for s in searchlist:
-                if s.lower() in str(package.find("name").text).lower():
-                    results.append(self._generatePackage(package))
-                    break
+            pn = str(package.find("name").text).lower()
+            if _is_sub_list([pn], searchlist):
+                results.append(self._generatePackage(package))
         return results
 
     def _searchGroupPackage(self, searchlist):
@@ -176,12 +193,12 @@ class XMLRepo:
 
         return results
 
-
     def _searchDetailsPackage(self, searchlist):
         '''Search in package name, shortDesc, longDesc, and category
         '''
         doc = self._open()
         results = []
+        searchlist = [s.lower() for s in searchlist]
         for package in doc.findall("Package"):
             info = (
                 package.find("name").text.lower(),
@@ -189,11 +206,8 @@ class XMLRepo:
                 getattr(package.find("longDesc"), "text", "").lower(),
                 getattr(package.find("category"), "text", "").lower(),
             )
-            for s in searchlist:
-                for i in info:
-                    if s.lower() in i.lower():
-                        results.append(self._generatePackage(package))
-                        break
+            if _is_sub_list(info, searchlist):
+                results.append(self._generatePackage(package))
 
         return results
 
diff --git a/backends/conary/test-label.xml b/backends/conary/test-label.xml
index 5b65bba..d193e84 100644
--- a/backends/conary/test-label.xml
+++ b/backends/conary/test-label.xml
@@ -25,4 +25,13 @@
   <category lang="en">Network</category>
 </Package>
 
+<Package>
+  <name>gnome-power-manager</name>
+  <version>3.1.1-7-0.1</version>
+</Package>
+<Package>
+  <name>libgnome</name>
+  <version>2.32.0-0.3-1</version>
+</Package>
+
 </Packages>
diff --git a/backends/conary/test.py b/backends/conary/test.py
index ac8f701..1af67ec 100755
--- a/backends/conary/test.py
+++ b/backends/conary/test.py
@@ -16,6 +16,9 @@ class TestXMLRepo(unittest.TestCase):
     def test_search_name_count2(self):
         self.assertEqual(1, len(self.xml_repo.search(['kernel', 'kernel'], 'name')))
 
+    def test_search_name_and(self):
+        self.assertEqual(1, len(self.xml_repo.search(['gnome', 'power'], 'name')))
+
     def test_search_name_name(self):
         self.assertEqual('kernel',
                 self.xml_repo.search(['kernel'], 'name')[0]['name'])
@@ -27,6 +30,9 @@ class TestXMLRepo(unittest.TestCase):
     def test_search_detail_count(self):
         self.assertEqual(1, len(self.xml_repo.search(['xchat'], 'details')))
 
+    def test_search_detail_and(self):
+        self.assertEqual(1, len(self.xml_repo.search(['gnome', 'power'], 'details')))
+
     def test_search_detail_version(self):
         self.assertEqual('2.8.8-1-1',
                 self.xml_repo.search(['xchat'], 'details')[0]['version'])
commit 5c4885233a72ea2b78fa9edc74c7db2b9b0ff1f5
Author: Jesse Zhang <zh.jesse at gmail.com>
Date:   Tue Feb 1 12:12:33 2011 +0800

    conary: fix get-files
    
    capsules=False is needed for the iterFilesInTrove call.
    
    Files are not contained in 'packages', but in components. So no need to
    do iterFilesInTrove on the package.
    
    Also get_package_from_id doesn't have to do repoquery if package is
    installed locally.

diff --git a/backends/conary/conaryBackend.py b/backends/conary/conaryBackend.py
index 7ace5f8..18f6df4 100755
--- a/backends/conary/conaryBackend.py
+++ b/backends/conary/conaryBackend.py
@@ -189,11 +189,8 @@ class PackageKitConaryBackend(PackageKitBaseBackend):
         """
         log.info("=========== get package from package_id ======================")
         name, verString, archString, data =  pkpackage.get_package_from_id(package_id)
-        trove = self.conary.repo_query(name)
-        if trove:
-            return trove
-        else:
-            return cli.query(name)
+        trove = self.conary.query(name) or self.conary.repo_query(name)
+        return trove
 
     def _search_package( self, name ):
         for pkg in self.packages:
@@ -387,7 +384,6 @@ class PackageKitConaryBackend(PackageKitBaseBackend):
             log.info("end of conary query")
             for trv in trove_installed:
                 pkg = self._convert_package(trv, pkg_dict)
-                log.info( pkg)
                 filter.add_installed([pkg])
                 is_found_locally = True
 
@@ -527,14 +523,12 @@ class PackageKitConaryBackend(PackageKitBaseBackend):
         package_id = package_ids[0]
         def _get_files(troveSource, n, v, f):
             files = []
-            troves = [(n, v, f)]
             trv = troveSource.getTrove(n, v, f)
-            troves.extend([ x for x in trv.iterTroveList(strongRefs=True)
-                                if troveSource.hasTrove(*x)])
-            for n, v, f in troves:
+            for (n, v, f) in [x for x in trv.iterTroveList(strongRefs=True)
+                                if troveSource.hasTrove(*x)]:
                 for (pathId, path, fileId, version, filename) in \
                     troveSource.iterFilesInTrove(n, v, f, sortByPath = True,
-                                                 withFiles = True):
+                            withFiles=True, capsules=False):
                     files.append(path)
             return files
         
commit 01b968029b98cf5f1b14ee3ac952f4a1f451fee1
Author: Jesse Zhang <zh.jesse at gmail.com>
Date:   Tue Feb 1 09:47:40 2011 +0800

    conary: fix resolve to show all versions of installed pkgs

diff --git a/backends/conary/conaryBackend.py b/backends/conary/conaryBackend.py
index 91f5908..7ace5f8 100755
--- a/backends/conary/conaryBackend.py
+++ b/backends/conary/conaryBackend.py
@@ -385,8 +385,8 @@ class PackageKitConaryBackend(PackageKitBaseBackend):
         if FILTER_NOT_INSTALLED not in filters:
             trove_installed = self.conary.query(pkg_dict.get("name"))
             log.info("end of conary query")
-            if trove_installed:
-                pkg = self._convert_package(trove_installed[0], pkg_dict)
+            for trv in trove_installed:
+                pkg = self._convert_package(trv, pkg_dict)
                 log.info( pkg)
                 filter.add_installed([pkg])
                 is_found_locally = True
commit 8682a16fe30c478f179581ea6231fdc9c9ec4a4b
Author: Jesse Zhang <zh.jesse at gmail.com>
Date:   Mon Jan 31 22:26:26 2011 +0800

    conary: fix ~installed filter
    
    Commit e8787ffd has a bug. If a package was installed locally, a search
    with '~installed' filter didn't return information about this package.

diff --git a/backends/conary/conaryBackend.py b/backends/conary/conaryBackend.py
index fb5d3b3..91f5908 100755
--- a/backends/conary/conaryBackend.py
+++ b/backends/conary/conaryBackend.py
@@ -311,23 +311,25 @@ class PackageKitConaryBackend(PackageKitBaseBackend):
         list_installed = []
         list_not_installed = []
 
-        db_trove_list = self.client.db.findTroves(None, list_trove_all, allowMissing=True)
-        for trove in list_trove_all:
-            pkg = self._search_package(trove[0])
-            if trove in db_trove_list:
-                # A package may have different versions/flavors installed.
-                for t in db_trove_list[trove]:
-                    list_installed.append(dict(trove=t, metadata=pkg["metadata"]))
-            else:
-                list_not_installed.append(pkg)
+        if FILTER_NOT_INSTALLED in filters:
+            list_not_installed = self.packages[:]
+        else:
+            db_trove_list = self.client.db.findTroves(None, list_trove_all, allowMissing=True)
+            for trove in list_trove_all:
+                pkg = self._search_package(trove[0])
+                if trove in db_trove_list:
+                    # A package may have different versions/flavors installed.
+                    for t in db_trove_list[trove]:
+                        list_installed.append(dict(trove=t, metadata=pkg["metadata"]))
+                else:
+                    list_not_installed.append(pkg)
 
         # Our list of troves doesn't contain information about whether trove is
         # installed, so ConaryFilter can't do proper filtering. Don't pass
         # @filters to it. Instead manually check the filters before calling
         # add_installed() and add_available().
         pkgFilter = ConaryFilter()
-        if FILTER_NOT_INSTALLED not in filters:
-            pkgFilter.add_installed(list_installed)
+        pkgFilter.add_installed(list_installed)
         log.info("Packages installed .... %s " % len(list_installed))
         log.info("Packages available .... %s " % len(list_not_installed))
 
commit 6c020d400417cc32c32036b8ed67368d7ea3ee9a
Author: Jesse Zhang <zh.jesse at gmail.com>
Date:   Mon Jan 31 22:11:49 2011 +0800

    conary: fix search to show all versions of installed pkgs
    
    Remove unused function _edit_package.

diff --git a/backends/conary/conaryBackend.py b/backends/conary/conaryBackend.py
index 267fe81..fb5d3b3 100755
--- a/backends/conary/conaryBackend.py
+++ b/backends/conary/conaryBackend.py
@@ -201,16 +201,6 @@ class PackageKitConaryBackend(PackageKitBaseBackend):
                 return pkg
         return None
 
-    def _edit_package(self, trove, pkgDict, status):
-        for i,pkg in enumerate(self.packages):
-            if pkg["trove"] == trove:
-                name,version, flavor = pkg.get("trove")
-                self.packages[i] = dict(
-                    trove = (name,version, flavor ),
-                    pkgDict = pkgDict
-                    )
-                return i, self.packages[i]
-   
     def _convert_package( self, trove , pkgDict ):
         return dict( 
                 trove = trove ,
@@ -226,7 +216,7 @@ class PackageKitConaryBackend(PackageKitBaseBackend):
          filters(str) as the filter
         """
         fltlist = filters
-        if where != "name" and where != "details" and where != "group" and where!= "all":
+        if where not in ("name", "details", "group", "all"):
             log.info("where %s" % where)
             self.error(ERROR_UNKNOWN, "DORK---- search where not found")
 
@@ -236,8 +226,6 @@ class PackageKitConaryBackend(PackageKitBaseBackend):
         log.info("|||||||||||||||||||||||||||||1end searching on cache... ")
 
         if len(pkgList) > 0 :
-            #for i in troveTupleList:
-            #    log.info("FOUND!!!!!! %s " % i["name"] )
             log.info("FOUND (%s) elements " % len(pkgList) )
             for pkgDict in pkgList:
                 self._add_package( ( pkgDict["name"], None, None), pkgDict )
@@ -321,18 +309,17 @@ class PackageKitConaryBackend(PackageKitBaseBackend):
 
         list_trove_all = [p.get("trove") for p in self.packages]
         list_installed = []
-        # initialize with the full list, and remove installed troves later
-        list_not_installed = self.packages[:]
+        list_not_installed = []
 
         db_trove_list = self.client.db.findTroves(None, list_trove_all, allowMissing=True)
         for trove in list_trove_all:
+            pkg = self._search_package(trove[0])
             if trove in db_trove_list:
-                # only use the first trove in the list
-                t = db_trove_list[trove][0]
-                pkg = self._search_package(t[0])
-                pkg["trove"] = t
-                list_installed.append(pkg)
-                list_not_installed.remove(pkg)
+                # A package may have different versions/flavors installed.
+                for t in db_trove_list[trove]:
+                    list_installed.append(dict(trove=t, metadata=pkg["metadata"]))
+            else:
+                list_not_installed.append(pkg)
 
         # Our list of troves doesn't contain information about whether trove is
         # installed, so ConaryFilter can't do proper filtering. Don't pass
commit fdebe11e4dbeaa808727eaa7613ec8b717846b9a
Author: Jesse Zhang <zh.jesse at gmail.com>
Date:   Mon Jan 31 14:53:09 2011 +0800

    conary: add get_roles so pkcon correctly reports all supported commands

diff --git a/backends/conary/pk-backend-conary.c b/backends/conary/pk-backend-conary.c
index 06d49a8..d36163a 100644
--- a/backends/conary/pk-backend-conary.c
+++ b/backends/conary/pk-backend-conary.c
@@ -82,6 +82,37 @@ backend_get_filters (PkBackend *backend)
 }
 
 /**
+ * backend_get_roles:
+ */
+PkBitfield
+backend_get_roles (PkBackend *backend)
+{
+	PkBitfield roles;
+	roles = pk_bitfield_from_enums (
+		PK_ROLE_ENUM_CANCEL,
+		PK_ROLE_ENUM_GET_DETAILS,
+		PK_ROLE_ENUM_GET_FILES,
+		PK_ROLE_ENUM_GET_PACKAGES,
+		PK_ROLE_ENUM_INSTALL_PACKAGES,
+		PK_ROLE_ENUM_REFRESH_CACHE,
+		PK_ROLE_ENUM_REMOVE_PACKAGES,
+		PK_ROLE_ENUM_RESOLVE,
+		PK_ROLE_ENUM_SEARCH_DETAILS,
+		PK_ROLE_ENUM_SEARCH_FILE,
+		PK_ROLE_ENUM_SEARCH_GROUP,
+		PK_ROLE_ENUM_SEARCH_NAME,
+		PK_ROLE_ENUM_UPDATE_PACKAGES,
+		PK_ROLE_ENUM_UPDATE_SYSTEM,
+		PK_ROLE_ENUM_GET_REPO_LIST,
+		PK_ROLE_ENUM_SIMULATE_INSTALL_PACKAGES,
+		PK_ROLE_ENUM_SIMULATE_UPDATE_PACKAGES,
+		PK_ROLE_ENUM_SIMULATE_REMOVE_PACKAGES,
+		-1);
+
+	return roles;
+}
+
+/**
  * pk_backend_cancel:
  */
 static void
@@ -429,7 +460,7 @@ PK_BACKEND_OPTIONS (
 	backend_destroy,			/* destroy */
 	backend_get_groups,			/* get_groups */
 	backend_get_filters,			/* get_filters */
-	NULL,					/* get_roles */
+	backend_get_roles,			/* get_roles */
 	NULL,					/* get_mime_types */
 	backend_cancel,				/* cancel */
 	NULL,					/* download_packages */
commit cf84e3ca9c59080d7a0edcaaac9f252e1b5f0f71
Author: Jesse Zhang <zh.jesse at gmail.com>
Date:   Mon Jan 31 13:08:36 2011 +0800

    conary: fix resolve to not do repo_query if trove is found locally
    
    If package is found in local db, return it and don't have to do
    repoquery.
    
    Rename request_query to repo_query. 'conary rq' means repo_query, not
    'request_query'.

diff --git a/backends/conary/conaryBackend.py b/backends/conary/conaryBackend.py
index 835607e..267fe81 100755
--- a/backends/conary/conaryBackend.py
+++ b/backends/conary/conaryBackend.py
@@ -189,7 +189,7 @@ class PackageKitConaryBackend(PackageKitBaseBackend):
         """
         log.info("=========== get package from package_id ======================")
         name, verString, archString, data =  pkpackage.get_package_from_id(package_id)
-        trove = self.conary.request_query(name)
+        trove = self.conary.repo_query(name)
         if trove:
             return trove
         else:
@@ -384,24 +384,31 @@ class PackageKitConaryBackend(PackageKitBaseBackend):
         log.info(pkg_dict)
         if pkg_dict is None:
             return None
+
         log.info("doing a resolve")
-        filter = ConaryFilter(filters)
-        trove = None
-    
-        trove_installed = self.conary.query( pkg_dict.get("name") )
-        log.info("end of conary query")
-        if trove_installed:
-            pkg = self._convert_package( trove_installed[0], pkg_dict )
-            log.info( pkg)
-            filter.add_installed( [ pkg ] )
-        log.info("filter installed end.. doing a rq")    
-        trove_available = self.conary.request_query( pkg_dict.get("name") )
-        log.info("end of conary rquery")
-        if trove_available:
-            pkg = self._convert_package( trove_available[0], pkg_dict )
-            filter.add_available(  [ pkg ] )
-
-        log.info("filter available end")    
+        # Our list of troves doesn't contain information about whether trove is
+        # installed, so ConaryFilter can't do proper filtering. Don't pass
+        # @filters to it. Instead manually check the filters before calling
+        # add_installed() and add_available().
+        filter = ConaryFilter()
+
+        is_found_locally = False
+        if FILTER_NOT_INSTALLED not in filters:
+            trove_installed = self.conary.query(pkg_dict.get("name"))
+            log.info("end of conary query")
+            if trove_installed:
+                pkg = self._convert_package(trove_installed[0], pkg_dict)
+                log.info( pkg)
+                filter.add_installed([pkg])
+                is_found_locally = True
+
+        if not is_found_locally and FILTER_INSTALLED not in filters:
+            trove_available = self.conary.repo_query(pkg_dict.get("name"))
+            log.info("end of conary rquery")
+            if trove_available:
+                pkg = self._convert_package(trove_available[0], pkg_dict)
+                filter.add_available([pkg])
+
         package_list = filter.post_process()
         log.info("package_list %s" % package_list)
         self._show_package_list(package_list)
diff --git a/backends/conary/conarypk.py b/backends/conary/conarypk.py
index f0bb12c..2ec9f71 100644
--- a/backends/conary/conarypk.py
+++ b/backends/conary/conarypk.py
@@ -48,10 +48,6 @@ class ConaryPk:
             Pk = PackageKitBaseBackend("")
             Pk.error(ERROR_NO_NETWORK,"Not exist network conection")
 
-    def _get_db(self):
-        """ get the database for do querys """
-        return self.db 
-
     def _get_repos(self):
         """ get repos for do request query """
         return self.repos
@@ -82,15 +78,13 @@ class ConaryPk:
         """ do a conary query """
         if name is None or name == "":
             return []
-        db = self._get_db()
         try:
-            troves = db.findTrove( None ,(name , None, None ))
-            #return db.getTroves(troves)
+            troves = self.db.findTrove( None ,(name , None, None ))
             return troves
         except TroveNotFound:
             return []
 
-    def request_query(self, name, installLabel = None):
+    def repo_query(self, name, installLabel = None):
         """ Do a conary request query """
         self._exist_network()
         label = self.label( installLabel )
@@ -110,7 +104,7 @@ class ConaryPk:
     def update(self, name, installLabel= None, remove  = False ):
         cli = self.cli
         #get a trove
-        troves = self.request_query(name, installLabel)
+        troves = self.repo_query(name, installLabel)
         for trove in troves:
             trovespec =  self.trove_to_spec( trove, remove )
         try:
@@ -137,9 +131,9 @@ if __name__ == "__main__":
     conary = ConaryPk()
     print conary.search_path("/usr/bin/vim")
     #print conary.query("gimpasdas")
-    #print conary.request_query("dpaster",'zodyrepo.rpath.org at rpl:devel')
-    #print conary.request_query("gimp")
-    #print conary.request_query("gimpasdasd")
+    #print conary.repo_query("dpaster",'zodyrepo.rpath.org at rpl:devel')
+    #print conary.repo_query("gimp")
+    #print conary.repo_query("gimpasdasd")
     #print conary.update("amsn")
     #print conary.remove("amsn")
 
commit ae8787ffd6e4b3ab2dd52694e68ace1edc56b427
Author: Jesse Zhang <zh.jesse at gmail.com>
Date:   Mon Jan 31 09:37:59 2011 +0800

    conary: fix installed filter
    
    ConaryFilter can't do proper filtering, since our list of troves doesn't
    contain information about whether a trove is installed.
    
    Check filters manually before calling add_installed() and add_available().

diff --git a/backends/conary/conaryBackend.py b/backends/conary/conaryBackend.py
index 21b4b8a..835607e 100755
--- a/backends/conary/conaryBackend.py
+++ b/backends/conary/conaryBackend.py
@@ -318,7 +318,6 @@ class PackageKitConaryBackend(PackageKitBaseBackend):
         log.info("======= _resolve_list =====")
 
         # 1. Resolve through local db
-        # FIXME if filter install exists, only do a conary q
 
         list_trove_all = [p.get("trove") for p in self.packages]
         list_installed = []
@@ -335,32 +334,37 @@ class PackageKitConaryBackend(PackageKitBaseBackend):
                 list_installed.append(pkg)
                 list_not_installed.remove(pkg)
 
-        pkgFilter = ConaryFilter(filters)
-        pkgFilter.add_installed(list_installed)
-        log.info("Packages installed .... %s " % len(db_trove_list))
+        # Our list of troves doesn't contain information about whether trove is
+        # installed, so ConaryFilter can't do proper filtering. Don't pass
+        # @filters to it. Instead manually check the filters before calling
+        # add_installed() and add_available().
+        pkgFilter = ConaryFilter()
+        if FILTER_NOT_INSTALLED not in filters:
+            pkgFilter.add_installed(list_installed)
+        log.info("Packages installed .... %s " % len(list_installed))
         log.info("Packages available .... %s " % len(list_not_installed))
 
         # 2. Resolve through repository
-        # FIXME if filter ~install exists, only do a conary rq
 
-        list_trove_not_installed = []
-        for pkg in list_not_installed:
-            name,version,flavor = pkg.get("trove")
-            trove = (name, version, self.conary.flavor)
-            list_trove_not_installed.append(trove)
-
-        list_available = []
-        repo_trove_list = self.client.repos.findTroves(self.conary.default_label,
-                list_trove_not_installed, allowMissing=True)
-
-        for trove in list_trove_not_installed:
-            if trove in repo_trove_list:
-                # only use the first trove in the list
-                t = repo_trove_list[trove][0]
-                pkg = self._search_package(t[0])
-                pkg["trove"] = t
-                list_available.append(pkg)
-        pkgFilter.add_available( list_available )
+        if FILTER_INSTALLED not in filters:
+            list_trove_not_installed = []
+            for pkg in list_not_installed:
+                name,version,flavor = pkg.get("trove")
+                trove = (name, version, self.conary.flavor)
+                list_trove_not_installed.append(trove)
+
+            list_available = []
+            repo_trove_list = self.client.repos.findTroves(self.conary.default_label,
+                    list_trove_not_installed, allowMissing=True)
+
+            for trove in list_trove_not_installed:
+                if trove in repo_trove_list:
+                    # only use the first trove in the list
+                    t = repo_trove_list[trove][0]
+                    pkg = self._search_package(t[0])
+                    pkg["trove"] = t
+                    list_available.append(pkg)
+            pkgFilter.add_available( list_available )
 
         package_list = pkgFilter.post_process()
         self._show_package_list(package_list)
commit d119e267223e97e2cff483b65fa7c9fc99a57eb1
Author: Jesse Zhang <zh.jesse at gmail.com>
Date:   Sun Jan 30 22:07:29 2011 +0800

    conary: clean up resolve_list
    
    Give more staightforward names to variables and organize codes into
    logical blocks.
    
    _search_package doesn't need to return an index.

diff --git a/backends/conary/conaryBackend.py b/backends/conary/conaryBackend.py
index 762705c..21b4b8a 100755
--- a/backends/conary/conaryBackend.py
+++ b/backends/conary/conaryBackend.py
@@ -196,10 +196,10 @@ class PackageKitConaryBackend(PackageKitBaseBackend):
             return cli.query(name)
 
     def _search_package( self, name ):
-        for i,pkg in enumerate(self.packages):
+        for pkg in self.packages:
             if pkg["trove"][0] == name:
-                return i,pkg
-        return None,None
+                return pkg
+        return None
 
     def _edit_package(self, trove, pkgDict, status):
         for i,pkg in enumerate(self.packages):
@@ -315,47 +315,53 @@ class PackageKitConaryBackend(PackageKitBaseBackend):
         return self._do_update(applyList, simulate)
 
     def _resolve_list(self, filters):
-
         log.info("======= _resolve_list =====")
-        list_install = []
-        app_found = self.packages[:]
-        specList = [p.get("trove") for p in self.packages]
+
+        # 1. Resolve through local db
+        # FIXME if filter install exists, only do a conary q
+
+        list_trove_all = [p.get("trove") for p in self.packages]
+        list_installed = []
+        # initialize with the full list, and remove installed troves later
+        list_not_installed = self.packages[:]
+
+        db_trove_list = self.client.db.findTroves(None, list_trove_all, allowMissing=True)
+        for trove in list_trove_all:
+            if trove in db_trove_list:
+                # only use the first trove in the list
+                t = db_trove_list[trove][0]
+                pkg = self._search_package(t[0])
+                pkg["trove"] = t
+                list_installed.append(pkg)
+                list_not_installed.remove(pkg)
 
         pkgFilter = ConaryFilter(filters)
-        # if filter install exist only do a conary q
-        trovesList = self.client.db.findTroves( None ,specList, allowMissing = True)
-        log.info("Packages installed .... %s " % len(trovesList))
-        for trove in specList:
-            if trove in trovesList:
-                t = trovesList[trove]
-                name,version,flav = t[0]
-                #log.info(t[0][0])
-                pos, pkg = self._search_package(name)
-                pkg["trove"] = (name, version,flav)
-                list_install.append(pkg)
-                app_found.remove(pkg)
-
-        pkgFilter.add_installed( list_install )
-        # if filter ~install exist only do a conary rq
-        log.info("Packages availables ........ %s " % len(app_found) )
-
-        specList = []
-        for pkg in app_found:
+        pkgFilter.add_installed(list_installed)
+        log.info("Packages installed .... %s " % len(db_trove_list))
+        log.info("Packages available .... %s " % len(list_not_installed))
+
+        # 2. Resolve through repository
+        # FIXME if filter ~install exists, only do a conary rq
+
+        list_trove_not_installed = []
+        for pkg in list_not_installed:
             name,version,flavor = pkg.get("trove")
-            trove = name, version, self.conary.flavor
-            specList.append(trove)
-        trovelist = self.client.repos.findTroves(self.conary.default_label, specList, allowMissing=True)
+            trove = (name, version, self.conary.flavor)
+            list_trove_not_installed.append(trove)
 
         list_available = []
-        for trove in specList:
-            if trove in trovelist:
-                t = trovelist[trove]
-                name,version,flav = t[0]
-                pos , pkg = self._search_package(name )
-                pkg["trove"] = t[0]
+        repo_trove_list = self.client.repos.findTroves(self.conary.default_label,
+                list_trove_not_installed, allowMissing=True)
+
+        for trove in list_trove_not_installed:
+            if trove in repo_trove_list:
+                # only use the first trove in the list
+                t = repo_trove_list[trove][0]
+                pkg = self._search_package(t[0])
+                pkg["trove"] = t
                 list_available.append(pkg)
-        log.info(">>>>>>>>>>>>>>>>>><<")
         pkgFilter.add_available( list_available )
+
         package_list = pkgFilter.post_process()
         self._show_package_list(package_list)
  
commit 261ac5a3dc98652cb8aac3b04a8abe9d7c788c75
Author: Jesse Zhang <zh.jesse at gmail.com>
Date:   Sun Jan 30 17:00:19 2011 +0800

    conary: fix get-details to really output the licenses
    
    Simplify the code a bit and don't filter through
    PackageKitEnum.free_licenses.

diff --git a/backends/conary/conaryBackend.py b/backends/conary/conaryBackend.py
index 33376ca..762705c 100755
--- a/backends/conary/conaryBackend.py
+++ b/backends/conary/conaryBackend.py
@@ -742,13 +742,11 @@ class PackageKitConaryBackend(PackageKitBaseBackend):
             name,version,arch,data = pkpackage.get_package_from_id(package_id)
             pkgDict = self.xmlcache.resolve(name)
             if name and pkgDict:
-                shortDesc = ""
                 longDesc = ""
                 url = ""
                 categories  = None
                 license = ""
 
-                shortDesc = pkgDict.get("shortDesc", "")
                 longDesc = pkgDict.get("longDesc", "")
                 url = pkgDict.get("url", "")
                 categories = self.xmlcache.getGroup(pkgDict.get("category",""))
@@ -799,13 +797,12 @@ class PackageKitConaryBackend(PackageKitBaseBackend):
             return ""
     def _get_license(self, license_list ):
         if license_list == "":
-           return ""
-        for i in license_list:
-            lic = i.split("/")
-            for j in PackageKitEnum.free_licenses:
-                if lic[1:][0].lower() == j.lower():
-                    return j
-        return ""
+            return ""
+
+        # license_list is a list of licenses in the format of
+        # 'rpath.com/licenses/copyright/GPL-2'.
+        return " ".join([i.split("/")[-1] for i in license_list])
+
     def _upgrade_from_branch( self, branch):
         branchList = branch.split("@")
         if "2-qa" in branchList[1]:
commit d05d4f28e6099cf3c5dc539e07a06d48b87cbc80
Author: Jesse Zhang <zh.jesse at gmail.com>
Date:   Sat Jan 29 21:42:10 2011 +0800

    conary: simplify a little

diff --git a/backends/conary/XMLCache.py b/backends/conary/XMLCache.py
index 9175bc9..3247a0a 100644
--- a/backends/conary/XMLCache.py
+++ b/backends/conary/XMLCache.py
@@ -282,9 +282,7 @@ class XMLCache:
         """
         repositories_result = []
         for repo in self.repos:
-            results = repo.search(search , where )
-            for i in results:
-                repositories_result.append(i)
+            repositories_result.extend(repo.search(search, where))
         return self.list_set( repositories_result)
 
     def resolve_list(self, search_list ):
@@ -297,6 +295,9 @@ class XMLCache:
 
     def list_set(self, repositories_result ):
         names = set( [i["name"] for i in repositories_result] )
+        if len(repositories_result) == len(names):
+            return repositories_result
+
         #log.info("names>>>>>>>>>>>>>>>>>>>>><")
         #log.info(names)
         results = []
diff --git a/backends/conary/conaryBackend.py b/backends/conary/conaryBackend.py
index 657e837..33376ca 100755
--- a/backends/conary/conaryBackend.py
+++ b/backends/conary/conaryBackend.py
@@ -317,14 +317,9 @@ class PackageKitConaryBackend(PackageKitBaseBackend):
     def _resolve_list(self, filters):
 
         log.info("======= _resolve_list =====")
-        specList = []
-        app_found = []
         list_install = []
-        for pkg in self.packages:
-            name, version, flavor = pkg.get("trove")
-            #log.info(name)
-            app_found.append(pkg)
-            specList.append(pkg.get("trove"))
+        app_found = self.packages[:]
+        specList = [p.get("trove") for p in self.packages]
 
         pkgFilter = ConaryFilter(filters)
         # if filter install exist only do a conary q
commit df2adcee7e7b6b5eec35c8aa817be9d048369866
Author: Jesse Zhang <zh.jesse at gmail.com>
Date:   Sat Jan 29 18:31:12 2011 +0800

    conary: add some test

diff --git a/backends/conary/test-label.xml b/backends/conary/test-label.xml
new file mode 100644
index 0000000..5b65bba
--- /dev/null
+++ b/backends/conary/test-label.xml
@@ -0,0 +1,28 @@
+<Packages label="test-label">
+
+<Package>
+  <name>kernel</name>
+  <version>2.6.35.10-5-1</version>
+  <shortDesc lang="en">The Linux kernel</shortDesc>
+  <longDesc lang="en">
+    The kernel package contains the Linux kernel (vmlinuz), the core of any Linux operating system.  The kernel handles the basic functions of the operating system: memory allocation, process allocation, device input and output, etc.
+  </longDesc>
+</Package>
+
+<Package>
+  <name>splint</name>
+  <version>3.1.1-7-0.1</version>
+  <crypto lang="en">['None']</crypto>
+  <licenses lang="en">['rpath.com/licenses/copyright/GPL-2']</licenses>
+</Package>
+
+<Package>
+  <name>xchat</name>
+  <version>2.8.8-1-1</version>
+  <shortDesc lang="en">XChat IRC</shortDesc>
+  <longDesc lang="en">Chat with other people using Internet Relay Chat</longDesc>
+  <category lang="en">Application</category>
+  <category lang="en">Network</category>
+</Package>
+
+</Packages>
diff --git a/backends/conary/test.py b/backends/conary/test.py
new file mode 100755
index 0000000..ac8f701
--- /dev/null
+++ b/backends/conary/test.py
@@ -0,0 +1,41 @@
+#!/usr/bin/env python
+
+import unittest
+import os
+
+import XMLCache
+
+class TestXMLRepo(unittest.TestCase):
+    def setUp(self):
+        test_label = 'test-label'
+        self.xml_repo = XMLCache.XMLRepo(label=test_label, path=os.getcwd(), pk=None)
+
+    def test_search_name_count(self):
+        self.assertEqual(1, len(self.xml_repo.search(['kernel'], 'name')))
+
+    def test_search_name_count2(self):
+        self.assertEqual(1, len(self.xml_repo.search(['kernel', 'kernel'], 'name')))
+
+    def test_search_name_name(self):
+        self.assertEqual('kernel',
+                self.xml_repo.search(['kernel'], 'name')[0]['name'])
+
+    def test_search_name_url(self):
+        self.assertEqual('',
+                self.xml_repo.search(['kernel'], 'name')[0]['url'])
+
+    def test_search_detail_count(self):
+        self.assertEqual(1, len(self.xml_repo.search(['xchat'], 'details')))
+
+    def test_search_detail_version(self):
+        self.assertEqual('2.8.8-1-1',
+                self.xml_repo.search(['xchat'], 'details')[0]['version'])
+
+    def test_search_group_count(self):
+        self.assertEqual(1, len(self.xml_repo.search(['internet'], 'group')))
+
+    def test_search_group_count2(self):
+        self.assertEqual(1, len(self.xml_repo.search(['internet', 'internet'], 'group')))
+
+if __name__ == '__main__':
+    unittest.main()
commit cfb59cda1201c6cab34cff9f9c7935caedbbd5cd
Author: Jesse Zhang <zh.jesse at gmail.com>
Date:   Sat Jan 29 15:44:47 2011 +0800

    conary: fix refresh-cache
    
    Stop trying to parse the XML file in __init__, or else refresh-cache has
    no way to continue.
    
    Also need to put _fetch_XML in XMLRepo. Data about a single repo should
    be managed in XMLRepo instead of XMLCache.

diff --git a/backends/conary/XMLCache.py b/backends/conary/XMLCache.py
index f0c45a3..9175bc9 100644
--- a/backends/conary/XMLCache.py
+++ b/backends/conary/XMLCache.py
@@ -41,12 +41,28 @@ def mapGroup(categorieList):
     return where
 #}}}
 class XMLRepo:
-    xml_path = ""
-    repository = ""
-    def __init__(self, repo, path, pk):
+
+    # Let's only get XML data from things that we support.
+    # XXX We really should replace this with the Conary
+    #     RESTful API real soon now.
+    server = "http://packages.foresightlinux.org/cache/"
+    pregenerated_XML_labels = (
+        'conary.rpath.com at rpl:2-qa',
+        'foresight.rpath.org at fl:2',
+        'foresight.rpath.org at fl:2-qa',
+        'foresight.rpath.org at fl:2-devel',
+        'foresight.rpath.org at fl:2-kernel',
+        'foresight.rpath.org at fl:2-qa-kernel',
+        'foresight.rpath.org at fl:2-devel-kernel',
+    )
+
+    def __init__(self, label, path, pk):
         self.pk = pk
-        self.xml_path = path
-        self._setRepo(repo)
+        self.label = label
+        self.xml_file = "%s/%s.xml" % (path, label)
+
+        # Build up cache on first run
+        self.refresh_cache()
 
     def resolve(self, search_trove):
         """ resolve its a search with name """
@@ -71,21 +87,34 @@ class XMLRepo:
             return self._getAllPackages()
         return []
 
-    def _setRepo(self,repo):  
-        self.repo = repo
-        doc = self._open()
-        self.label = str( doc.get("label") )
+    def _fetchXML(self):
+        log.info("Updating XMLCache for label %s" % self.label)
+        if self.label in self.pregenerated_XML_labels:
+            wwwfile = "%s/%s.xml" % (self.server, self.label)
+            try:
+                wget = url.urlopen(wwwfile)
+                openfile = open(self.xml_file, 'w')
+                openfile.write(wget.read())
+                openfile.close()
+            except:
+                self.pk.error(ERROR_NO_NETWORK,"Failed to fetch %s." % wwwfile)
+        else:
+            generateXML.init(self.label, self.xml_file, self.conarypk)
+
+    def refresh_cache(self, force=False):
+        if force or not os.path.exists(self.xml_file):
+            self._fetchXML()
 
     def _open(self):
         try:
             return self._repo
         except AttributeError:
             try:
-                r = self.xml_path +self.repo
-                self._repo =   cElementTree.parse(r).getroot()
+                self._repo = cElementTree.parse(self.xml_file).getroot()
                 return self._repo
-            except:
-                self.pk.error(ERROR_REPO_CONFIGURATION_ERROR," The file %s not parsed submit a issue at http://issues.foresightlinux.org" % self.repo )
+            except SyntaxError as e:
+                self.pk.error(ERROR_REPO_CONFIGURATION_ERROR, "Failed to parse %s: %s. A cache refresh should fix this." %
+                        (self.xml_file, str(e)))
        
 
     def _generatePackage(self, package_node ): 
@@ -179,20 +208,6 @@ class XMLRepo:
 
 class XMLCache:
 
-    # Let's only get XML data from things that we support.
-    # XXX We really should replace this with the Conary
-    #     RESTful API real soon now.
-    pregenerated_XML_labels = (
-        'conary.rpath.com at rpl:2-qa',
-        'foresight.rpath.org at fl:2',
-        'foresight.rpath.org at fl:2-qa',
-        'foresight.rpath.org at fl:2-devel',
-        'foresight.rpath.org at fl:2-kernel',
-        'foresight.rpath.org at fl:2-qa-kernel',
-        'foresight.rpath.org at fl:2-devel-kernel',
-    )
-
-    server = "http://packages.foresightlinux.org/cache/"
     repos = []
     dbPath = '/var/cache/conary/'
     jobPath = dbPath + 'jobs'
@@ -211,9 +226,7 @@ class XMLCache:
             os.makedirs(self.xml_path )
 
         for label in self.labels:
-           if not os.path.exists( self.xml_path + label + ".xml"  ):
-                self._fetchXML(label)
-           self.repos.append(XMLRepo( label + ".xml", self.xml_path, self.pk ))
+            self.repos.append(XMLRepo(label, self.xml_path, self.pk))
 
     def _getJobCachePath(self, applyList):
         applyStr = '\0'.join(['%s=%s[%s]--%s[%s]%s' % (x[0], x[1][0], x[1][1], x[2][0], x[2][1], x[3]) for x in applyList])
@@ -252,8 +265,8 @@ class XMLCache:
         pass
 
     def refresh(self):
-        for label in self.labels:
-            self._fetchXML(label)
+        for repo in self.repos:
+            repo.refresh_cache(force=True)
 
     def resolve(self, name ):
         for repo in self.repos:
@@ -295,22 +308,6 @@ class XMLCache:
         #log.debug([i["name"] for i in results ] )
         return results
 
-    def _fetchXML(self, label):
-        log.info("Updating XMLCache for label %s" % label)
-        filename = label + '.xml'
-        filepath = self.xml_path + filename
-        if label in self.pregenerated_XML_labels:
-            wwwfile = self.server + filename
-            try:
-                wget = url.urlopen( wwwfile )
-                openfile = open(filepath,'w')
-                openfile.writelines(wget.readlines())
-                openfile.close()
-            except:
-                self.pk.error(ERROR_NO_NETWORK,"%s can not open" % wwwfile)
-        else:
-            generateXML.init(label,filepath,self.conarypk)
-
     def getGroup(self,categorieList):
         return getGroup(categorieList)
                 
commit 41a1cff532d114bd519b127c13a79609f29c0b31
Author: Jesse Zhang <zh.jesse at gmail.com>
Date:   Sat Jan 29 13:45:56 2011 +0800

    conary: fix search-details
    
    search-details is now provided the values argument in a list.

diff --git a/backends/conary/XMLCache.py b/backends/conary/XMLCache.py
index 25a4060..f0c45a3 100644
--- a/backends/conary/XMLCache.py
+++ b/backends/conary/XMLCache.py
@@ -148,31 +148,26 @@ class XMLRepo:
         return results
 
 
-    def _searchDetailsPackage(self, name):
-        return self._searchPackage(name)
-
-    def _searchPackage(self, name):
+    def _searchDetailsPackage(self, searchlist):
+        '''Search in package name, shortDesc, longDesc, and category
+        '''
         doc = self._open()
         results = []
         for package in doc.findall("Package"):
-            # categoria
-            pkg = self._generatePackage(package)
-            for i in pkg.keys():
-                if i  == "label":
-                    continue
-                if i =='category':
-                    for j in pkg[i]:
-                        if name.lower() in j.lower():
-                            results.append(pkg)
-                
-                if type(pkg[i]) == str:
-                    check = pkg[i].lower()
-                else:
-                    check = pkg[i]
-                if name.lower() in check:
-                    results.append(pkg)
-            
+            info = (
+                package.find("name").text.lower(),
+                getattr(package.find("shortDesc"), "text", "").lower(),
+                getattr(package.find("longDesc"), "text", "").lower(),
+                getattr(package.find("category"), "text", "").lower(),
+            )
+            for s in searchlist:
+                for i in info:
+                    if s.lower() in i.lower():
+                        results.append(self._generatePackage(package))
+                        break
+
         return results
+
     def _getAllPackages(self):
         doc = self._open()
         results = []
commit 41eb2d4798ccd7c667f6e78be80a321d78aeb652
Author: Jesse Zhang <zh.jesse at gmail.com>
Date:   Sat Jan 29 11:54:23 2011 +0800

    conary: fix search-group
    
    search-group is now provided the values argument in a list.

diff --git a/backends/conary/XMLCache.py b/backends/conary/XMLCache.py
index 52af14a..25a4060 100644
--- a/backends/conary/XMLCache.py
+++ b/backends/conary/XMLCache.py
@@ -131,16 +131,21 @@ class XMLRepo:
                     break
         return results
 
-    def _searchGroupPackage(self, name):
+    def _searchGroupPackage(self, searchlist):
+        '''Search in package category
+        '''
         doc = self._open()
-        results_group = []
+        results = []
         for package in doc.findall("Package"):
-            pkg = self._generatePackage(package)
-            if pkg.has_key("category"):
-                group = getGroup(pkg["category"])
-                if name.lower() == group:
-                    results_group.append(pkg)
-        return results_group
+            category = package.findall("category")
+            if not category:
+                continue
+            for s in searchlist:
+                if s.lower() in mapGroup([c.text for c in category]):
+                    results.append(self._generatePackage(package))
+                    break
+
+        return results
 
 
     def _searchDetailsPackage(self, name):
commit 9b839457d60a08bc347ceb58582a653a35a7336e
Author: Jesse Zhang <zh.jesse at gmail.com>
Date:   Sat Jan 29 10:55:18 2011 +0800

    conary: fix search-name
    
    search-name is now provided the values argument in a list instead of a str.

diff --git a/backends/conary/XMLCache.py b/backends/conary/XMLCache.py
index 2b18030..52af14a 100644
--- a/backends/conary/XMLCache.py
+++ b/backends/conary/XMLCache.py
@@ -119,12 +119,16 @@ class XMLRepo:
                 r.append(pkg)
         return r
 
-    def _searchNamePackage(self, name):
+    def _searchNamePackage(self, searchlist):
+        '''Search in package name
+        '''
         doc = self._open()
         results = []
         for package in doc.findall("Package"):
-            if name.lower() in str(package.find("name").text).lower():
-                results.append(self._generatePackage(package))
+            for s in searchlist:
+                if s.lower() in str(package.find("name").text).lower():
+                    results.append(self._generatePackage(package))
+                    break
         return results
 
     def _searchGroupPackage(self, name):
commit 7df4eb7270d390836aaff598e49b26dc4674cc65
Author: Richard Hughes <richard at hughsie.com>
Date:   Thu Jan 27 14:47:38 2011 +0000

    glib: do not return distro-specific id's whilst testing, to fix 'make check' on Debian

diff --git a/data/tests/test.catalog b/data/tests/test.catalog
index dfba0fc..8bc74c4 100644
--- a/data/tests/test.catalog
+++ b/data/tests/test.catalog
@@ -2,15 +2,15 @@
 
 # Just a package on all versions of fedora that can provide the dependency.
 # If there are multiple packages then the user will be asked to choose
-InstallProvides(fedora)=":lang=bo"
+InstallProvides(selftest)=":lang=bo"
 
 # Just for Fedora 12, install a development file
-InstallPackages(fedora;11.91)=ruby-json
+InstallPackages(selftest;11.91)=ruby-json
 
 # On any distro, install the package with this file
 InstallFiles=/usr/bin/kate
 
 # For each architecture on Fedora rawhide, install one of the two different files
-InstallFiles(fedora;11.91;i686)=/usr/bin/pand
-InstallFiles(fedora;11.91;x64)=/usr/bin/dund
+InstallFiles(selftest;11.91;i686)=/usr/bin/pand
+InstallFiles(selftest;11.91;x64)=/usr/bin/dund
 
diff --git a/lib/packagekit-glib2/pk-common.c b/lib/packagekit-glib2/pk-common.c
index fff753c..a186889 100644
--- a/lib/packagekit-glib2/pk-common.c
+++ b/lib/packagekit-glib2/pk-common.c
@@ -219,6 +219,10 @@ pk_get_distro_id (void)
 	   installed on a i386 machine.
 	*/
 
+	/* we don't want distro specific results in 'make check' */
+	if (g_getenv ("PK_SELF_TEST") != NULL)
+		return g_strdup ("selftest;11.91;i686");
+
 	/* we can't get arch from /etc */
 	arch = pk_get_distro_id_machine_type ();
 
diff --git a/lib/packagekit-glib2/pk-control.c b/lib/packagekit-glib2/pk-control.c
index 075423f..6a975ac 100644
--- a/lib/packagekit-glib2/pk-control.c
+++ b/lib/packagekit-glib2/pk-control.c
@@ -1656,6 +1656,10 @@ pk_control_set_network_state (PkControl *control, PkNetworkEnum network_state)
 static void
 pk_control_set_distro_id (PkControl *control, const gchar *distro_id)
 {
+	/* we don't want distro specific results in 'make check' */
+	if (g_getenv ("PK_SELF_TEST") != NULL)
+		distro_id = "selftest;11.91;i686";
+
 	/* is the same as before */
 	if (g_strcmp0 (control->priv->distro_id, distro_id) == 0)
 		return;
commit 1466503bab00a316252bb1d951d7a3167da2d587
Author: Richard Hughes <richard at hughsie.com>
Date:   Thu Jan 27 14:25:42 2011 +0000

    glib: ensure we test for and always run the self-check-socket-program in 'make check'

diff --git a/lib/packagekit-glib2/pk-client.c b/lib/packagekit-glib2/pk-client.c
index fa2f18b..160f1e9 100644
--- a/lib/packagekit-glib2/pk-client.c
+++ b/lib/packagekit-glib2/pk-client.c
@@ -1809,63 +1809,119 @@ pk_client_bool_to_string (gboolean value)
 }
 
 /**
+ * pk_client_create_helper_argv_envp_test:
+ **/
+static gboolean
+pk_client_create_helper_argv_envp_test (PkClientState *state,
+					gchar ***argv,
+					gchar ***envp)
+{
+	gboolean ret;
+
+	/* check we have the right file */
+	ret = g_file_test (TESTDATADIR "/pk-client-helper-test.py",
+			   G_FILE_TEST_EXISTS);
+	if (!ret) {
+		g_warning ("could not find the socket helper!");
+		goto out;
+	}
+
+	/* setup simple test socket */
+	*argv = g_new0 (gchar *, 2);
+	*argv[0] = g_build_filename (TESTDATADIR,
+				     "pk-client-helper-test.py",
+				     NULL);
+out:
+	return ret;
+}
+
+/**
+ * pk_client_create_helper_argv_envp:
+ **/
+static gboolean
+pk_client_create_helper_argv_envp (PkClientState *state,
+				   gchar ***argv,
+				   gchar ***envp)
+{
+	const gchar *dialog = NULL;
+	const gchar *display;
+	const gchar *term;
+	gboolean ret;
+	guint envpi = 0;
+
+	/* check we have the right file */
+	ret = g_file_test ("/usr/bin/debconf-communicate",
+			   G_FILE_TEST_EXISTS);
+	if (!ret)
+		goto out;
+
+	/* setup simple test socket */
+	*argv = g_new0 (gchar *, 2);
+	*argv[0] = g_strdup ("/usr/bin/debconf-communicate");
+
+	*envp = g_new0 (gchar *, 8);
+	*envp[envpi++] = g_strdup ("DEBCONF_DB_REPLACE=configdb");
+	*envp[envpi++] = g_strdup ("DEBCONF_DB_OVERRIDE=Pipe{infd:none outfd:none}");
+	if (pk_debug_is_verbose ())
+		*envp[envpi++] = g_strdup ("DEBCONF_DEBUG=.");
+
+	/* do we have an available terminal to use */
+	term = g_getenv ("TERM");
+	if (term != NULL) {
+		*envp[envpi++] = g_strdup_printf ("TERM=%s", term);
+		dialog = "dialog";
+	}
+
+	/* do we have access to the display */
+	display = g_getenv ("DISPLAY");
+	if (display != NULL) {
+		*envp[envpi++] = g_strdup_printf ("DISPLAY=%s", display);
+		if (g_strcmp0 (g_getenv ("KDE_FULL_SESSION"), "true") == 0)
+		  dialog = "kde";
+		else
+		  dialog = "gnome";
+	}
+
+	/* indicate a prefered frontend */
+	if (dialog != NULL) {
+		*envp[envpi++] = g_strdup_printf ("DEBIAN_FRONTEND=%s", dialog);
+		g_debug ("using frontend %s", dialog);
+	}
+out:
+	return ret;
+}
+
+/**
  * pk_client_create_helper_socket:
  **/
 static gchar *
 pk_client_create_helper_socket (PkClientState *state)
 {
+	gboolean ret = FALSE;
+	gchar **argv = NULL;
+	gchar **envp = NULL;
 	gchar *hint = NULL;
 	gchar *socket_filename = NULL;
 	gchar *socket_id = NULL;
 	GError *error = NULL;
-	gboolean ret;
-	gchar **argv = NULL;
-	gchar **envp = NULL;
-	guint argvi = 0;
-	guint envpi = 0;
-	const gchar *display;
-	const gchar *term;
-	const gchar *dialog = NULL;
 
-	/* do we have any supported clients */
-	if (g_file_test ("/usr/bin/debconf-communicate", G_FILE_TEST_EXISTS)) {
-		argv = g_new0 (gchar *, 2);
-		argv[argvi++] = g_strdup ("/usr/bin/debconf-communicate");
-		envp = g_new0 (gchar *, 8);
-		envp[envpi++] = g_strdup ("DEBCONF_DB_REPLACE=configdb");
-		envp[envpi++] = g_strdup ("DEBCONF_DB_OVERRIDE=Pipe{infd:none outfd:none}");
-		if (pk_debug_is_verbose ())
-			envp[envpi++] = g_strdup ("DEBCONF_DEBUG=.");
-
-		/* do we have an available terminal to use */
-		term = g_getenv ("TERM");
-		if (term != NULL) {
-			envp[envpi++] = g_strdup_printf ("TERM=%s", term);
-			dialog = "dialog";
-		}
+	/* use the test socket */
+	if (g_getenv ("PK_SELF_TEST") != NULL) {
+		ret = pk_client_create_helper_argv_envp_test (state,
+							      &argv,
+							      &envp);
+	}
 
-		/* do we have access to the display */
-		display = g_getenv ("DISPLAY");
-		if (display != NULL) {
-			envp[envpi++] = g_strdup_printf ("DISPLAY=%s", display);
-			if (g_strcmp0 (g_getenv ("KDE_FULL_SESSION"), "true") == 0)
-			  dialog = "kde";
-			else
-			  dialog = "gnome";
-		}
+	/* either the self test failed, or we're not in self test */
+	if (!ret) {
+		ret = pk_client_create_helper_argv_envp (state,
+							 &argv,
+							 &envp);
+	}
 
-		/* indicate a prefered frontend */
-		if (dialog != NULL) {
-			envp[envpi++] = g_strdup_printf ("DEBIAN_FRONTEND=%s", dialog);
-			g_debug ("using frontend %s", dialog);
-		}
-	} else if (g_file_test (TESTDATADIR "/pk-client-helper-test.py", G_FILE_TEST_EXISTS)) {
-		argv = g_new0 (gchar *, 2);
-		argv[argvi++] = g_build_filename (TESTDATADIR, "pk-client-helper-test.py", NULL);
-	} else {
-		/* no supported frontends available */
+	/* no supported frontends available */
+	if (!ret)
 		goto out;
-	}
 
 	/* create object */
 	state->client_helper = pk_client_helper_new ();
diff --git a/lib/packagekit-glib2/pk-self-test.c b/lib/packagekit-glib2/pk-self-test.c
index 5b9a38c..27c5a00 100644
--- a/lib/packagekit-glib2/pk-self-test.c
+++ b/lib/packagekit-glib2/pk-self-test.c
@@ -2059,6 +2059,9 @@ main (int argc, char **argv)
 	pk_debug_set_verbose (TRUE);
 	pk_debug_add_log_domain (G_LOG_DOMAIN);
 
+	/* some libraries need to know */
+	g_setenv ("PK_SELF_TEST", "1", TRUE);
+
 	/* tests go here */
 	g_test_add_func ("/packagekit-glib2/common", pk_test_common_func);
 	g_test_add_func ("/packagekit-glib2/enum", pk_test_enum_func);
commit 5f4857b53ad9209a5eb83612312cf8515389192a
Author: Richard Hughes <richard at hughsie.com>
Date:   Wed Jan 26 15:18:12 2011 +0000

    trivial: Use strncmp rather than strcmp when passing the buffer as we can't rely on the data being NULL terminated

diff --git a/lib/packagekit-glib2/pk-self-test.c b/lib/packagekit-glib2/pk-self-test.c
index 2f77458..5b9a38c 100644
--- a/lib/packagekit-glib2/pk-self-test.c
+++ b/lib/packagekit-glib2/pk-self-test.c
@@ -21,6 +21,7 @@
 
 #include "config.h"
 
+#include <string.h>
 #include <glib-object.h>
 #include <glib/gstdio.h>
 #include <gio/gunixsocketaddress.h>
@@ -320,7 +321,8 @@ pk_test_client_helper_output_cb (GSocket *socket, GIOCondition condition, gpoint
 		g_assert_cmpint (len, >, 0);
 
 		/* good for us */
-		if (g_strcmp0 (buffer, "pong\n") == 0) {
+		if (buffer != NULL &&
+		    strncmp (buffer, "pong\n", len) == 0) {
 			_g_test_loop_quit ();
 			goto out;
 		}
commit 8cb9b2f022cfb920e78fb9c73adbdbba9fa29eb0
Author: Richard Hughes <richard at hughsie.com>
Date:   Wed Jan 26 15:16:59 2011 +0000

    Fix calling pk_client_helper_start() with no environment set

diff --git a/lib/packagekit-glib2/pk-client-helper.c b/lib/packagekit-glib2/pk-client-helper.c
index 38ded98..1608dba 100644
--- a/lib/packagekit-glib2/pk-client-helper.c
+++ b/lib/packagekit-glib2/pk-client-helper.c
@@ -472,10 +472,15 @@ pk_client_helper_start (PkClientHelper *client_helper,
 	priv->socket_file = g_file_new_for_path (socket_filename);
 
 	/* preconfigure KDE frontend, if requested */
-	for (i=0; envp[i] != NULL; i++) {
-		if (g_strcmp0 (envp[i], "DEBIAN_FRONTEND=kde") == 0)
-			if (g_file_test ("/usr/bin/debconf-kde-helper", G_FILE_TEST_EXISTS))
-				use_kde_helper = TRUE;
+	if (envp != NULL) {
+		for (i=0; envp[i] != NULL; i++) {
+			if (g_strcmp0 (envp[i], "DEBIAN_FRONTEND=kde") == 0) {
+				if (g_file_test ("/usr/bin/debconf-kde-helper",
+						 G_FILE_TEST_EXISTS)) {
+					use_kde_helper = TRUE;
+				}
+			}
+		}
 	}
 
 	/* cache for actual start */
commit ebea77ef7c678daf3c993a0976c32ecd529c4809
Author: Richard Hughes <richard at hughsie.com>
Date:   Wed Jan 26 15:16:25 2011 +0000

    glib: Check sscanf() returned the correct number of items before using the answer

diff --git a/lib/packagekit-glib2/pk-console-shared.c b/lib/packagekit-glib2/pk-console-shared.c
index 9291738..07b7513 100644
--- a/lib/packagekit-glib2/pk-console-shared.c
+++ b/lib/packagekit-glib2/pk-console-shared.c
@@ -59,7 +59,7 @@ pk_console_get_number (const gchar *question, guint maxnum)
 		retval = sscanf(buffer, "%u", &answer);
 
 		/* positive */
-		if (answer > 0 && answer <= (gint) maxnum)
+		if (retval == 1 && answer > 0 && answer <= (gint) maxnum)
 			break;
 		g_print (_("Please enter a number from 1 to %i: "), maxnum);
 	} while (TRUE);
commit 8be5cd1f326b34d4d0e911a14b0151fba5cb038b
Merge: 9086620... c8d4cd0...
Author: Matthias Klumpp <matthias at nlinux.org>
Date:   Tue Jan 25 15:47:30 2011 +0100

    Merge branch 'master' of gitorious.org:packagekit/packagekit

commit 90866206886d635770a47047b54d65f776af9e8c
Author: Colin Watson <cjwatson at canonical.com>
Date:   Tue Jan 25 15:46:32 2011 +0100

    aptcc: Use a pty rather than a pipe for writing to apt
    
    This works just as well for writing conffile prompt responses, and
    allows apt to produce useful entries in /var/log/apt/term.log again.

diff --git a/backends/aptcc/apt.cpp b/backends/aptcc/apt.cpp
index 78935a1..302967b 100644
--- a/backends/aptcc/apt.cpp
+++ b/backends/aptcc/apt.cpp
@@ -40,6 +40,7 @@
 #include <sys/statfs.h>
 #include <sys/wait.h>
 #include <sys/fcntl.h>
+#include <pty.h>
 
 #define RAMFS_MAGIC     0x858458f6
 
@@ -1762,32 +1763,22 @@ cout << "How odd.. The sizes didn't match, email apt at packages.debian.org";
 
 	// File descriptors for reading dpkg --status-fd
 	int readFromChildFD[2];
-	int writeToChildFD[2];
-	if (pipe(readFromChildFD) < 0 || pipe(writeToChildFD) < 0) {
+	if (pipe(readFromChildFD) < 0) {
 		cout << "Failed to create a pipe" << endl;
 		return false;
 	}
 
-	m_child_pid = fork();
+	int pty_master;
+	m_child_pid = forkpty(&pty_master, NULL, NULL, NULL);
 	if (m_child_pid == -1) {
 		return false;
 	}
 
 	if (m_child_pid == 0) {
-		close(0);
 		//cout << "FORKED: installPackages(): DoInstall" << endl;
-		// redirect writeToChildFD to stdin
-		if (dup(writeToChildFD[0]) != 0) {
-			cerr << "Aptcc: dup failed duplicate pipe to stdin" << endl;
-			close(readFromChildFD[1]);
-			close(writeToChildFD[0]);
-			_exit(1);
-		}
-		close(writeToChildFD[0]);
 
-		// close pipes we don't need
+		// close pipe we don't need
 		close(readFromChildFD[0]);
-		close(writeToChildFD[1]);
 
 		// Change the locale to not get libapt localization
 		setlocale(LC_ALL, "C");
@@ -1833,13 +1824,12 @@ cout << "How odd.. The sizes didn't match, email apt at packages.debian.org";
 	// Check if the child died
 	int ret;
 	while (waitpid(m_child_pid, &ret, WNOHANG) == 0) {
-		updateInterface(readFromChildFD[0], writeToChildFD[1]);
+		updateInterface(readFromChildFD[0], pty_master);
 	}
 
 	close(readFromChildFD[0]);
 	close(readFromChildFD[1]);
-	close(writeToChildFD[0]);
-	close(writeToChildFD[1]);
+	close(pty_master);
 
 	cout << "Parent finished..." << endl;
 	return true;
commit 481f5a1616c8d3c0f0ce1787baacd59ded9f4d70
Author: Colin Watson <cjwatson at canonical.com>
Date:   Tue Jan 25 15:44:28 2011 +0100

    Set client locale to LC_MESSAGES rather than LC_ALL
    
    If some locale categories are set to different values (e.g.
    LANG=en_GB.UTF-8 LC_COLLATE=C), then glibc's setlocale (LC_ALL, NULL)
    will return a composite name, which looks something like this:
    
      LC_CTYPE=en_GB.UTF-8;LC_NUMERIC=en_GB.UTF-8;LC_TIME=en_GB.UTF-8;LC_COLLATE=C;LC_MONETARY=en_GB.UTF-8;LC_MESSAGES=en_GB.UTF-8;LC_PAPER=en_GB.UTF-8;LC_NAME=en_GB.UTF-8;LC_ADDRESS=en_GB.UTF-8;LC_TELEPHONE=en_GB.UTF-8;LC_MEASUREMENT=en_GB.UTF-8;LC_IDENTIFICATION=en_GB.UTF-8
    
    Setting LANG to this, as some backends do, will produce invalid results;
    the only thing that can validly be done with this string is to set the
    LC_ALL locale category to it.
    
    However, in some cases (e.g. the aptcc backend), we need to set the
    locale in the environment rather than via setlocale.  Since some
    programs have been known to look at locale environment variables
    directly, passing a composite name through the environment is probably
    not the most reliable approach.  Instead, fetch the LC_MESSAGES
    category, since our uses of the client locale are generally for message
    localization.

diff --git a/lib/packagekit-glib2/pk-client.c b/lib/packagekit-glib2/pk-client.c
index 5e13780..fa2f18b 100644
--- a/lib/packagekit-glib2/pk-client.c
+++ b/lib/packagekit-glib2/pk-client.c
@@ -4883,7 +4883,7 @@ pk_client_init (PkClient *client)
 					   G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID);
 
 	/* cache locale */
-	client->priv->locale = 	g_strdup (setlocale (LC_ALL, NULL));
+	client->priv->locale = 	g_strdup (setlocale (LC_MESSAGES, NULL));
 }
 
 /**
commit 2fcce8f5014a44e28d00c47e9f01c1b76c8abc5c
Author: Matthias Klumpp <matthias at nlinux.org>
Date:   Tue Jan 25 15:43:38 2011 +0100

    aptcc: sanitize file descriptor handling
    
    Make sure that apt always has a stdout fd.  Running apt with no fd 1 is
    invalid, and causes any maintainer script that writes to stdout (not an
    uncommon practice) to die with EBADF.
    
    Close pipes we don't need before running apt.
    (patch by Colin Watson <cjwatson at canonical.com>)

diff --git a/backends/aptcc/apt.cpp b/backends/aptcc/apt.cpp
index 55c9a62..78935a1 100644
--- a/backends/aptcc/apt.cpp
+++ b/backends/aptcc/apt.cpp
@@ -1783,9 +1783,11 @@ cout << "How odd.. The sizes didn't match, email apt at packages.debian.org";
 			close(writeToChildFD[0]);
 			_exit(1);
 		}
+		close(writeToChildFD[0]);
 
-		// close Forked stdout and the read end of the pipe
-		close(1);
+		// close pipes we don't need
+		close(readFromChildFD[0]);
+		close(writeToChildFD[1]);
 
 		// Change the locale to not get libapt localization
 		setlocale(LC_ALL, "C");
@@ -1814,10 +1816,7 @@ cout << "How odd.. The sizes didn't match, email apt at packages.debian.org";
 		// dump errors into cerr (pass it to the parent process)
 		_error->DumpErrors();
 
-		close(readFromChildFD[0]);
-		close(writeToChildFD[1]);
 		close(readFromChildFD[1]);
-		close(writeToChildFD[0]);
 
 		_exit(res);
 	}
commit c8d4cd05cfc9732765f1b5241f6c50927e1dc7ee
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Jan 25 12:18:16 2011 +0000

    yum: Update the cached comps group list when enabling of disabling a repo. Fixes rh#629049

diff --git a/backends/yum/yumBackend.py b/backends/yum/yumBackend.py
index ccb347b..9a98543 100755
--- a/backends/yum/yumBackend.py
+++ b/backends/yum/yumBackend.py
@@ -2843,6 +2843,9 @@ class PackageKitYumBackend(PackageKitBaseBackend, PackagekitPackage):
         except Exception, e:
             self.error(ERROR_INTERNAL_ERROR, _format_str(traceback.format_exc()))
 
+        # update the comps groups too
+        self.comps.refresh()
+
     def get_repo_list(self, filters):
         '''
         Implement the get-repo-list functionality


More information about the PackageKit-commit mailing list