Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
- index ac557176..156f37ef 100644
- --- a/lib/bb/fetch2/__init__.py
- +++ b/lib/bb/fetch2/__init__.py
- @@ -1221,22 +1221,22 @@ def get_checksum_file_list(d):
- """
- 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):
- - 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.warn("Unable to get checksum for %s SRC_URI entry %s: file could not be found" % (d.getVar('PN'), os.path.basename(f)))
- - filelist.append(f + ":" + str(os.path.exists(f)))
- + path = ud.decodedurl
- + candidate = ""
- + if path[0] == "/":
- + candidate = path
- + else:
- + filespath = d.getVar('FILESPATH')
- + candidate = bb.utils.which(filespath, path)
- + if candidate == "":
- + bb.fatal("Unable to get checksum for %s SRC_URI entry %s: file could not be found" % (d.getVar('PN'), ud.decodedurl))
- + # We already checked in the bb.utils.which that it exists
- + filelist.append(candidate + ":True")
- return " ".join(filelist)
- diff --git a/lib/bb/tests/fetch.py b/lib/bb/tests/fetch.py
- index ee41bff4..252f023f 100644
- --- a/lib/bb/tests/fetch.py
- +++ b/lib/bb/tests/fetch.py
- @@ -693,6 +693,11 @@ class FetcherLocalTest(FetcherTest):
- flst.sort()
- return flst
- + def test_local_checksum_fails_no_file(self):
- + self.d.setVar("SRC_URI", "file://404")
- + with self.assertRaises(bb.BBHandledException):
- + bb.fetch.local.Local.get_checksum_file_list(self.d)
- +
- def test_local(self):
- tree = self.fetchUnpack(['file://a', 'file://dir/c'])
- self.assertEqual(tree, ['a', 'dir/c'])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement