[bitbake-devel] [PATCH 2/4] fetch2: Fix URI encode / decode regression

Jason Wessel jason.wessel at windriver.com
Thu Jun 14 03:09:39 UTC 2012


The commit 420eb112a4f (fetch2: quote/unquote url paths) caused a
regression on Ubuntu 11.10's default python.

The problem is a result of the uri_replace() returning an encoded uri
and the local.py's localpath() routine not decoding the uri before
executing the local checks.

The problem was found using an updated version of the screen patches where there is a local copy of the download.  Example:

| DEBUG: For url ftp://ftp.debian.org/debian/pool/main/s/screen/screen_4.0.3-11+lenny1.diff.gz;name=patch returning file:///opt/dl/downloads/screen_4.0.3-11%2Blenny1.diff.gz;name=patch

The %2B was not getting decoded by the localpath() routine.

Signed-off-by: Jason Wessel <jason.wessel at windriver.com>
---
 lib/bb/fetch2/local.py |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/bb/fetch2/local.py b/lib/bb/fetch2/local.py
index a0ed444..fdbd9fc 100644
--- a/lib/bb/fetch2/local.py
+++ b/lib/bb/fetch2/local.py
@@ -43,10 +43,12 @@ class Local(FetchMethod):
         ud.basename = os.path.basename(ud.url.split("://")[1].split(";")[0])
         return
 
-    def localpath(self, url, urldata, d):
+    def localpath(self, tryurl, urldata, d):
         """
         Return the local filename of a given url assuming a successful fetch.
         """
+        import urllib;
+        url = urllib.unquote(tryurl)
         path = url.split("://")[1]
         path = path.split(";")[0]
         newpath = path
-- 
1.7.10





More information about the bitbake-devel mailing list