Gentoo Archives: gentoo-dev

From: Jeremy Olexa <darkside@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] On shebangs of scripts
Date: Wed, 23 Sep 2009 14:09:27
Message-Id: 90b936c0909230709v68354ecbj8781f17a99b3ad15@mail.gmail.com
In Reply to: [gentoo-dev] On shebangs of scripts by Fabian Groffen
1 On Wed, Sep 23, 2009 at 2:53 AM, Fabian Groffen <grobian@g.o> wrote:
2 > Hi all,
3 >
4 > Recently, we added a new QA check in Gentoo Prefix' Portage to check
5 > shebangs (the #! things) of scripts before they are installed.  We
6 > basically did this simply because we don't want to use say
7 > /usr/bin/perl and because this executable might not exist (e.g. on
8 > vanilla FreeBSD).  Even if it does exist, we still don't want to use it,
9 > since we installed a newer/better version, that also can find the
10 > installed packages.  This basically does not affect Gentoo Linux,
11 > however, we do run into several other cases right now that do affect
12 > Gentoo Linux:
13 >
14 > - shebangs like #!python, these are invalid and used by some python
15 >  packages
16 > - shebangs like #!/usr/local/bin/python, this is not a good idea, used
17 >  IIRC by python itself
18 > - shebangs like #!/bin/csh or #!/bin/tcsh that are correct in itself,
19 >  but basically need tcsh to be installed to run, e.g. vim does this
20 >
21 > The problem with these is that they are executable scripts, e.g. a user
22 > could expect them to be able to run, IMO.  Solving this can be done by
23 > fixing the shebang (as for the first two cases), adding a runtime
24 > dependency (for the last case), or by removing the executable bit of the
25 > scripts so they no longer can be run, and they merely become
26 > examples/documentation.
27
28 Should there ever be executable scripts in /usr/share? If the
29 consensus is 'no', could portage remove the +x bit automatically?
30
31 Other distros debate about +x in /usr/share/doc too:
32 https://bugzilla.redhat.com/show_bug.cgi?id=487527#c3 - From what I
33 gather, other distros decided that they can be +x if they work
34 properly (meaning, proper dependencies)
35
36 >
37 > Should we start filing bugs on these issues?  In the end, they are
38 > broken scripts on the system.  Is there interest for porting the Prefix
39 > shebang QA check to normal Portage?
40 >
41 >
42 > --
43 > Fabian Groffen
44 > Gentoo on a different level
45 >
46 >

Replies

Subject Author
Re: [gentoo-dev] On shebangs of scripts Mike Frysinger <vapier@g.o>