Gentoo Archives: gentoo-dev

From: Mike Gilbert <floppym@g.o>
To: "Michał Górny" <mgorny@g.o>
Cc: Gentoo Dev <gentoo-dev@l.g.o>, Gentoo Python Project <python@g.o>
Subject: [gentoo-dev] Re: [PATCH python-utils-r1] Move python_fix_shebang to python-utils-r1 and rewrite it clean.
Date: Tue, 20 May 2014 18:27:11
Message-Id: CAJ0EP43+qFhF-jF8SUbtv4HRaqEZ-9+PSpwV2EZ_9=6VVypS=Q@mail.gmail.com
In Reply to: [gentoo-dev] [PATCH python-utils-r1] Move python_fix_shebang to python-utils-r1 and rewrite it clean. by "Michał Górny"
1 On Tue, May 20, 2014 at 2:19 PM, Michał Górny <mgorny@g.o> wrote:
2 > It serves both as public shebang fixing function and replacement of
3 > _python_rewrite_shebang internal function. For the sake of having common
4 > code and consistent behavior.
5 >
6 > Notes on the 'new' function:
7 >
8 > 1. takes a list of files and/or directories to fix. Directories are
9 > processed recursively,
10 >
11 > 2. files, depending on the shebang:
12 >
13 > a) with shebang matching $EPYTHON (e.g. already having pythonX.Y) are
14 > skipped silently (but see 3),
15 >
16 > b) with shebang 'compatible' with $EPYTHON (e.g. python3 -> python3.2,
17 > but not python2 -> python3.2) are mangled verbosely,
18 >
19 > c) with shebang 'incompatible' with $EPYTHON (e.g. python3 -> python2.7,
20 > python3.2 -> python3.3) raise a fatal error,
21 >
22
23 This fatal behavior is a little annoying. I seem to recall people
24 asking if there is a way to just force it, no matter if the shebang is
25 'compatible' or not.
26
27 Unfortunately, I do not have example handy, but I know I have been
28 asked the question.

Replies