common: support disabling python shebang rewriting
useful if there are special python-containing shebangs that should not be rewritten, for example with Ghidra's embedded jython.
This commit is contained in:
parent
5b210379b4
commit
58705ffcbf
3 changed files with 8 additions and 2 deletions
|
@ -1630,6 +1630,8 @@ In most cases version is inferred from shebang, install path or build style.
|
||||||
Only required for some multi-language
|
Only required for some multi-language
|
||||||
applications (e.g., the application is written in C while the command is
|
applications (e.g., the application is written in C while the command is
|
||||||
written in Python) or just single Python file ones that live in `/usr/bin`.
|
written in Python) or just single Python file ones that live in `/usr/bin`.
|
||||||
|
If `python_version` is set to `ignore`, python-containing shebangs will not be rewritten.
|
||||||
|
Use this only if a package should not be using a system version of python.
|
||||||
|
|
||||||
Also, a set of useful variables are defined to use in the templates:
|
Also, a set of useful variables are defined to use in the templates:
|
||||||
|
|
||||||
|
|
|
@ -272,7 +272,7 @@ _EOF
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$python_version" ]; then
|
if [ -n "$python_version" ] && [ "$python_version" != ignore ]; then
|
||||||
pycompile_version=${python_version}
|
pycompile_version=${python_version}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,10 @@ hook() {
|
||||||
pyver="$python_version"
|
pyver="$python_version"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$python_version" = ignore ]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "$pyver" ]; then
|
if [ -n "$pyver" ]; then
|
||||||
default_shebang="#!/usr/bin/python${pyver%.*}"
|
default_shebang="#!/usr/bin/python${pyver%.*}"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue