diff options
author | Juan RP <xtraeme@voidlinux.eu> | 2016-04-17 15:12:14 +0000 |
---|---|---|
committer | Juan RP <xtraeme@voidlinux.eu> | 2016-04-17 15:13:06 +0000 |
commit | 054a73caf2cf333210b1e938eeb41747ec842c51 (patch) | |
tree | 820e4bfe8b09abe9bd90ba0a546479ed45ea5a34 /common/hooks/pre-pkg | |
parent | 947966bd760f9a2ffe1a501e6d0480113e38baf5 (diff) | |
download | void-packages-054a73caf2cf333210b1e938eeb41747ec842c51.tar void-packages-054a73caf2cf333210b1e938eeb41747ec842c51.tar.gz void-packages-054a73caf2cf333210b1e938eeb41747ec842c51.tar.bz2 void-packages-054a73caf2cf333210b1e938eeb41747ec842c51.tar.lz void-packages-054a73caf2cf333210b1e938eeb41747ec842c51.tar.xz void-packages-054a73caf2cf333210b1e938eeb41747ec842c51.tar.zst void-packages-054a73caf2cf333210b1e938eeb41747ec842c51.zip |
hooks/rewrite-python-shebang: simplify and check for unset $off correctly.
Diffstat (limited to 'common/hooks/pre-pkg')
-rw-r--r-- | common/hooks/pre-pkg/03-rewrite-python-shebang.sh | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/common/hooks/pre-pkg/03-rewrite-python-shebang.sh b/common/hooks/pre-pkg/03-rewrite-python-shebang.sh index c7384b4acda..e45c6044458 100644 --- a/common/hooks/pre-pkg/03-rewrite-python-shebang.sh +++ b/common/hooks/pre-pkg/03-rewrite-python-shebang.sh @@ -2,7 +2,7 @@ # - rewrites python shebangs with the corresponding python version hook() { - local pyver= shebang= warn= + local pyver= shebang= warn= off= case $pkgname in python-*) @@ -26,11 +26,10 @@ hook() { 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" -a "$off" -eq 0 ] || continue + [ -z "$off" ] && continue if [ "$warn" ]; then - msg_warn "$pkgname: multiple python versions defined!" - msg_warn "$pkgname: using $pyver for shebang" - warn= + msg_warn "$pkgver: multiple python versions defined! (using $pyver for shebangs)\n" + unset warn fi echo " Unversioned shebang replaced by '$shebang': ${f#$PKGDESTDIR}" sed -i "1s@.*python@${shebang}@" -- "$f" |