Browse Source

Merge pull request #8550 from jefferyto/python-fix-bin-symlinks

python,python3: Fix overridden usr/bin symlinks
lilik-openwrt-22.03
Josef Schlehofer 6 years ago
committed by GitHub
parent
commit
ff8ce9a3d5
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 1 deletions
  1. +3
    -1
      lang/python/python-package-install.sh
  2. +1
    -0
      lang/python/python-package.mk
  3. +1
    -0
      lang/python/python3-package.mk

+ 3
- 1
lang/python/python-package-install.sh View File

@ -58,6 +58,8 @@ python="$4"
mode="$5" mode="$5"
filespec="$6" filespec="$6"
SED="${SED:-sed -e}"
find "$src_dir" -name "*\.exe" -exec rm -f {} \; find "$src_dir" -name "*\.exe" -exec rm -f {} \;
process_filespec "$src_dir" "$dst_dir" "$filespec" || { 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" usr_bin_dir="$dst_dir/usr/bin"
if [ -d "$usr_bin_dir" ] ; then 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 fi
if [ "$mode" == "sources" ] ; then if [ "$mode" == "sources" ] ; then


+ 1
- 0
lang/python/python-package.mk View File

@ -69,6 +69,7 @@ define PyPackage
define Package/$(1)/install define Package/$(1)/install
$$(call PyPackage/$(1)/install,$$(1)) $$(call PyPackage/$(1)/install,$$(1))
SED="$(SED)" \
$(SHELL) $(python_mk_path)python-package-install.sh "2" \ $(SHELL) $(python_mk_path)python-package-install.sh "2" \
"$(PKG_INSTALL_DIR)" "$$(1)" \ "$(PKG_INSTALL_DIR)" "$$(1)" \
"$(HOST_PYTHON_BIN)" "$$(2)" \ "$(HOST_PYTHON_BIN)" "$$(2)" \


+ 1
- 0
lang/python/python3-package.mk View File

@ -68,6 +68,7 @@ define Py3Package
define Package/$(1)/install define Package/$(1)/install
$$(call Py3Package/$(1)/install,$$(1)) $$(call Py3Package/$(1)/install,$$(1))
SED="$(SED)" \
$(SHELL) $(python3_mk_path)python-package-install.sh "3" \ $(SHELL) $(python3_mk_path)python-package-install.sh "3" \
"$(PKG_INSTALL_DIR)" "$$(1)" \ "$(PKG_INSTALL_DIR)" "$$(1)" \
"$(HOST_PYTHON3_BIN)" "$$(2)" \ "$(HOST_PYTHON3_BIN)" "$$(2)" \


Loading…
Cancel
Save