python-utils-r1.eclass: Add missing ||die on file read

This commit is contained in:
Michał Górny
2015-11-28 20:09:06 +01:00
parent de298a8cdc
commit a3853d54e9
+3 -1
View File
@@ -1041,12 +1041,14 @@ python_fix_shebang() {
local shebang i
local error= from=
# note: we can't ||die here since read will fail if file
# has no newline characters
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}
read -r -a split_shebang <<<${shebang} || die
# Match left-to-right in a loop, to avoid matching random
# repetitions like 'python2.7 python2'.