Opened 8 years ago
Closed 7 years ago
#5315 closed defect (fixed)
use `env` in shebangs
|Reported by:||Boris Bobrov||Owned by:|
bash shebangs be changed to go to #!/usr/bin/env bash instead of /usr/bin/bash. That would make things work out of the box on systems where bash is not in /usr/bin, which is the case in all the BSDs and Solaris
Change History (9)
comment:1 by , 8 years ago
|Status:||new → in_progress|
comment:2 by , 7 years ago
comment:3 by , 7 years ago
would also fix #5312
comment:4 by , 7 years ago
|Status:||in_progress → review|
comment:5 by , 7 years ago
|Status:||review → closed|
Good call. Merged and pushed, thank you!
comment:6 by , 7 years ago
|Status:||closed → accepted|
Ah.... so I merged this, and just today, I reverted it!
We have a problem: not using env makes things hard for bsd; using env makes things a non-starter for Guix.
comment:7 by , 7 years ago
We might be able to have autotools make the distinction for us. I'll look into it.
comment:8 by , 7 years ago
Wait a minute,
/bin/sh still exists on *bsd systems right? It's just not bash!
We could rewrite our scripts to be more generic-bourne-style (or worst comes to worst, use m4sh) and then still use
#!/bin/sh in general as our shebang.... right?
comment:9 by , 7 years ago
|Status:||accepted → closed|
So previously we were doing
#!/usr/bin/bash. We're now doing
#!/bin/sh, which is already more generic. Theoretically all posix-y systems should ship with a bourne-compatible /bin/sh, is my understanding.
So, instead people should raise specific bugs if our scripts use bash-specific features. We can then either generic'ify them, or in more difficult cases, use m4sh.
I think with that, it's fine to close this bug.
Proposed fix http://workbench.dachary.org/dachary/mediagoblin/commit/ef8f98b9c16e2267c882c7f0d8580a4afcf6d371