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 <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Stefan Herbrechtsmeier 2025-02-07 13:46:55 +01:00 committed by Richard Purdie
parent 3e543e8eaa
commit f17c51c695
2 changed files with 5 additions and 6 deletions

View File

@ -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)))

View File

@ -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))