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 2/8] linux-info.eclass: Replace unnecessary $? checks
Date: Thu, 08 Mar 2018 17:06:52
Message-Id: 20180308170548.5782-3-mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCH 0/8] linux-info.eclass: cleanup & better non-Linux support by "Michał Górny"
1 ---
2 eclass/linux-info.eclass | 9 +++------
3 1 file changed, 3 insertions(+), 6 deletions(-)
4
5 diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass
6 index b8c1a524bae8..df6227220b79 100644
7 --- a/eclass/linux-info.eclass
8 +++ b/eclass/linux-info.eclass
9 @@ -628,8 +628,7 @@ get_running_version() {
10 # This attempts to find the version of the sources, and otherwise falls back to
11 # the version of the running kernel.
12 linux-info_get_any_version() {
13 - get_version
14 - if [[ $? -ne 0 ]]; then
15 + if ! get_version; then
16 ewarn "Unable to calculate Linux Kernel version for build, attempting to use running version"
17 get_running_version
18 fi
19 @@ -848,13 +847,11 @@ check_zlibinflate() {
20
21 ebegin "checking ZLIB_INFLATE"
22 linux_chkconfig_builtin CONFIG_ZLIB_INFLATE
23 - eend $?
24 - [ "$?" != 0 ] && die
25 + eend $? || die
26
27 ebegin "checking ZLIB_DEFLATE"
28 linux_chkconfig_builtin CONFIG_ZLIB_DEFLATE
29 - eend $?
30 - [ "$?" != 0 ] && die
31 + eend $? || die
32
33 local LINENO_START
34 local LINENO_END
35 --
36 2.16.2