[yum-commits] Branch 'yum-3_2_X' - yum/packages.py

skvidal at osuosl.org skvidal at osuosl.org
Wed Oct 15 15:27:53 UTC 2008


 yum/packages.py |   19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)

New commits:
commit e15d9e5fafcd6c1eeaa4d5949c5c0bb4bbd20bfd
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Wed Oct 15 11:27:47 2008 -0400

    magic combination of to_unicode and to_utf8:
    to_unicode makes the string combination happy coming out of the sqlite
    to_utf8 makes the string happy going into the gzip'd xml.
    LOVE LOVE LOVE

diff --git a/yum/packages.py b/yum/packages.py
index c0373e4..4e3bbd5 100644
--- a/yum/packages.py
+++ b/yum/packages.py
@@ -939,30 +939,25 @@ class YumAvailablePackage(PackageObject, RpmBase):
 
     def xml_dump_primary_metadata(self):
         msg = """\n<package type="rpm">"""
-        msg += self._dump_base_items()
-        msg += self._dump_format_items()
+        msg += misc.to_unicode(self._dump_base_items())
+        msg += misc.to_unicode(self._dump_format_items())
         msg += """\n</package>"""
-        return msg
+        return misc.to_utf8(msg)
 
     def xml_dump_filelists_metadata(self):
         msg = """\n<package pkgid="%s" name="%s" arch="%s">
     <version epoch="%s" ver="%s" rel="%s"/>\n""" % (self.checksum, self.name, 
                                      self.arch, self.epoch, self.ver, self.rel)
-        msg += self._dump_files()
+        msg += misc.to_unicode(self._dump_files())
         msg += "</package>\n"
-        return msg
+        return misc.to_utf8(msg)
 
     def xml_dump_other_metadata(self, clog_limit=0):
         msg = """\n<package pkgid="%s" name="%s" arch="%s">
     <version epoch="%s" ver="%s" rel="%s"/>\n""" % (self.checksum, self.name, 
                                      self.arch, self.epoch, self.ver, self.rel)
-        clogs = str(self._dump_changelog(clog_limit))
-        #print type(clogs)
-        mystr  = "%s\n</package>\n"
-        #print type(mystr)
-        foo = "%s\n</package>\n" % clogs
-        msg += "%s\n</package>\n" % self._dump_changelog(clog_limit)
-        return msg
+        msg += "%s\n</package>\n" % misc.to_unicode(self._dump_changelog(clog_limit))
+        return misc.to_utf8(msg)
 
 
 


More information about the Yum-commits mailing list