On macOS the default sed utility is not GNU sed, therefore the commit-script-check.sh script fails. This commit adds a check for gsed and uses it if it exists.
tests: commit-script-check.sh - use gsed if exists #24159
pull RandyMcMillan wants to merge 1 commits into bitcoin:master from RandyMcMillan:1643135199-test-lint-comit-script changing 1 files +7 −3-
RandyMcMillan commented at 2:25 AM on January 26, 2022: contributor
- DrahtBot added the label Tests on Jan 26, 2022
-
in test/lint/commit-script-check.sh:25 in 0b4f7a90ec outdated
22 | +test gsed && SED=$(which gsed) || SED=$(which sed) 23 | +export SED 24 | + 25 | +if ! $SED --help 2>&1 | grep -q 'GNU'; then 26 | + echo "Error: The installed sed package is not compatible. Please make sure you have GNU sed installed in your system."; 27 | + test brew && printf ' Try installing gnu-sed with the Homebrew package installer (brew install gnu-sed).'
brunoerg commented at 10:56 AM on January 26, 2022:test brew && echo ' Try installing gnu-sed with the Homebrew package installer (brew install gnu-sed).'feel free to ignore
w0xlt approvedw0xlt commented at 11:14 AM on January 26, 2022: contributorcrACK 0b4f7a9
shaavan approvedshaavan commented at 1:39 PM on January 26, 2022: contributorApproach ACK 0b4f7a90ece39e6c88f746673de3764fb147779e
This PR introduces a check for the sed type in the commit-script-check.sh. The selected version of SED (whether gsed or sed) is then passed through the inspection if the sed is 'GNU' based.
I think it would be good incorporating @brunoerg's suggestion.
RandyMcMillan commented at 5:46 PM on January 26, 2022: contributormerged @brunoerg commit - will squash after CI pass.
ca3d68690ftests: commit-script-check.sh - use gsed if exists
On macOS the default sed utility is not GNU sed, therefore the commit-script-check.sh script fails. This commit adds a check for gsed and uses it if it exists. Co-authored-by: Bruno Garcia <brunoely.gc@gmail.com>
RandyMcMillan force-pushed on Jan 27, 2022theStack commented at 2:32 PM on January 28, 2022: memberConcept ACK
laanwj commented at 11:34 AM on March 30, 2022: memberI know I'm repeating myself but I really prefer more complex scripts to be Python to avoid these kind of platform-specific contortions around different shells and basic utilities.
Lacking that, Concept ACK.
fanquake commented at 10:44 AM on April 7, 2022: memberGoing to optimistically close this for now, given we are just going to port this to Python (#24783). I'm sure we can come up with a solution that doesn't require sed, or gsed or bash, or any other nonsense.
fanquake closed this on Apr 7, 2022DrahtBot locked this on Apr 7, 2023
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 15:14 UTC
More mirrored repositories can be found on mirror.b10c.me