commit:     8007a8a22364aeaefc7c4219c4b06efe347f05a1
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 24 16:08:33 2021 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Fri Dec 24 16:08:33 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8007a8a2

net-misc/openssh: rework pkg_pretend code

Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 net-misc/openssh/openssh-8.8_p1-r4.ebuild | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/net-misc/openssh/openssh-8.8_p1-r4.ebuild 
b/net-misc/openssh/openssh-8.8_p1-r4.ebuild
index 38b10330277e..0160b1ecb4ac 100644
--- a/net-misc/openssh/openssh-8.8_p1-r4.ebuild
+++ b/net-misc/openssh/openssh-8.8_p1-r4.ebuild
@@ -92,16 +92,14 @@ BDEPEND="
 pkg_pretend() {
        # this sucks, but i'd rather have people unable to `emerge -u openssh`
        # than not be able to log in to their server any more
-       maybe_fail() { [[ -z ${!2} ]] && echo "$1" ; }
-       local fail="
-               $(use hpn && maybe_fail hpn HPN_VER)
-               $(use sctp && maybe_fail sctp SCTP_PATCH)
-               $(use X509 && maybe_fail X509 X509_PATCH)
-       "
-       fail=$(echo ${fail})
-       if [[ -n ${fail} ]] ; then
+       local missing=()
+       check_feature() { use "${1}" && [[ -z ${!2} ]] && missing+=( "${1}" ); }
+       check_feature hpn HPN_VER
+       check_feature sctp SCTP_PATCH
+       check_feature X509 X509_PATCH
+       if [[ ${#missing[@]} -ne 0 ]] ; then
                eerror "Sorry, but this version does not yet support features"
-               eerror "that you requested:      ${fail}"
+               eerror "that you requested: ${missing[*]}"
                eerror "Please mask ${PF} for now and check back later:"
                eerror " # echo '=${CATEGORY}/${PF}' >> 
/etc/portage/package.mask"
                die "Missing requested third party patch."

Reply via email to