commit:     6b6515f9da372efc0899614f2d1abcba2382b4bb
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 22 22:34:48 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Mar 23 04:48:45 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6b6515f9

dev-libs/hiredis: style changes

* Don't quote EAPI
* Use Bash tests, not POSIX
* Define PATCHES in global scope
* sam-style semicolons

Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-libs/hiredis/hiredis-0.14.1.ebuild | 20 +++++++++++---------
 dev-libs/hiredis/hiredis-1.0.0.ebuild  | 27 ++++++++++++++++-----------
 2 files changed, 27 insertions(+), 20 deletions(-)

diff --git a/dev-libs/hiredis/hiredis-0.14.1.ebuild 
b/dev-libs/hiredis/hiredis-0.14.1.ebuild
index d3827b66b40..81bbbb4420c 100644
--- a/dev-libs/hiredis/hiredis-0.14.1.ebuild
+++ b/dev-libs/hiredis/hiredis-0.14.1.ebuild
@@ -1,7 +1,7 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI="7"
+EAPI=7
 
 inherit toolchain-funcs
 
@@ -17,11 +17,12 @@ RESTRICT="!test? ( test )"
 
 DEPEND="test? ( dev-db/redis )"
 
+PATCHES=(
+       "${FILESDIR}"/${PN}-0.13.3-disable-network-tests.patch
+       "${FILESDIR}"/${PN}-0.14.1-honor-AR.patch
+)
+
 src_prepare() {
-       local PATCHES=(
-               "${FILESDIR}"/${PN}-0.13.3-disable-network-tests.patch
-               "${FILESDIR}"/${PN}-0.14.1-honor-AR.patch
-       )
        default
 
        # use GNU ld syntax on Solaris
@@ -58,17 +59,18 @@ src_test() {
 
        _build hiredis-test
 
-       /usr/sbin/redis-server - <<< "${REDIS_TEST_CONFIG}" || die
+       "${EPREFIX}"/usr/sbin/redis-server - <<< "${REDIS_TEST_CONFIG}" || die
        ./hiredis-test -h 127.0.0.1 -p ${REDIS_PID} -s ${REDIS_SOCK}
        local ret=$?
 
        kill "$(<"${REDIS_PID}")" || die
-       [ ${ret} != "0" ] && die "tests failed"
+       [[ ${ret} != "0" ]] && die "tests failed"
 }
 
 src_install() {
        _build PREFIX="${ED}/usr" install
-       if ! use static-libs; then
+
+       if ! use static-libs ; then
                find "${ED}" -name '*.a' -delete || die
        fi
 

diff --git a/dev-libs/hiredis/hiredis-1.0.0.ebuild 
b/dev-libs/hiredis/hiredis-1.0.0.ebuild
index 20d56c4f2eb..b9046749771 100644
--- a/dev-libs/hiredis/hiredis-1.0.0.ebuild
+++ b/dev-libs/hiredis/hiredis-1.0.0.ebuild
@@ -1,7 +1,7 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI="7"
+EAPI=7
 
 inherit toolchain-funcs
 
@@ -17,12 +17,14 @@ RESTRICT="!test? ( test )"
 
 DEPEND="
        ssl? ( dev-libs/openssl )
-       test? ( dev-db/redis )"
+       test? ( dev-db/redis )
+"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-1.0.0-disable-network-tests.patch
+)
 
 src_prepare() {
-       local PATCHES=(
-               "${FILESDIR}/${PN}-1.0.0-disable-network-tests.patch"
-       )
        default
 
        # use GNU ld syntax on Solaris
@@ -52,25 +54,28 @@ src_test() {
        local REDIS_PID="${T}"/hiredis.pid
        local REDIS_SOCK="${T}"/hiredis.sock
        local REDIS_PORT=56379
-       local REDIS_TEST_CONFIG="daemonize yes
+       local REDIS_TEST_CONFIG="
+               daemonize yes
                pidfile ${REDIS_PID}
                port ${REDIS_PORT}
                bind 127.0.0.1
-               unixsocket //${REDIS_SOCK}"
+               unixsocket //${REDIS_SOCK}
+       "
 
        _build hiredis-test
 
-       /usr/sbin/redis-server - <<< "${REDIS_TEST_CONFIG}" || die
+       "${EPREFIX}"/usr/sbin/redis-server - <<< "${REDIS_TEST_CONFIG}" || die
        ./hiredis-test -h 127.0.0.1 -p ${REDIS_PID} -s ${REDIS_SOCK}
        local ret=$?
 
        kill "$(<"${REDIS_PID}")" || die
-       [ ${ret} != "0" ] && die "tests failed"
+       [[ ${ret} != "0" ]] && die "tests failed"
 }
 
 src_install() {
        _build PREFIX="${ED}/usr" install
-       if ! use static-libs; then
+
+       if ! use static-libs ; then
                find "${ED}" -name '*.a' -delete || die
        fi
 

Reply via email to