diff mbox series

[FFmpeg-devel,v2,1/2] configure,etc: unify shebang usage

Message ID 20240408131600.81682-1-jdek@itanimul.li
State New
Headers show
Series [FFmpeg-devel,v2,1/2] configure,etc: unify shebang usage | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

J. Dekker April 8, 2024, 1:15 p.m. UTC
In some cases, these scripts can be called directly by packagers, and
some systems require the interpreter to be explicit.

Signed-off-by: J. Dekker <jdek@itanimul.li>
---
 configure             | 3 ++-
 doc/texidep.pl        | 2 +-
 ffbuild/libversion.sh | 1 +
 tests/fate-run.sh     | 2 +-
 tests/fate.sh         | 2 +-
 5 files changed, 6 insertions(+), 4 deletions(-)

Comments

Martin Storsjö April 9, 2024, 8:58 a.m. UTC | #1
On Mon, 8 Apr 2024, J. Dekker wrote:

> In some cases, these scripts can be called directly by packagers, and
> some systems require the interpreter to be explicit.

It is unclear to me which of the changes are needed and for what reason, 
please elaborate much more in the commit message.

Is it possible to elaborate on "some systems require the interpreter to be 
explicit"? It'd be much nicer to reason about if there was a concrete 
example of such a case (even if it certainly is right to add the missing 
shebang line).

The changes I see fall into these categories:

- Change "#! <path>" into "#!<path>. Does this change have a functional 
effect for someone (where, and why?) or is it purely a cosmetic change?
- Add a shebang line in the generated ffbuild/config.sh. This script is 
highly unlikely to be useful to call on its own like that, so while this 
probably is good for consistency I don't see it ever making a difference.
- Add a shebang line in ffbuild/libversion.sh. I can see the value in 
calling this script directly, outside of our build system. I presume this 
is the actual change that makes a difference here?

I don't mind the changes, but I'd prefer to split them into two separate 
commits; add missing shebangs (with an example of the case where it really 
does make a difference), vs removing extra spaces in shebangs for 
consistency (with explicit clarification in the commit message whether 
this is only for stylistic consistency or whether it does make a 
difference somewhere, and if it does, where).

// Martin
diff mbox series

Patch

diff --git a/configure b/configure
index f511fbae49..7b6f48e631 100755
--- a/configure
+++ b/configure
@@ -4737,7 +4737,7 @@  chmod +x $TMPE
 
 # make sure we can execute files in $TMPDIR
 cat > $TMPSH 2>> $logfile <<EOF
-#! /bin/sh
+#!/bin/sh
 EOF
 chmod +x $TMPSH >> $logfile 2>&1
 if ! $TMPSH >> $logfile 2>&1; then
@@ -8283,6 +8283,7 @@  print_enabled_components libavformat/protocol_list.c URLProtocol url_protocols $
 # Settings for pkg-config files
 
 cat > $TMPH <<EOF
+#!/bin/sh
 # Automatically generated by configure - do not modify!
 shared=$shared
 build_suffix=$build_suffix
diff --git a/doc/texidep.pl b/doc/texidep.pl
index 099690378e..33e6c7c53e 100644
--- a/doc/texidep.pl
+++ b/doc/texidep.pl
@@ -1,4 +1,4 @@ 
-#! /usr/bin/env perl
+#!/usr/bin/env perl
 
 # This script will print the dependency of a Texinfo file to stdout.
 # texidep.pl <src-path> <input.texi> <output.ext>
diff --git a/ffbuild/libversion.sh b/ffbuild/libversion.sh
index a94ab58057..ecaa90cde6 100755
--- a/ffbuild/libversion.sh
+++ b/ffbuild/libversion.sh
@@ -1,3 +1,4 @@ 
+#!/bin/sh
 toupper(){
     echo "$@" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
 }
diff --git a/tests/fate-run.sh b/tests/fate-run.sh
index 9863e4f2d9..6ae0320c60 100755
--- a/tests/fate-run.sh
+++ b/tests/fate-run.sh
@@ -1,4 +1,4 @@ 
-#! /bin/sh
+#!/bin/sh
 
 export LC_ALL=C
 
diff --git a/tests/fate.sh b/tests/fate.sh
index 07908be3a5..c5ee18de80 100755
--- a/tests/fate.sh
+++ b/tests/fate.sh
@@ -1,4 +1,4 @@ 
-#! /bin/sh
+#!/bin/sh
 
 config=$1