ci: check if scripted diff is using BSD sed syntax #19823

pull khuei wants to merge 1 commits into bitcoin:master from khuei:master changing 1 files +22 −0
  1. khuei commented at 6:56 PM on August 27, 2020: none

    #19815

    Check for the follorwing options/syntax in *BSD extensions that do not exists in GNU sed: -a -I and sed -i ''

  2. khuei marked this as a draft on Aug 27, 2020
  3. DrahtBot added the label Tests on Aug 27, 2020
  4. khuei marked this as ready for review on Aug 28, 2020
  5. amitiuttarwar commented at 5:28 AM on August 28, 2020: contributor

    strong concept ACK! thanks for taking this on!

    this issue has tripped me up along with many others (for a recent example, see #19339 (comment)) I'll review this soon.

    ps. I see that you've marked this PR as "ready for review" but also have "WIP" in the title. Maybe you can remove the WIP if it indeed is ready for review?

  6. practicalswift commented at 5:33 AM on August 28, 2020: contributor

    Concept ACK -- thanks for addressing this issue!

    Nice first-time contribution!

    Warm welcome as contributor @Z5483! :)

  7. khuei renamed this:
    WIP: ci: check if scripted diff is using BSD sed syntax
    ci: check if scripted diff is using BSD sed syntax
    on Aug 28, 2020
  8. jnewbery commented at 11:39 AM on August 28, 2020: member

    Concept ACK (obviously). Thanks for tackling this, and welcome to the project!

  9. khuei commented at 1:35 PM on August 28, 2020: none

    Thank you very much for the support :-)

  10. khuei commented at 3:46 AM on August 29, 2020: none

    I noticed that my patch only works when the sed command is arrange like the following:

    sed [options] [command] [input file]

    and it would not be able to detect the BSD syntax if the user puts [options] at the end like this:

    sed [command] [input file] [options]

    I might have to change my approach for it to work in both cases.

  11. MarcoFalke commented at 5:13 AM on August 29, 2020: member

    Can't the check be if (macos_sed_detected) print("use gsed") && exit?

  12. khuei commented at 5:21 AM on August 29, 2020: none

    Can't the check be if (macos_sed_detected) print("use gsed") && exit?

    The point of the check is to report to the user if they written a sed command that is compatible with BSD sed, but not incompatible with GNU sed (used by Travis)

    Some people might still accidentally write commands that are incompatible with GNU sed even when they have GNU sed on their system.

    Edit: addtional info

  13. khuei commented at 5:47 AM on August 29, 2020: none

    But if you guys are fine with just a sed version check, I'm willingly to do that instead.

  14. laanwj commented at 10:15 AM on September 1, 2020: member

    I noticed that my patch only works when the sed command is arrange like the following:

    sed [options] [command] [input file]

    Concept ACK. I think matching command line arguments using a regexp is a slightly brittle solution, but as this is a shell script I don't have any better suggestion either.

  15. ci: check if scripted diff is using BSD sed syntax 1e9c5c4fa8
  16. khuei commented at 5:32 PM on September 1, 2020: none

    I noticed that my patch only works when the sed command is arrange like the following: sed [options] [command] [input file]

    fixed

  17. khuei closed this on Nov 25, 2020

  18. DrahtBot locked this on Feb 15, 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: 2026-04-14 21:14 UTC

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