summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2/__init__.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-07-13 17:37:02 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-07-15 12:22:08 +0100
commit63935febda8ad316598e8f73f1e4cbf04fb47ef0 (patch)
tree650e162cbbf64fa5d67c985384f760418211153c /bitbake/lib/bb/fetch2/__init__.py
parent829bb416b8a4556f735b1d2da7971442b0d0cb8e (diff)
downloadpoky-63935febda8ad316598e8f73f1e4cbf04fb47ef0.tar.gz
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 <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2/__init__.py')
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py16
1 files changed, 6 insertions, 10 deletions
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):
1222 SRC_URI as a space-separated string 1222 SRC_URI as a space-separated string
1223 """ 1223 """
1224 fetch = Fetch([], d, cache = False, localonly = True) 1224 fetch = Fetch([], d, cache = False, localonly = True)
1225
1226 dl_dir = d.getVar('DL_DIR')
1227 filelist = [] 1225 filelist = []
1228 for u in fetch.urls: 1226 for u in fetch.urls:
1229 ud = fetch.ud[u] 1227 ud = fetch.ud[u]
1230
1231 if ud and isinstance(ud.method, local.Local): 1228 if ud and isinstance(ud.method, local.Local):
1229 found = False
1232 paths = ud.method.localpaths(ud, d) 1230 paths = ud.method.localpaths(ud, d)
1233 for f in paths: 1231 for f in paths:
1234 pth = ud.decodedurl 1232 pth = ud.decodedurl
1235 if f.startswith(dl_dir): 1233 if os.path.exists(f):
1236 # The local fetcher's behaviour is to return a path under DL_DIR if it couldn't find the file anywhere else 1234 found = True
1237 if os.path.exists(f): 1235 filelist.append(f + ":" + str(os.path.exists(f)))
1238 bb.warn("Getting checksum for %s SRC_URI entry %s: file not found except in DL_DIR" % (d.getVar('PN'), os.path.basename(f))) 1236 if not found:
1239 else: 1237 bb.fatal(("Unable to get checksum for %s SRC_URI entry %s: file could not be found"
1240 bb.fatal(("Unable to get checksum for %s SRC_URI entry %s: file could not be found"
1241 "\nThe following paths were searched:" 1238 "\nThe following paths were searched:"
1242 "\n%s") % (d.getVar('PN'), os.path.basename(f), '\n'.join(paths))) 1239 "\n%s") % (d.getVar('PN'), os.path.basename(f), '\n'.join(paths)))
1243 filelist.append(f + ":" + str(os.path.exists(f)))
1244 1240
1245 return " ".join(filelist) 1241 return " ".join(filelist)
1246 1242