Gentoo Archives: gentoo-dev

From: Fabian Groffen <grobian@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] On shebangs of scripts
Date: Wed, 23 Sep 2009 07:52:49
Message-Id: 20090923075342.GB19302@gentoo.org
1 Hi all,
2
3 Recently, we added a new QA check in Gentoo Prefix' Portage to check
4 shebangs (the #! things) of scripts before they are installed. We
5 basically did this simply because we don't want to use say
6 /usr/bin/perl and because this executable might not exist (e.g. on
7 vanilla FreeBSD). Even if it does exist, we still don't want to use it,
8 since we installed a newer/better version, that also can find the
9 installed packages. This basically does not affect Gentoo Linux,
10 however, we do run into several other cases right now that do affect
11 Gentoo Linux:
12
13 - shebangs like #!python, these are invalid and used by some python
14 packages
15 - shebangs like #!/usr/local/bin/python, this is not a good idea, used
16 IIRC by python itself
17 - shebangs like #!/bin/csh or #!/bin/tcsh that are correct in itself,
18 but basically need tcsh to be installed to run, e.g. vim does this
19
20 The problem with these is that they are executable scripts, e.g. a user
21 could expect them to be able to run, IMO. Solving this can be done by
22 fixing the shebang (as for the first two cases), adding a runtime
23 dependency (for the last case), or by removing the executable bit of the
24 scripts so they no longer can be run, and they merely become
25 examples/documentation.
26
27 Should we start filing bugs on these issues? In the end, they are
28 broken scripts on the system. Is there interest for porting the Prefix
29 shebang QA check to normal Portage?
30
31
32 --
33 Fabian Groffen
34 Gentoo on a different level

Replies

Subject Author
Re: [gentoo-dev] On shebangs of scripts Sebastian Pipping <webmaster@××××××××.org>
Re: [gentoo-dev] On shebangs of scripts Jeremy Olexa <darkside@g.o>
Re: [gentoo-dev] On shebangs of scripts Mike Frysinger <vapier@g.o>