public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Sam James <sam@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: ruby@gentoo.org, Sam James <sam@gentoo.org>
Subject: [gentoo-dev] [PATCH 3/3] ruby-fakegem.eclass: don't double-add USE=doc/test
Date: Wed, 29 Mar 2023 16:39:34 +0100	[thread overview]
Message-ID: <20230329153934.4053851-3-sam@gentoo.org> (raw)
In-Reply-To: <20230329153934.4053851-1-sam@gentoo.org>

Signed-off-by: Sam James <sam@gentoo.org>
---
 eclass/ruby-fakegem.eclass | 42 ++++++++++++++++++++++++++------------
 1 file changed, 29 insertions(+), 13 deletions(-)

diff --git a/eclass/ruby-fakegem.eclass b/eclass/ruby-fakegem.eclass
index b3262dc5cdb4..9af96bec319f 100644
--- a/eclass/ruby-fakegem.eclass
+++ b/eclass/ruby-fakegem.eclass
@@ -150,17 +150,23 @@ RUBY_FAKEGEM_SUFFIX="${RUBY_FAKEGEM_SUFFIX:-}"
 
 case ${RUBY_FAKEGEM_RECIPE_DOC} in
 	rake)
-		IUSE+=" doc"
+		if ! has doc ${IUSE} ; then
+			IUSE+=" docc"
+		fi
 		ruby_add_bdepend "doc? ( dev-ruby/rake )"
 		RUBY_FAKEGEM_DOCDIR="doc"
 		;;
 	rdoc)
-		IUSE+=" doc"
+		if ! has doc ${IUSE} ; then
+			IUSE+=" doc"
+		fi
 		ruby_add_bdepend "doc? ( dev-ruby/rdoc )"
 		RUBY_FAKEGEM_DOCDIR="doc"
 		;;
 	yard)
-		IUSE+="doc"
+		if ! has doc ${IUSE} ; then
+			IUSE+="doc"
+		fi
 		ruby_add_bdepend "doc? ( dev-ruby/yard )"
 		RUBY_FAKEGEM_DOCDIR="doc"
 		;;
@@ -173,30 +179,40 @@ esac
 
 case ${RUBY_FAKEGEM_RECIPE_TEST} in
 	rake)
-		IUSE+=" test"
-		RESTRICT+=" !test? ( test )"
+		if ! has test ${IUSE} ; then
+			IUSE+=" test"
+			RESTRICT+=" !test? ( test )"
+		fi
 		ruby_add_bdepend "test? ( dev-ruby/rake )"
 		;;
 	rspec)
-		IUSE+=" test"
-		RESTRICT+=" !test? ( test )"
+		if ! has test ${IUSE} ; then
+			IUSE+=" test"
+			RESTRICT+=" !test? ( test )"
+		fi
 		# Also require a new enough rspec-core version that installs the
 		# rspec-2 wrapper.
 		ruby_add_bdepend "test? ( dev-ruby/rspec:2 >=dev-ruby/rspec-core-2.14.8-r2 )"
 		;;
 	rspec3)
-		IUSE+=" test"
-		RESTRICT+=" !test? ( test )"
+		if ! has test ${IUSE} ; then
+			IUSE+=" test"
+			RESTRICT+=" !test? ( test )"
+		fi
 		ruby_add_bdepend "test? ( dev-ruby/rspec:3 )"
 		;;
 	cucumber)
-		IUSE+=" test"
-		RESTRICT+=" !test? ( test )"
+                if ! has test ${IUSE} ; then
+			IUSE+=" test"
+			RESTRICT+=" !test? ( test )"
+                fi
 		ruby_add_bdepend "test? ( dev-util/cucumber )"
 		;;
 	sus)
-		IUSE+=" test"
-		RESTRICT+=" !test? ( test )"
+		if ! has test ${IUSE} ; then
+			IUSE+=" test"
+			RESTRICT+=" !test? ( test )"
+		fi
 		ruby_add_bdepend "test? ( dev-ruby/sus )"
 		;;
 	none)
-- 
2.40.0



  parent reply	other threads:[~2023-03-29 15:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-29 15:39 [gentoo-dev] [PATCH 1/3] ruby-ng.eclass: improve error when no valid Ruby in USE_RUBY Sam James
2023-03-29 15:39 ` [gentoo-dev] [PATCH 2/3] ruby-ng.eclass: don't quote IUSE in has test Sam James
2023-03-29 15:39 ` Sam James [this message]
2023-03-29 15:49   ` [gentoo-dev] [PATCH 3/3] ruby-fakegem.eclass: don't double-add USE=doc/test Petr Vaněk
2023-03-31  9:28 ` [gentoo-dev] [PATCH 1/3] ruby-ng.eclass: improve error when no valid Ruby in USE_RUBY Hans de Graaff
2023-03-31 20:27   ` Sam James

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230329153934.4053851-3-sam@gentoo.org \
    --to=sam@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    --cc=ruby@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox