aboutsummaryrefslogtreecommitdiff
path: root/common/hooks/post-install
diff options
context:
space:
mode:
authorEnno Boland <gottox@voidlinux.eu>2016-03-27 10:24:00 +0000
committerEnno Boland <gottox@voidlinux.eu>2016-03-27 10:25:27 +0000
commit6606995831a0e1ef40cd9f68a1d02f38ec4dd524 (patch)
tree5891fc9cb519594e0f3c1fa91c306dab28b78175 /common/hooks/post-install
parent5914ed56f1df8286c9e89f2e3a3daa529ce84c65 (diff)
downloadvoid-packages-6606995831a0e1ef40cd9f68a1d02f38ec4dd524.tar
void-packages-6606995831a0e1ef40cd9f68a1d02f38ec4dd524.tar.gz
void-packages-6606995831a0e1ef40cd9f68a1d02f38ec4dd524.tar.bz2
void-packages-6606995831a0e1ef40cd9f68a1d02f38ec4dd524.tar.lz
void-packages-6606995831a0e1ef40cd9f68a1d02f38ec4dd524.tar.xz
void-packages-6606995831a0e1ef40cd9f68a1d02f38ec4dd524.tar.zst
void-packages-6606995831a0e1ef40cd9f68a1d02f38ec4dd524.zip
common/hooks: fix python shebang rewrite for multi-versioned packages
Diffstat (limited to 'common/hooks/post-install')
-rw-r--r--common/hooks/post-install/07-rewrite-python-shebang.sh28
1 files changed, 0 insertions, 28 deletions
diff --git a/common/hooks/post-install/07-rewrite-python-shebang.sh b/common/hooks/post-install/07-rewrite-python-shebang.sh
deleted file mode 100644
index 8030e68035f..00000000000
--- a/common/hooks/post-install/07-rewrite-python-shebang.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-# This hook executes the following tasks:
-# - rewrites python shebangs with the corresponding python version
-
-hook() {
- local pyver= shebang= warn=
-
- for i in $python_versions; do
- if [ "$pyver" ]; then
- warn=1
- break;
- fi
- pyver=$i
- done
-
- : ${pyver:=2.7}
- shebang="#!/usr/bin/python$pyver"
- find ${PKGDESTDIR} -type f -print0 | \
- xargs -0 grep -H -b -m 1 "^#!.*\([[:space:]]\|/\)python\([[:space:]]\|$\)" -- | while IFS=: read -r f off _; do
- [ "$off" -eq 0 ] || continue
- if [ "$warn" ]; then
- msg_warn "$pkgname: multiple python versions defined!"
- msg_warn "$pkgname: using $pyver for shebang"
- warn=
- fi
- echo " Unversioned shebang replaced by '$shebang': ${f#$PKGDESTDIR}"
- sed -i "1s@.*python@${shebang}@" -- "$f"
- done
-}