03-rewrite-python-shebang.sh: don't rewrite versioned python scripts (#6155)
fixes #6151.
This commit is contained in:
parent
91e6b2a2cd
commit
571e42ffce
1 changed files with 3 additions and 3 deletions
|
@ -19,9 +19,9 @@ hook() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
shebang="#!/usr/bin/python${pyver%.*}"
|
shebang="#!/usr/bin/python${pyver%.*}"
|
||||||
find ${PKGDESTDIR} -type f -print0 | \
|
find "${PKGDESTDIR}" -type f -print0 | \
|
||||||
xargs -0 grep -H -b -m 1 "^#!.*\([[:space:]]\|/\)python\([[:space:]]*\|$\)" -- | while IFS=: read -r f off _; do
|
xargs -0 grep -H -b -m 1 "^#!.*\([[:space:]]\|/\)python\([0-9]\.[0-9]\)\?\([[:space:]]\+\|$\)" -- | while IFS=: read -r f off _; do
|
||||||
[ -z "$off" ] && continue
|
[ -z "$off" ] && continue
|
||||||
echo " Shebang converted to '$shebang': ${f#$PKGDESTDIR}"
|
echo " Shebang converted to '$shebang': ${f#$PKGDESTDIR}"
|
||||||
sed -i "1s@.*python.*@${shebang}@" -- "$f"
|
sed -i "1s@.*python.*@${shebang}@" -- "$f"
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in a new issue