Re: [PATCH 2/2] CI: don't care about SHA256 mismatch on upstream "perforce" package
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 21, 2022, 21:38 UTC
- Message-ID
- <xmqq7d7if76u.fsf@gitster.g>
- In-Reply-To
- <CAPig+cTWj2Xf4sfMJBkzLhG5oUBS+Pb5-D-K50xMt9rP0doBRA@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
> really isn't (the `-e` is being consumed by the `-i` option).
That makes sense. So after all 4-year old random finding on the internet had some value in pregventing a new breakage to sneak into our codebase. Good ;-)
Show 7 quoted lines
> Any of > the following would likely be less confusing (in no particular order > of preference): > > * sed -i .bak -e '...' "$path" > * rename dance > * perl -pi -e ...
That order happens to match my preference, but if the first one comes with a comment to dissuade readers to copy-and-paste the construct to other places in our code, that would be even better.
Perhaps something along this line.
ci/install-dependencies.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git c/ci/install-dependencies.sh w/ci/install-dependencies.sh index 540deab448..2a5ee34246 100755 --- c/ci/install-dependencies.sh +++ w/ci/install-dependencies.sh @@ -41,7 +41,12 @@ macos-latest) echo Installing perforce failed, assuming and working around SHA256 mismatch >&2 && path=$(brew edit --print-path perforce) && - sed -i -e 's/\(sha256.\).*/\1:no_check/' "$path" && + + # we do not do this unconditionally because we want + # to know that we are falling back. Do not copy this + # use of 'sed -i .bak' elsewhere---it does not work with + # other implementations of "sed". + sed -i .bak -e 's/\(sha256.\).*/\1:no_check/' "$path" && brew install perforce }