From 63935febda8ad316598e8f73f1e4cbf04fb47ef0 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Wed, 13 Jul 2022 17:37:02 +0100 Subject: bitbake: fetch2: Drop DL_DIR fallback for local file fetcher A long time ago, we made DL_DIR a final fallback for the local fetcher. Since then we added checksum support and task hashes and the world has changed. There were warnings added some time ago if this fallback triggers and it is now time to drop it entirely. The original use case was for sstate however the sstate code now sets FILESPATH correctly so DL_DIR is no longer needed. There have been a few small bugs exposed by this change, missing mkdir calls and some minor test issues that needed tweaks. In general this simplifies and improves the fetcher code flow though. This completes a cleanup that ensures local files are correctly covered at parse time which ensures rebuilds and reparses happen at the right times. (Bitbake rev: 3e1444e536c71d3885ef6b9d428807163c309640) Signed-off-by: Richard Purdie --- bitbake/lib/bb/fetch2/__init__.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'bitbake/lib/bb/fetch2/__init__.py') diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py index c1523fc1c1..0fb718b23e 100644 --- a/bitbake/lib/bb/fetch2/__init__.py +++ b/bitbake/lib/bb/fetch2/__init__.py @@ -1222,25 +1222,21 @@ def get_checksum_file_list(d): SRC_URI as a space-separated string """ fetch = Fetch([], d, cache = False, localonly = True) - - dl_dir = d.getVar('DL_DIR') filelist = [] for u in fetch.urls: ud = fetch.ud[u] - if ud and isinstance(ud.method, local.Local): + found = False paths = ud.method.localpaths(ud, d) for f in paths: pth = ud.decodedurl - if f.startswith(dl_dir): - # The local fetcher's behaviour is to return a path under DL_DIR if it couldn't find the file anywhere else - if os.path.exists(f): - bb.warn("Getting checksum for %s SRC_URI entry %s: file not found except in DL_DIR" % (d.getVar('PN'), os.path.basename(f))) - else: - bb.fatal(("Unable to get checksum for %s SRC_URI entry %s: file could not be found" + if os.path.exists(f): + found = True + filelist.append(f + ":" + str(os.path.exists(f))) + if not found: + bb.fatal(("Unable to get checksum for %s SRC_URI entry %s: file could not be found" "\nThe following paths were searched:" "\n%s") % (d.getVar('PN'), os.path.basename(f), '\n'.join(paths))) - filelist.append(f + ":" + str(os.path.exists(f))) return " ".join(filelist) -- cgit v1.2.3-54-g00ecf