hooks/post-install: fix python shebang rewriting.

This commit is contained in:
Enno Boland 2016-03-25 19:12:58 +01:00
parent b787d87217
commit 4714ce6dcd

View file

@ -15,7 +15,8 @@ hook() {
: ${pyver:=2.7}
shebang="#!/usr/bin/python$pyver"
find ${PKGDESTDIR} -type f -print0 | \
xargs -0 grep -l -m 1 "^#!.*\([[:space:]]\|/\)python\([[:space:]]\|$\)" -- | while IFS= read -r f; do
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"