Re: [PATCH 3/4] ci/lib: use echo instead of printf to set up sections
- From
Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
- Date
- Dec 7, 2024, 09:13 UTC
- Message-ID
- <Z1QRp8jFJPYdNmQk@ugly>
- In-Reply-To
- <20241206-pks-ci-section-fixes-v1-3-7ab1b69e3648@pks.im>
On Fri, Dec 06, 2024 at 12:10:15PM +0100, Patrick Steinhardt wrote:
>We use printf to set up sections with GitLab CI even though we could >trivially use echo. >
probably not a good idea, because the file is also included from plain sh scripts, which may invoke an `echo` that cannot deal with \escapes. at least potentially.
>This may cause problems in case the argument passed to `begin_group ()` >or `end_group ()` contains formatting directives as we use them as part >of the formatting string. >
that can be fixed properly by using the %s expando.
>+++ b/ci/lib.sh >- printf "\e[0Ksection_start:$(date +%s):$(echo "$1" | tr ' ' _)[collapsed=true]\r\e[0K$1\n" >+ echo "\e[0Ksection_start:$(date +%s):$(echo "$1" | tr ' ' _)[collapsed=true]\r\e[0K$1"