[yum-git] 3 commits - test/yum-release-i18n-test.sh yum/misc.py yum/rpmsack.py

James Antill james at linux.duke.edu
Sun Apr 20 00:39:48 UTC 2008


 test/yum-release-i18n-test.sh |    7 ++++++-
 yum/misc.py                   |    2 +-
 yum/rpmsack.py                |    4 ++--
 3 files changed, 9 insertions(+), 4 deletions(-)

New commits:
commit d048a5f0b84768452c41a2287763caae97cd68af
Author: James Antill <james at and.org>
Date:   Sat Apr 19 20:39:35 2008 -0400

    Add -y arg, for full automation

diff --git a/test/yum-release-i18n-test.sh b/test/yum-release-i18n-test.sh
index 8e4eaca..33f5491 100755
--- a/test/yum-release-i18n-test.sh
+++ b/test/yum-release-i18n-test.sh
@@ -24,6 +24,11 @@ PKG_BAD=pkg-no-exist-kthx-bai-OMGWTFBBQ
 # FIXME: need a more automated way to see if we are getting Unicode*Error
 RUN_FAILURES=true
 
+_yes=''
+if [ "x$1" = "x-y" ]; then
+  _yes='-y'
+fi
+
 beg_hdr="
 ==============================================================================="
 end_hdr="\
@@ -138,7 +143,7 @@ tst()
   ($LIVNA && $SUDO_CMD rpm -e gpg-pubkey-a109b1ec-3f6e28d5) || true
   #  This always fails, so we need to "look" if it does so with an encoding
   # problem or the real one
-  ($RUN_FAILURES && lscmd install $PKG_LIVNA) || true
+  ($RUN_FAILURES && lscmd install $_yes $PKG_LIVNA) || true
   $RUN_FAILURES && $LIVNA && sleep 1
   $LIVNA && $SUDO_CMD mv RPM-GPG-KEY-livna /etc/pki/rpm-gpg/
   lscmd install -y $PKG_LIVNA
commit 7473168cd00d2a1f0c639c2360917251b2b28177
Author: James Antill <james at and.org>
Date:   Sat Apr 19 20:39:15 2008 -0400

    Use just to_unicode(), tested i18n ... it was just errors we need

diff --git a/yum/rpmsack.py b/yum/rpmsack.py
index aa5f445..d335e4e 100644
--- a/yum/rpmsack.py
+++ b/yum/rpmsack.py
@@ -28,7 +28,7 @@ from packageSack import PackageSackBase
 import fnmatch
 import re
 
-from misc import to_unicode_maybe
+from misc import to_unicode
 
 class RPMInstalledPackage(YumInstalledPackage):
 
@@ -298,7 +298,7 @@ class RPMDBPackageSack(PackageSackBase):
         count = 0
         for s in searchstrings:
             for field in fields:
-                value = to_unicode_maybe(hdr[field])
+                value = to_unicode(hdr[field])
                 if value and value.lower().find(s) != -1:
                     count += 1
                     break
commit e449b1c5bd7f5d2ae64cfdfe17ecaba2cc6aba1b
Author: James Antill <james at and.org>
Date:   Sat Apr 19 20:38:27 2008 -0400

    Use replace by default, there is no reason we want more tracebacks

diff --git a/yum/misc.py b/yum/misc.py
index 2b4dbfb..3c03cff 100644
--- a/yum/misc.py
+++ b/yum/misc.py
@@ -529,7 +529,7 @@ def find_ts_remaining(timestamp, yumlibpath='/var/lib/yum'):
     
     return to_complete_items
     
-def to_unicode(obj, encoding='utf-8', errors='strict'):
+def to_unicode(obj, encoding='utf-8', errors='replace'):
     ''' convert a 'str' to 'unicode' '''
     if isinstance(obj, basestring):
         if not isinstance(obj, unicode):



More information about the Yum-cvs-commits mailing list