Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH 03/29] python-utils-r1.eclass: Add missing ||die on file read
Date: Sun, 22 Nov 2015 19:54:41
Message-Id: 1448221870-17269-4-git-send-email-mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCHES] Clean-up & EAPI 6 support for python-r1 suite by "Michał Górny"
1 ---
2 eclass/python-utils-r1.eclass | 4 ++--
3 1 file changed, 2 insertions(+), 2 deletions(-)
4
5 diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
6 index 0a04e12..201b0c4 100644
7 --- a/eclass/python-utils-r1.eclass
8 +++ b/eclass/python-utils-r1.eclass
9 @@ -1038,12 +1038,12 @@ python_fix_shebang() {
10 local shebang i
11 local error= from=
12
13 - IFS= read -r shebang <"${f}"
14 + IFS= read -r shebang <"${f}" || die
15
16 # First, check if it's shebang at all...
17 if [[ ${shebang} == '#!'* ]]; then
18 local split_shebang=()
19 - read -r -a split_shebang <<<${shebang}
20 + read -r -a split_shebang <<<${shebang} || die
21
22 # Match left-to-right in a loop, to avoid matching random
23 # repetitions like 'python2.7 python2'.
24 --
25 2.6.3

Replies