net-proxy/haproxy: Simplify src_compile() by using REQUIRED_USE
authorBertrand Jacquin <bertrand@jacquin.bzh>
Sat, 17 Sep 2016 23:33:51 +0000 (00:33 +0100)
committerChristian Ruppert <idl0r@gentoo.org>
Wed, 28 Sep 2016 19:53:50 +0000 (21:53 +0200)
We can avoid nested `if use' by making pcre USE flag mandatory if pcre-jit
USE flag is selected

Package-Manager: portage-2.2.28
Closes: https://github.com/gentoo/gentoo/pull/2293

Signed-off-by: Christian Ruppert <idl0r@gentoo.org>
net-proxy/haproxy/haproxy-1.6.9.ebuild
net-proxy/haproxy/haproxy-9999.ebuild

index 9ddbe6f57d9fffc88525fc08dfc76d44e5ee2e5b..85181352dc54d0e09ac31d61d48a7305bda32dad 100644 (file)
@@ -16,6 +16,7 @@ LICENSE="GPL-2 LGPL-2.1"
 SLOT="0"
 KEYWORDS="~amd64 ~arm ~ppc ~x86"
 IUSE="+crypt doc examples libressl net_ns +pcre pcre-jit ssl tools vim-syntax +zlib" # lua
+REQUIRED_USE="pcre-jit? ( pcre )"
 
 DEPEND="
        pcre? (
@@ -77,13 +78,14 @@ src_compile() {
 
        if use pcre ; then
                args="${args} USE_PCRE=1"
-               if use pcre-jit; then
-                       args="${args} USE_PCRE_JIT=1"
-               else
-                       args="${args} USE_PCRE_JIT="
-               fi
        else
-               args="${args} USE_PCRE= USE_PCRE_JIT="
+               args="${args} USE_PCRE="
+       fi
+
+       if use pcre-jit; then
+               args="${args} USE_PCRE_JIT=1"
+       else
+               args="${args} USE_PCRE_JIT="
        fi
 
 #      if use kernel_linux; then
index 42be396fd4181beda3df45f123885bb0dd12718e..f2325eb566e5ca638a9f62956cf3364abb008265 100644 (file)
@@ -16,6 +16,7 @@ LICENSE="GPL-2 LGPL-2.1"
 SLOT="0"
 KEYWORDS=""
 IUSE="+crypt doc examples libressl net_ns +pcre pcre-jit ssl tools vim-syntax +zlib" # lua
+REQUIRED_USE="pcre-jit? ( pcre )"
 
 DEPEND="
        pcre? (
@@ -77,13 +78,14 @@ src_compile() {
 
        if use pcre ; then
                args="${args} USE_PCRE=1"
-               if use pcre-jit; then
-                       args="${args} USE_PCRE_JIT=1"
-               else
-                       args="${args} USE_PCRE_JIT="
-               fi
        else
-               args="${args} USE_PCRE= USE_PCRE_JIT="
+               args="${args} USE_PCRE="
+       fi
+
+       if use pcre-jit; then
+               args="${args} USE_PCRE_JIT=1"
+       else
+               args="${args} USE_PCRE_JIT="
        fi
 
 #      if use kernel_linux; then