From patchwork Thu Jun 14 03:09:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [bitbake-devel,2/4] fetch2: Fix URI encode / decode regression Date: Thu, 14 Jun 2012 03:09:39 -0000 From: Jason Wessel X-Patchwork-Id: 29805 Message-Id: <1339643381-23026-3-git-send-email-jason.wessel@windriver.com> To: 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 --- 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