mirror of
https://github.com/openwrt/packages.git
synced 2025-12-19 09:01:22 +00:00
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>
This commit is contained in:
@@ -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 {} \;
|
||||
|
||||
Reference in New Issue
Block a user