summaryrefslogtreecommitdiff
path: root/lang/python/python-package-install.sh
diff options
context:
space:
mode:
authorAlexandru Ardelean <ardeleanalex@gmail.com>2019-02-04 16:36:25 +0200
committerAlexandru Ardelean <ardeleanalex@gmail.com>2019-02-12 12:31:55 +0200
commited862da9367a6f488a9afee78bfc99dbc9b6906a (patch)
tree3ff7c914ada009270814d63832a3a2475e44020b /lang/python/python-package-install.sh
parent1bf7679211425bb0f63f22ce00c700c7d84eb2d4 (diff)
python,python3: move shebang handle in install script
This extends the Python[3] shebang fixup to all packages. Only Python scripts in `/usr/bin` will be handled at the moment. Later it may make sense to also cover executables in `/bin`, though typically Python executables shouldn't be placed there. Previously the shebang handling was only done for python[3]-pip & python[3]-setuptools. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Diffstat (limited to 'lang/python/python-package-install.sh')
-rw-r--r--lang/python/python-package-install.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/lang/python/python-package-install.sh b/lang/python/python-package-install.sh
index 30373751c..a1b21e49f 100644
--- a/lang/python/python-package-install.sh
+++ b/lang/python/python-package-install.sh
@@ -65,6 +65,12 @@ process_filespec "$src_dir" "$dst_dir" "$filespec" || {
exit 1
}
+usr_bin_dir="$dst_dir/usr/bin"
+
+if [ -d "$usr_bin_dir" ] ; then
+ sed "1"'!'"b;s,^#"'!'".*python.*,#"'!'"/usr/bin/python${ver}," -i $usr_bin_dir/*
+fi
+
if [ "$mode" == "sources" ] ; then
# Copy only python source files
find "$dst_dir" -not -type d -not -name "*\.py" -exec rm -f {} \;