commit:     3c3ef606b855d35fb0e0fc9dcc0c005b28f5e6d3
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Sat Sep  1 01:20:01 2018 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Sat Sep  1 01:32:06 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3c3ef606

sys-apps/keyutils: kernel config checks rewritten

- CONFIG_KEY_DH_OPERATIONS is only available in kernel >=4.7

- Package will now fail in setup phase when FEATURES=test is set
  and not all required kernel options are set to prevent false
  positive bug reports due to failures of test phase caused by
  missing options.

Closes: https://bugs.gentoo.org/624380
Package-Manager: Portage-2.3.48, Repoman-2.3.10

 sys-apps/keyutils/keyutils-1.5.10-r1.ebuild | 30 ++++++++++++++++++++++++-----
 sys-apps/keyutils/keyutils-1.5.11-r1.ebuild | 30 ++++++++++++++++++++++++-----
 2 files changed, 50 insertions(+), 10 deletions(-)

diff --git a/sys-apps/keyutils/keyutils-1.5.10-r1.ebuild 
b/sys-apps/keyutils/keyutils-1.5.10-r1.ebuild
index 5a4a876d41c..e76b88beb5d 100644
--- a/sys-apps/keyutils/keyutils-1.5.10-r1.ebuild
+++ b/sys-apps/keyutils/keyutils-1.5.10-r1.ebuild
@@ -26,13 +26,33 @@ PATCHES=(
 )
 
 pkg_setup() {
-       CONFIG_CHECK="~KEYS"
-       ERROR_KEYS="You must have CONFIG_KEYS to use this package!"
+       # To prevent a failure in test phase and false positive bug reports
+       # we are enforcing the following options because testsuite expects
+       # that these options are available. I.e. testsuite only decides based
+       # on kernel version which tests will be called, no feature checking.
+       if use test ; then
+               CONFIG_CHECK="KEYS"
+               ERROR_KEYS="You must have CONFIG_KEYS to run the package 
testsuite!"
+
+               if kernel_is -ge 2 6 10 && kernel_is -lt 4 0 0 ; then
+                       CONFIG_CHECK="${CONFIG_CHECK} KEYS_DEBUG_PROC_KEYS"
+                       ERROR_KEYS_DEBUG_PROC_KEYS="You must have 
CONFIG_KEYS_DEBUG_PROC_KEYS to run the package testsuite!"
+               fi
+
+               if kernel_is -ge 4 7 ; then
+                       CONFIG_CHECK="${CONFIG_CHECK} KEY_DH_OPERATIONS"
+                       ERROR_KEY_DH_OPERATIONS="You must have 
CONFIG_KEY_DH_OPERATIONS to run the package testsuite!"
+               fi
+       else
+               CONFIG_CHECK="~KEYS"
+               ERROR_KEYS="You will be unable to use this package on this 
system because CONFIG_KEYS is not set!"
 
-       if use test && kernel_is lt 4 0 0; then
-               CONFIG_CHECK="${CONFIG_CHECK} ~KEYS_DEBUG_PROC_KEYS 
~KEY_DH_OPERATIONS"
-               ERROR_KEYS_DEBUG_PROC_KEYS="You must have 
CONFIG_KEYS_DEBUG_PROC_KEYS to run the package testsuite!"
+               if kernel_is -ge 4 7 ; then
+                       CONFIG_CHECK="${CONFIG_CHECK} ~KEY_DH_OPERATIONS"
+                       ERROR_KEY_DH_OPERATIONS="You will be unable to use 
Diffie-Hellman on this system because CONFIG_KEY_DH_OPERATIONS is not set!"
+               fi
        fi
+
        linux-info_pkg_setup
 }
 

diff --git a/sys-apps/keyutils/keyutils-1.5.11-r1.ebuild 
b/sys-apps/keyutils/keyutils-1.5.11-r1.ebuild
index b47e4ff1d2d..23be07210ba 100644
--- a/sys-apps/keyutils/keyutils-1.5.11-r1.ebuild
+++ b/sys-apps/keyutils/keyutils-1.5.11-r1.ebuild
@@ -27,13 +27,33 @@ PATCHES=(
 )
 
 pkg_setup() {
-       CONFIG_CHECK="~KEYS"
-       ERROR_KEYS="You must have CONFIG_KEYS to use this package!"
+       # To prevent a failure in test phase and false positive bug reports
+       # we are enforcing the following options because testsuite expects
+       # that these options are available. I.e. testsuite only decides based
+       # on kernel version which tests will be called, no feature checking.
+       if use test ; then
+               CONFIG_CHECK="KEYS"
+               ERROR_KEYS="You must have CONFIG_KEYS to run the package 
testsuite!"
+
+               if kernel_is -ge 2 6 10 && kernel_is -lt 4 0 0 ; then
+                       CONFIG_CHECK="${CONFIG_CHECK} KEYS_DEBUG_PROC_KEYS"
+                       ERROR_KEYS_DEBUG_PROC_KEYS="You must have 
CONFIG_KEYS_DEBUG_PROC_KEYS to run the package testsuite!"
+               fi
+
+               if kernel_is -ge 4 7 ; then
+                       CONFIG_CHECK="${CONFIG_CHECK} KEY_DH_OPERATIONS"
+                       ERROR_KEY_DH_OPERATIONS="You must have 
CONFIG_KEY_DH_OPERATIONS to run the package testsuite!"
+               fi
+       else
+               CONFIG_CHECK="~KEYS"
+               ERROR_KEYS="You will be unable to use this package on this 
system because CONFIG_KEYS is not set!"
 
-       if use test && kernel_is lt 4 0 0; then
-               CONFIG_CHECK="${CONFIG_CHECK} ~KEYS_DEBUG_PROC_KEYS 
~KEY_DH_OPERATIONS"
-               ERROR_KEYS_DEBUG_PROC_KEYS="You must have 
CONFIG_KEYS_DEBUG_PROC_KEYS to run the package testsuite!"
+               if kernel_is -ge 4 7 ; then
+                       CONFIG_CHECK="${CONFIG_CHECK} ~KEY_DH_OPERATIONS"
+                       ERROR_KEY_DH_OPERATIONS="You will be unable to use 
Diffie-Hellman on this system because CONFIG_KEY_DH_OPERATIONS is not set!"
+               fi
        fi
+
        linux-info_pkg_setup
 }
 

Reply via email to