gitian: fixed SC2001 regex #17680

pull willyko wants to merge 1 commits into bitcoin:master from willyko:patch-2 changing 1 files +1 −1
  1. willyko commented at 9:08 PM on December 5, 2019: contributor

    Currently the gitian-win-signer.yml produces OUTFILE names without -unsigned stripped out This is due to regex having an% in front of it

    $ INFILE="bitcoin-0.19.0-win64-setup-unsigned.exe"
    $ echo "${INFILE/%-unsigned}"
    bitcoin-0.19.0-win64-setup-unsigned.exe
    $ echo "${INFILE/-unsigned}"
    bitcoin-0.19.0-win64-setup.exe
    

    Fixes #17361

  2. gitian: fixed SC2001 regex
    the `-` is not a special symbol and should not have `%` in front of it.
    c966ff14c7
  3. fanquake added the label Scripts and tools on Dec 5, 2019
  4. MarcoFalke commented at 9:22 PM on December 5, 2019: member

    Why is SC2001 disabled?

  5. MarcoFalke requested review from dongcarl on Dec 5, 2019
  6. MarcoFalke requested review from hebasto on Dec 5, 2019
  7. dongcarl commented at 9:27 PM on December 5, 2019: member

    Why is SC2001 disabled?

    It isn't, but it seems that it didn't pick up our mistake and assumed % was part of the pattern @hebasto We need to fix the rest of them too... https://github.com/bitcoin/bitcoin/commit/17f81e96486780df5d464487975ecb11b278ec8d#diff-43ab305e977a53cc028bfb0eaaacf989

  8. willyko commented at 9:33 PM on December 5, 2019: contributor

    Why is SC2001 disabled?

    It isn't, but it seems that it didn't pick up our mistake and assumed % was part of the pattern

    @hebasto We need to fix the rest of them too... 17f81e9#diff-43ab305e977a53cc028bfb0eaaacf989

    The rest are ok. . is a special character so it requires that % in front of it

  9. laanwj commented at 7:24 AM on December 6, 2019: member

    Currently the gitian-win-signer.yml produces OUTFILE names without -unsigned stripped out

    When was this problem introduced? On releases, this renaming definitely works and a filename without -unsigned is produced.

  10. willyko commented at 9:40 AM on December 6, 2019: contributor

    Currently the gitian-win-signer.yml produces OUTFILE names without -unsigned stripped out

    When was this problem introduced? On releases, this renaming definitely works and a filename without -unsigned is produced.

    #17361 8 days ago. There's gitian builds in PR but did not include codesigned gitian builds

  11. laanwj commented at 11:28 AM on December 6, 2019: member

    @willyko ok, good to know this doesn't affect any releases thanks for checking (and fixing)

    ACK c966ff14c77870378847b9e6063b9671739ddc1f

  12. hebasto commented at 11:35 AM on December 6, 2019: member

    #17361 8 days ago. There's gitian builds in PR but did not include codesigned gitian builds

    Sorry for introducing a bug. @willyko Thank you for fixing!

    From bash docs:

    ${parameter/pattern/string}

    The pattern is expanded to produce a pattern just as in filename expansion. Parameter is expanded and the longest match of pattern against its value is replaced with string. The match is performed according to the rules described below (see Pattern Matching). If pattern begins with ‘/’, all matches of pattern are replaced with string... If pattern begins with ‘%’, it must match at the end of the expanded value of parameter. If string is null, matches of pattern are deleted and the / following pattern may be omitted.

    So this

    $ INFILE="bitcoin-0.19.0-win64-setup-unsigned.exe"
    $ echo "${INFILE/%-unsigned}"
    bitcoin-0.19.0-win64-setup-unsigned.exe
    

    does not work because -unsigned does not match at the end of "bitcoin-0.19.0-win64-setup-unsigned.exe".

    The rest are ok. . is a special character so it requires that % in front of it

    I don't think . is a special character that requires % in front of it. The purpose of % is described in docs (see above).

  13. hebasto approved
  14. hebasto commented at 11:36 AM on December 6, 2019: member

    ACK c966ff14c77870378847b9e6063b9671739ddc1f

  15. laanwj referenced this in commit ac09180128 on Dec 9, 2019
  16. laanwj merged this on Dec 9, 2019
  17. laanwj closed this on Dec 9, 2019

  18. MarkLTZ referenced this in commit c864dba23e on Apr 10, 2020
  19. PastaPastaPasta referenced this in commit f12ca55d84 on Sep 17, 2021
  20. thelazier referenced this in commit b95eab40da on Sep 25, 2021
  21. MarcoFalke locked this on Dec 16, 2021

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-13 18:14 UTC

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