common/hooks: fix python shebang rewrite for multi-versioned packages
This commit is contained in:
parent
5914ed56f1
commit
6606995831
1 changed files with 16 additions and 8 deletions
|
@ -4,15 +4,23 @@
|
|||
hook() {
|
||||
local pyver= shebang= warn=
|
||||
|
||||
for i in $python_versions; do
|
||||
if [ "$pyver" ]; then
|
||||
warn=1
|
||||
break;
|
||||
fi
|
||||
pyver=$i
|
||||
done
|
||||
case $pkgname in
|
||||
python-*)
|
||||
pyver=2.7;;
|
||||
python3.4-*)
|
||||
pyver=3.4;;
|
||||
*)
|
||||
for i in $python_versions; do
|
||||
if [ "$pyver" ]; then
|
||||
warn=1
|
||||
break;
|
||||
fi
|
||||
pyver=$i
|
||||
done
|
||||
: ${pyver:=2.7}
|
||||
;;
|
||||
esac
|
||||
|
||||
: ${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
|
Loading…
Reference in a new issue