build: Make lint-locale-dependence.sh work with BSD grep (avoid empty subexpressions) #13720

pull practicalswift wants to merge 2 commits into bitcoin:master from practicalswift:bsd-grep-compatibility changing 3 files +42 −3
  1. practicalswift commented at 9:02 pm on July 19, 2018: contributor

    Make lint-locale-dependence.sh work with BSD grep by avoiding empty subexpressions.

    macOS High Sierra:

    0$ grep --version
    1grep (BSD grep) 2.5.1-FreeBSD
    2$ echo foo | grep -E '^foo(_r|_s)?$'
    3foo
    4$ echo foo | grep -E '^foo(|_r|_s)$'
    5grep: empty (sub)expression
    

    Ubuntu 18.04 LTS:

    0$ grep --version
    1grep (GNU grep) 3.1
    2$ echo foo | grep -E '^foo(_r|_s)?$'
    3foo
    4$ echo foo | grep -E '^foo(|_r|_s)$'
    5foo
    

    Reported by @masonicboom in #13708 (review). Thanks!

  2. Empact commented at 10:18 pm on July 19, 2018: member
    utACK 5a3eefc4 how much work would it be to make the scripts fully compatible with BSD grep? Would be nice to remove the gnu grep requirement.
  3. Empact commented at 10:54 pm on July 19, 2018: member
    There’s another empty subexpression in lint-shell-locale.sh, line 18
  4. fanquake added the label Tests on Jul 19, 2018
  5. build: Make lint-locale-dependence.sh work with BSD grep (avoid empty subexpressions) 72813aa0e2
  6. practicalswift force-pushed on Jul 20, 2018
  7. practicalswift commented at 9:43 am on July 20, 2018: contributor

    @Empact Fixed the GNU:Ism in lint-shell-locale.sh. Do you know of any other incompatibility with BSD grep? I’ve now added a linter that will help us avoid introducing GNU:isms in our shell scripts :-)

    Please re-review!

  8. Add linter: Make sure we don't depend on GNU specific functionality in shell scripts. 0780029280
  9. practicalswift force-pushed on Jul 20, 2018
  10. laanwj commented at 1:43 pm on July 20, 2018: member
    Thanks for doing this but… sigh more shell-lowest-common-denominator-porting I wish we just bit the bullet ported this stuff to Python so that it’s, by definition, not dependent on external tools.
  11. Empact commented at 10:36 pm on July 20, 2018: member
    As an alternative to the linter here, I set up running the linter checks on Mac via Travis, #13728.
  12. DrahtBot commented at 1:20 pm on July 22, 2018: member
    • #13728 (Scripts and tools: Run the CI lint stage on mac and linux both by Empact)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  13. practicalswift commented at 3:29 pm on August 6, 2018: contributor

    I prefer @Empact:s solution in #13728 which runs the linter chers on Mac via Travis

    Closing this PR since it won’t be relevant when #13728 has been merged.

  14. practicalswift closed this on Aug 6, 2018

  15. practicalswift deleted the branch on Apr 10, 2021
  16. DrahtBot locked this on Aug 16, 2022

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: 2024-11-17 15:12 UTC

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