From f17c51c6959f740b279814624b40c65d69827637 Mon Sep 17 00:00:00 2001 From: Stefan Herbrechtsmeier Date: Fri, 7 Feb 2025 13:46:55 +0100 Subject: [PATCH] bitbake: fetch2: local: use path variable Use the path variable from the fetch data instead of decoding the path manually from the plain unexpanded url. (Bitbake rev: ad3a29fa6ea53741d4e1786de35f8e7fc4292e7a) Signed-off-by: Stefan Herbrechtsmeier Signed-off-by: Richard Purdie --- bitbake/lib/bb/fetch2/__init__.py | 2 +- bitbake/lib/bb/fetch2/local.py | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py index 628cae023a..bd87f18be2 100644 --- a/bitbake/lib/bb/fetch2/__init__.py +++ b/bitbake/lib/bb/fetch2/__init__.py @@ -1236,7 +1236,7 @@ def get_checksum_file_list(d): found = False paths = ud.method.localfile_searchpaths(ud, d) for f in paths: - pth = ud.decodedurl + pth = ud.path if os.path.exists(f): found = True filelist.append(f + ":" + str(os.path.exists(f))) diff --git a/bitbake/lib/bb/fetch2/local.py b/bitbake/lib/bb/fetch2/local.py index 7d7668110e..fda56a564e 100644 --- a/bitbake/lib/bb/fetch2/local.py +++ b/bitbake/lib/bb/fetch2/local.py @@ -29,11 +29,10 @@ class Local(FetchMethod): def urldata_init(self, ud, d): # We don't set localfile as for this fetcher the file is already local! - ud.decodedurl = urllib.parse.unquote(ud.url.split("://")[1].split(";")[0]) - ud.basename = os.path.basename(ud.decodedurl) - ud.basepath = ud.decodedurl + ud.basename = os.path.basename(ud.path) + ud.basepath = ud.path ud.needdonestamp = False - if "*" in ud.decodedurl: + if "*" in ud.path: raise bb.fetch2.ParameterError("file:// urls using globbing are no longer supported. Please place the files in a directory and reference that instead.", ud.url) return @@ -48,7 +47,7 @@ class Local(FetchMethod): Return the local filename of a given url assuming a successful fetch. """ searched = [] - path = urldata.decodedurl + path = urldata.path newpath = path if path[0] == "/": logger.debug2("Using absolute %s" % (path))