[vlc-commits] [Git][videolan/vlc][master] configure.ac: fix NO_COLOR handling in ./compile

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Tue Jun 18 14:00:21 UTC 2024



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
50aa68ea by Alexandre Janniaux at 2024-06-18T13:37:29+00:00
configure.ac: fix NO_COLOR handling in ./compile

Quotes were interpreted by configure and $NO_COLOR was interpolated at
configure time, leading to incorrect script execution. Brackets were
also removed because of m4 expansion.

By switching to single quote string, we can better describe what needs
to be printed and what needs to be evaluated.

The m4 expansion problem is solved by escaping the whole string in a
bracket block.

The `echo` command is also changed for the more portable[^1] `printf`.

[^1]: https://unix.stackexchange.com/questions/65803/why-is-printf-better-than-echo

- - - - -


1 changed file:

- configure.ac


Changes:

=====================================
configure.ac
=====================================
@@ -4869,18 +4869,18 @@ if test -n $SHELL; then
 fi
 rm -f compile
 compile_top_srcdir=`sed -ne "s/^top_srcdir *= *//p" < Makefile`
-echo "#! $SHELL
-rm -f .error\$\$
+[printf '%s\n' '#! '"${SHELL}"'
+rm -f .error$$
 ERROR=0
-export PATH=\"$PATH\" LANG=C
-if [ "$NO_COLOR" = 1 ]; then
-($MAKE V=1 \$@ 2>&1 || touch .error\$\$)
+export PATH="$PATH" LANG=C
+if test "$NO_COLOR" = 1 ; then
+('"${MAKE}"' V=1 "$@" 2>&1 || touch .error$$)
 else
-($MAKE V=1 \$@ 2>&1 || touch .error\$\$)| $compile_top_srcdir/extras/buildsystem/make.pl
+('"${MAKE}"' V=1 "$@" 2>&1 || touch .error$$)| '"$compile_top_srcdir"'/extras/buildsystem/make.pl
 fi
-test -f .error\$\$ && ERROR=1
-rm -f .error\$\$
-exit \$ERROR" >compile
+test -f .error$$ && ERROR=1
+rm -f .error$$
+exit $ERROR'] >compile
 chmod a+x compile
 
 echo "



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/50aa68ea7e53420d008cc17131d7f8ef6be98fbd

-- 
This project does not include diff previews in email notifications.
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/50aa68ea7e53420d008cc17131d7f8ef6be98fbd
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list