Re: [PATCH] ci: skip unavailable external software
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Apr 25, 2025, 10:02 UTC
- Message-ID
- <aAtdsURaaxYO7pVt@pks.im>
- In-Reply-To
- <xmqqh62cwoya.fsf@gitster.g>
On Fri, Apr 25, 2025 at 02:49:33AM -0700, Junio C Hamano wrote:
Show 13 quoted lines
> Patrick Steinhardt <ps@pks.im> writes: > > > I think it would be preferable to only handle failure of wget as chmod > > shouldn't ever fail if wget was successful. The same is true for the > > other downloads -- let's be as strict as possible but allow failure of > > those actions that depend on the network. > > You may think so (as I thought so too before hitting a snag or two) ;-). > > The thing is, failing "wget --output-document" leaves an empty file, > and an empty file does not still cause "if type jgit; then" to take > the "else" clause, and the invocation of "jgit version" would fail, > taking the whole thing out, due to the "set -e" thing.
But shouldn't the failing wget cause an error, too? So the `|| { }` cleanup branch would execute in that case and we can prune the empty file there. So in other words, shouldn't the following work alright?
if wget --output-document=...
then
massage output
else
rm output
fiOr am I still missing the obvious?
Patrick