diff options
author | 2014-09-04 14:52:58 +0000 | |
---|---|---|
committer | 2014-09-04 14:52:58 +0000 | |
commit | 35a078d03d0ba4d2701d7890457020e7fcac29a3 (patch) | |
tree | 341af160e8460b96355017282c3049592c2f942f /eclass/python-utils-r1.eclass | |
parent | Version bump. (diff) | |
download | gentoo-2-35a078d03d0ba4d2701d7890457020e7fcac29a3.tar.gz gentoo-2-35a078d03d0ba4d2701d7890457020e7fcac29a3.tar.bz2 gentoo-2-35a078d03d0ba4d2701d7890457020e7fcac29a3.zip |
Preserve all whitespace in shebangs, and add regression test for that. Also, prevent filename expansion when word-splitting it. Bug #522080.
Diffstat (limited to 'eclass/python-utils-r1.eclass')
-rw-r--r-- | eclass/python-utils-r1.eclass | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index 02f7d9fae177..36fbd117b623 100644 --- a/eclass/python-utils-r1.eclass +++ b/eclass/python-utils-r1.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/python-utils-r1.eclass,v 1.60 2014/07/06 11:45:20 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/python-utils-r1.eclass,v 1.61 2014/09/04 14:52:58 mgorny Exp $ # @ECLASS: python-utils-r1 # @MAINTAINER: @@ -960,13 +960,16 @@ python_fix_shebang() { local shebang i local error= from= - read shebang <"${f}" + IFS= read -r shebang <${f} # First, check if it's shebang at all... if [[ ${shebang} == '#!'* ]]; then + local split_shebang=() + read -r -a split_shebang <<<${shebang} + # Match left-to-right in a loop, to avoid matching random # repetitions like 'python2.7 python2'. - for i in ${shebang}; do + for i in "${split_shebang[@]}"; do case "${i}" in *"${EPYTHON}") debug-print "${FUNCNAME}: in file ${f#${D}}" |