linux-info.eclass: Replace unnecessary $? checks
authorMichał Górny <mgorny@gentoo.org>
Thu, 8 Mar 2018 16:02:43 +0000 (17:02 +0100)
committerMichał Górny <mgorny@gentoo.org>
Mon, 9 Jul 2018 16:54:45 +0000 (18:54 +0200)
eclass/linux-info.eclass

index 0eca5572587469ab60997e792025516343656511..d5eb0e73fcfa42d569b319fd79c3d1e01f09aca0 100644 (file)
@@ -628,8 +628,7 @@ get_running_version() {
 # This attempts to find the version of the sources, and otherwise falls back to
 # the version of the running kernel.
 linux-info_get_any_version() {
-       get_version
-       if [[ $? -ne 0 ]]; then
+       if ! get_version; then
                ewarn "Unable to calculate Linux Kernel version for build, attempting to use running version"
                get_running_version
        fi
@@ -848,13 +847,11 @@ check_zlibinflate() {
 
        ebegin "checking ZLIB_INFLATE"
        linux_chkconfig_builtin CONFIG_ZLIB_INFLATE
-       eend $?
-       [ "$?" != 0 ] && die
+       eend $? || die
 
        ebegin "checking ZLIB_DEFLATE"
        linux_chkconfig_builtin CONFIG_ZLIB_DEFLATE
-       eend $?
-       [ "$?" != 0 ] && die
+       eend $? || die
 
        local LINENO_START
        local LINENO_END