]> git.ipfire.org Git - pakfire.git/commitdiff
Fix downloading with older versions of urlgrabber.
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 3 Oct 2011 11:44:14 +0000 (13:44 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 3 Oct 2011 11:44:14 +0000 (13:44 +0200)
Ubuntu and Debian are too lazy to fix that.

po/pakfire.pot
python/pakfire/downloader.py

index f3b8ec3d7160364713850825ba53fc998cc2e155..4060336b0ffc3c94aa784dc3fcd88273049ccd01 100644 (file)
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2011-10-02 14:37+0200\n"
+"POT-Creation-Date: 2011-10-03 13:39+0200\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -100,12 +100,12 @@ msgstr ""
 
 #. Package the result.
 #. Make all these little package from the build environment.
-#: ../python/pakfire/builder.py:687
+#: ../python/pakfire/builder.py:686
 msgid "Creating packages:"
 msgstr ""
 
 #. Execute the buildscript of this stage.
-#: ../python/pakfire/builder.py:707
+#: ../python/pakfire/builder.py:706
 #, python-format
 msgid "Running stage %s:"
 msgstr ""
@@ -349,12 +349,12 @@ msgid "Do not verify build dependencies."
 msgstr ""
 
 #: ../python/pakfire/compress.py:133
-#: ../python/pakfire/packages/packager.py:487
+#: ../python/pakfire/packages/packager.py:489
 #, python-format
 msgid "Compressing %s"
 msgstr ""
 
-#: ../python/pakfire/downloader.py:126
+#: ../python/pakfire/downloader.py:129
 msgid "Downloading source files:"
 msgstr ""
 
@@ -488,11 +488,11 @@ msgstr ""
 msgid "Filename: %s"
 msgstr ""
 
-#: ../python/pakfire/packages/make.py:70
+#: ../python/pakfire/packages/make.py:75
 msgid "Package name is undefined."
 msgstr ""
 
-#: ../python/pakfire/packages/make.py:73
+#: ../python/pakfire/packages/make.py:78
 msgid "Package version is undefined."
 msgstr ""
 
@@ -501,7 +501,7 @@ msgstr ""
 msgid "Packaging"
 msgstr ""
 
-#: ../python/pakfire/packages/packager.py:606
+#: ../python/pakfire/packages/packager.py:608
 #, python-format
 msgid "Building source package %s:"
 msgstr ""
index 24aac0bd26390987402ae6ac4a350c093f77ae22..93f23136b2618e2caaf94136afa059a86802b793 100644 (file)
@@ -69,6 +69,12 @@ class PakfireGrabber(URLGrabber):
 
                URLGrabber.__init__(self, *args, **kwargs)
 
+       def urlread(self, filename, *args, **kwargs):
+               # This is for older versions of urlgrabber which are packaged in Debian
+               # and Ubuntu and cannot handle filenames as a normal Python string but need
+               # a unicode string.
+               return URLGrabber.urlread(self, filename.encode("utf-8"), *args, **kwargs)
+
 
 class PackageDownloader(PakfireGrabber):
        def __init__(self, pakfire, *args, **kwargs):
@@ -108,7 +114,7 @@ class SourceDownloader(object):
 
                if mirrors:
                        self.grabber = MirrorGroup(self.grabber,
-                               [{ "mirror" : m } for m in mirrors])
+                               [{ "mirror" : m.encode("utf-8") } for m in mirrors])
 
        def download(self, files):
                existant_files = []
@@ -263,7 +269,7 @@ class MirrorList(object):
                # Add all preferred mirrors at the first place and shuffle them
                # that we will start at a random place.
                for mirror in self.preferred:
-                       mirrors.append(mirror.url)
+                       mirrors.append(mirror.url.encode("utf-8"))
                random.shuffle(mirrors)
 
                # All other mirrors are added as well and will only be used if all
@@ -272,7 +278,7 @@ class MirrorList(object):
                        if mirror.url in mirrors:
                                continue
 
-                       mirrors.append({ "mirror" : mirror.url })
+                       mirrors.append({ "mirror" : mirror.url.encode("utf-8") })
 
                return MirrorGroup(grabber, mirrors)