diff options
| author | Jeffery To <jeffery.to@gmail.com> | 2019-03-31 19:11:15 +0800 |
|---|---|---|
| committer | Jeffery To <jeffery.to@gmail.com> | 2019-04-03 21:05:14 +0800 |
| commit | 0280c67103f525937569528c8ba88fa3e144a903 (patch) | |
| tree | 83c3078c8f7cd023ee7ebac2c54baa706098f72c /lang/python/python-package-install.sh | |
| parent | abfd6d81ed0e14e6742fcbc09a7c8d79ad5fd655 (diff) | |
python,python3: Fix overridden usr/bin symlinks
Currently, all files in usr/bin (presumably all Python scripts) are run
through sed to replace the shebang; sed will overwrite the file whether
or not a match is found. This causes symlinks to be overridden and made
into copies of their targets. python[3]-base and python[3]-dev are
affected by this.
This adds the --follow-symlinks flag to sed, in addition to using
$(SED), so that symlinks are not overridden.
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
Diffstat (limited to 'lang/python/python-package-install.sh')
| -rw-r--r-- | lang/python/python-package-install.sh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lang/python/python-package-install.sh b/lang/python/python-package-install.sh index a1b21e49f..6b4fe54b1 100644 --- a/lang/python/python-package-install.sh +++ b/lang/python/python-package-install.sh @@ -58,6 +58,8 @@ python="$4" mode="$5" filespec="$6" +SED="${SED:-sed -e}" + find "$src_dir" -name "*\.exe" -exec rm -f {} \; process_filespec "$src_dir" "$dst_dir" "$filespec" || { @@ -68,7 +70,7 @@ process_filespec "$src_dir" "$dst_dir" "$filespec" || { 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/* + $SED "1"'!'"b;s,^#"'!'".*python.*,#"'!'"/usr/bin/python${ver}," -i --follow-symlinks $usr_bin_dir/* fi if [ "$mode" == "sources" ] ; then |
