Allow sha256sum from SRC_URI option in srcurichecksum and srcurioptions checks #671
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The bitbake manual specifies that the checksum of downloaded files may not only be specified in the
SRC_URI[sha256sum] =
form, but also appended to the URL ashttp://<url>;sha256sum=123...
:Expected behavior
Given a
SRC_URI
with embeddedsha256sum
, bitbake verifies the checksum correctly and oelint-adv does not output any warning.Observed behavior
Using this form results bitbake correctly verifying the checksum, but oelint-adv produces two warnings per entry. This was observed with the
https
fetcher:Fix
This PR adds the
sha256sum
andmd5sum
options to the list of allowed options for the file download fetchers for the srcurioptions check to remove the warning.And it lets the
srcurichecksum
accept thesha256sum
option by skipping the check for aSRC_URI[sha256sum]
flag if that option is set for the given source, which fixes the error.Note: the list of file download fetchers was taken from
tests/test_class_oelint_vars_srcurichecksum.py
, so any fetcher that was previously included in thesrcurichecksum
check now is able to handle this syntax. I am not familar with theaz
ands3
fetchers and do not have access to sources on these services to verify that thesha256sum=
option actually works with these fetchers.However, the fetcher code implies that it does in
bitbake/lib/bb/fetch2
, since there is no special checksum handling in the respective fetchers and they all set thesupports_checksum
/recommends_checksum
just like thewget
fetcher does (which is responsible for fetchinghttps
urls).Pull request checklist
Bugfix
## New feature- [ ] A testcase was added to test the behavior- [ ]wiki-creator.py
was run and a new wiki document was filled with information- [ ] New functions are documented with docstrings- [ ] No debug code is left- [ ] README.md was updated to reflect the changes (check even if n.a.)