summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2015-11-18 20:45:05 +0100
committerMichał Górny <mgorny@gentoo.org>2015-11-28 20:09:06 +0100
commita3853d54e97fac592ea154e0fe0373395519dc0f (patch)
tree352d7fc6b54d6abfebe40b4f95461b16021177c8 /eclass
parentpython-utils-r1.eclass: Add missing ||die on 'cat' file writes (diff)
downloadgentoo-a3853d54e97fac592ea154e0fe0373395519dc0f.tar.gz
gentoo-a3853d54e97fac592ea154e0fe0373395519dc0f.tar.bz2
gentoo-a3853d54e97fac592ea154e0fe0373395519dc0f.zip
python-utils-r1.eclass: Add missing ||die on file read
Diffstat (limited to 'eclass')
-rw-r--r--eclass/python-utils-r1.eclass4
1 files changed, 3 insertions, 1 deletions
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index c0451a702582..7b0f2f87a566 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -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'.