We often check for the absence of a function in a file with the idiom not grep REGEXP FILE[...] in all.sh. The function not is a wrapper around ! that takes care of failing the component if the command exits with the status 0. As noted in Mbed-TLS/mbedtls#10517 (comment) this is fragile: it'll pass if the file doesn't exist.
The goal of this issue is:
- Pick a name for a “not grep” function.
not_grep is natural but might be a bit misleading since it's not just ! grep.
- Define a new function that does what we want. I believe the semantics is:
not_grep REGEXP FILE[...] passes if all the files exist and the regexp is not found in any of the files. Note that the files can be expressed as a pattern, and since we use bash with default settings, if the pattern doesn't match any file, it'll remain unexpanded and the function will see it as a file name that doesn't exist.
- Systematically replace
not grep by the new function in tests/scripts/components-*.sh in all branches.
We often check for the absence of a function in a file with the idiom
not grep REGEXP FILE[...]inall.sh. The functionnotis a wrapper around!that takes care of failing the component if the command exits with the status 0. As noted in Mbed-TLS/mbedtls#10517 (comment) this is fragile: it'll pass if the file doesn't exist.The goal of this issue is:
not_grepis natural but might be a bit misleading since it's not just! grep.not_grep REGEXP FILE[...]passes if all the files exist and the regexp is not found in any of the files. Note that the files can be expressed as a pattern, and since we use bash with default settings, if the pattern doesn't match any file, it'll remain unexpanded and the function will see it as a file name that doesn't exist.not grepby the new function intests/scripts/components-*.shin all branches.