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
  1. RandyMcMillan commented at 2:25 AM on January 26, 2022: contributor

    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.

  2. DrahtBot added the label Tests on Jan 26, 2022
  3. 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

  4. w0xlt approved
  5. w0xlt commented at 11:14 AM on January 26, 2022: contributor

    crACK 0b4f7a9

  6. shaavan approved
  7. shaavan commented at 1:39 PM on January 26, 2022: contributor

    Approach 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.

  8. RandyMcMillan commented at 5:46 PM on January 26, 2022: contributor

    merged @brunoerg commit - will squash after CI pass.

  9. tests: 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>
    ca3d68690f
  10. RandyMcMillan force-pushed on Jan 27, 2022
  11. theStack commented at 2:32 PM on January 28, 2022: member

    Concept ACK

  12. laanwj commented at 11:34 AM on March 30, 2022: member

    I 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.

  13. fanquake commented at 10:44 AM on April 7, 2022: member

    Going 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.

  14. fanquake closed this on Apr 7, 2022

  15. DrahtBot locked this on Apr 7, 2023

github-metadata-mirror

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

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me