Re: [FFmpeg-devel] [PATCH v3 2/5] ffbuild/libversion.sh: add shebang

2024-04-09 Thread Marth64
Regardless -- it can be left as is . I digress from the topic.

Thank you,
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v3 2/5] ffbuild/libversion.sh: add shebang

2024-04-09 Thread Marth64
> so that seems like a terrible idea that would achieve
> the opposite result.

I respectfully disagree.

Neither approach is universal or POSIX specified.
So while I agree it can be left as-is since only
a basic Bourne shell is needed, I would not just
dismiss it/write it off as a terrible idea.

There are reasons why #!/usr/bin/env is colloquially preferred
to launch an interpreter in most shell script cases.
For example, there are systems where /bin/sh is NOT
a POSIX compliant shell. Alternatively, what if I have a different
or compliant `sh` in my PATH, but not necessarily in /bin?
This is not a scenario I made up, one can quickly research to see.

I will not bikeshed the topic further, we can go either way,
but I don't think it qualifies as a "terrible idea".
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v3 2/5] ffbuild/libversion.sh: add shebang

2024-04-09 Thread Henrik Gramner via ffmpeg-devel
On Tue, Apr 9, 2024 at 11:52 PM Marth64  wrote:
> > +#!/bin/sh
> Might I suggest `#!/usr/bin/env sh` instead for this case?
> I tend to prefer it from a portability and usability perspective,
> but I can imagine for sh it might not matter.

/bin/sh exists on virtually every *NIX system whereas /usr/bin/env is
not ubiquitous, so that seems like a terrible idea that would achieve
the opposite result.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v3 2/5] ffbuild/libversion.sh: add shebang

2024-04-09 Thread Marth64
> +#!/bin/sh
Might I suggest `#!/usr/bin/env sh` instead for this case?
I tend to prefer it from a portability and usability perspective,
but I can imagine for sh it might not matter.

I am not close to the patch that you are working on.
But thought to throw this out there in case there is a
platform or user relying on unique behaviour here.

Thank you for your time,
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v3 2/5] ffbuild/libversion.sh: add shebang

2024-04-09 Thread J. Dekker
The implicit interpreter is dependent on the environment, and isn't
guaranteed to be /bin/sh. Some packagers call this script directly, and
in certain environments such as containers using qemu-user through
binfmt_misc emulation on Linux it doesn't fallback to /bin/sh.

To fix these cases we add the interpreter explicitly.

Signed-off-by: J. Dekker 
---
 ffbuild/libversion.sh | 1 +
 1 file changed, 1 insertion(+)

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
 }
-- 
2.44.0

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".