logrotate: enable selinux support
[buildroot-gz.git] / package / python / 017-distutils-scripts-dont-adjust-shebang.patch
blobda4dc36df5d4986466285298f5d82edbf5ece268
1 Do not adjust the shebang of Python scripts for cross-compilation
3 The copy_scripts() method in distutils copies the scripts listed in
4 the setup file and adjusts the first line to refer to the current
5 Python interpreter. When cross-compiling, this means that the adjusted
6 shebang refers to the host Python interpreter.
8 This patch modifies copy_scripts() to preserve the shebang when
9 cross-compilation is detected.
11 Signed-off-by: Christophe Vu-Brugier <cvubrugier@fastmail.fm>
13 Index: b/Lib/distutils/command/build_scripts.py
14 ===================================================================
15 --- a/Lib/distutils/command/build_scripts.py
16 +++ b/Lib/distutils/command/build_scripts.py
17 @@ -89,7 +89,7 @@
18 adjust = 1
19 post_interp = match.group(1) or ''
21 - if adjust:
22 + if adjust and not '_python_sysroot' in os.environ:
23 log.info("copying and adjusting %s -> %s", script,
24 self.build_dir)
25 if not self.dry_run: