Re: [PATCH v2] CI: select CC based on CC_PACKAGE (again)
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 21, 2022, 19:11 UTC
- Message-ID
- <xmqqv8v2gsjl.fsf@gitster.g>
- In-Reply-To
- <CAPUEspggNfra_C8PBcVqjZrxxnswg27WFLg2kT6JOCMB8f0FGg@mail.gmail.com>
Carlo Arenas <carenas@gmail.com> writes:
Show 6 quoted lines
>> - CC="${CC:-gcc}"
>> + CC="${CC_PACKAGE:-${CC:-gcc}}"
>
> minor nitpick, but most likely still relevant considering your other
> "bashism" fixes.
> the POSIX syntax doesn't use ":" (documented in CodingGuidelines)You are reading the guideline wrong, I am afraid.
This is not a substring substitution, ${foo:0:3} picking three characters from the beginning of foo.
It is "If CC_PACKAGE is UNSET OR SET TO EMPTY, then use the fallback value that is ${CC:-gcc}", which is a bog standard bourne shell that predates POSIX. The colon before "-" is what adds "OR SET TO EMPTY" part; without the colon, i.e. "${CC_PACKAGE-${CC-gcc}}", then you get the same without "OR SET TO EMPTY" part.
And we do use that form.