public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] ruby-ng.eclass: Include (-) in RUBY_TARGETS USE-dependencies
@ 2019-12-31  4:34 Michał Górny
  2019-12-31  8:28 ` David Seifert
  0 siblings, 1 reply; 3+ messages in thread
From: Michał Górny @ 2019-12-31  4:34 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

Using 2-style USE dependencies on packages not having the flag
in question is forbidden by PMS.

Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
 eclass/ruby-ng.eclass | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/eclass/ruby-ng.eclass b/eclass/ruby-ng.eclass
index db701d81f4fc..c2b9442ef489 100644
--- a/eclass/ruby-ng.eclass
+++ b/eclass/ruby-ng.eclass
@@ -137,7 +137,7 @@ ruby_samelib() {
 	local res=
 	for _ruby_implementation in $(_ruby_get_all_impls); do
 		has -${_ruby_implementation} $@ || \
-			res="${res}ruby_targets_${_ruby_implementation}?,"
+			res="${res}ruby_targets_${_ruby_implementation}?(-),"
 	done
 
 	echo "[${res%,}]"
@@ -151,9 +151,9 @@ _ruby_atoms_samelib_generic() {
 			"||" | "(" | ")" | *"?")
 				echo "${token}" ;;
 			*])
-				echo "${token%[*}[RUBYTARGET,${token/*[}" ;;
+				echo "${token%[*}[RUBYTARGET(-),${token/*[}" ;;
 			*)
-				echo "${token}[RUBYTARGET]" ;;
+				echo "${token}[RUBYTARGET(-)]" ;;
 		esac
 	done
 	echo ")"
-- 
2.24.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [gentoo-dev] [PATCH] ruby-ng.eclass: Include (-) in RUBY_TARGETS USE-dependencies
  2019-12-31  4:34 [gentoo-dev] [PATCH] ruby-ng.eclass: Include (-) in RUBY_TARGETS USE-dependencies Michał Górny
@ 2019-12-31  8:28 ` David Seifert
  2019-12-31 11:03   ` Ulrich Mueller
  0 siblings, 1 reply; 3+ messages in thread
From: David Seifert @ 2019-12-31  8:28 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

On Tue, 2019-12-31 at 05:34 +0100, Michał Górny wrote:
> Using 2-style USE dependencies on packages not having the flag
> in question is forbidden by PMS.
> 
> Signed-off-by: Michał Górny <mgorny@gentoo.org>
> ---
>  eclass/ruby-ng.eclass | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/eclass/ruby-ng.eclass b/eclass/ruby-ng.eclass
> index db701d81f4fc..c2b9442ef489 100644
> --- a/eclass/ruby-ng.eclass
> +++ b/eclass/ruby-ng.eclass
> @@ -137,7 +137,7 @@ ruby_samelib() {
>  	local res=
>  	for _ruby_implementation in $(_ruby_get_all_impls); do
>  		has -${_ruby_implementation} $@ || \
> -			res="${res}ruby_targets_${_ruby_implementation}
> ?,"
> +			res="${res}ruby_targets_${_ruby_implementation}
> ?(-),"

https://dev.gentoo.org/~ulm/pms/head/pms.html#x1-830008.3.4
In a 4-style use dependency, the flag name may *immediately* be
followed by a default specified by either (+) or (-)

https://github.com/gentoo-mirror/gentoo/blob/stable/metadata/md5-cache/dev-libs/boost-1.72.0
>=dev-python/numpy-1.17[python_targets_python3_6(-)?,...]

Given that you ran this through CI, this smells of dead code...

>  	done
>  
>  	echo "[${res%,}]"
> @@ -151,9 +151,9 @@ _ruby_atoms_samelib_generic() {
>  			"||" | "(" | ")" | *"?")
>  				echo "${token}" ;;
>  			*])
> -				echo
> "${token%[*}[RUBYTARGET,${token/*[}" ;;
> +				echo "${token%[*}[RUBYTARGET(-
> ),${token/*[}" ;;
>  			*)
> -				echo "${token}[RUBYTARGET]" ;;
> +				echo "${token}[RUBYTARGET(-)]" ;;
>  		esac
>  	done
>  	echo ")"



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-dev] [PATCH] ruby-ng.eclass: Include (-) in RUBY_TARGETS USE-dependencies
  2019-12-31  8:28 ` David Seifert
@ 2019-12-31 11:03   ` Ulrich Mueller
  0 siblings, 0 replies; 3+ messages in thread
From: Ulrich Mueller @ 2019-12-31 11:03 UTC (permalink / raw
  To: David Seifert; +Cc: gentoo-dev, Michał Górny

[-- Attachment #1: Type: text/plain, Size: 1216 bytes --]

>>>>> On Tue, 31 Dec 2019, David Seifert wrote:

> On Tue, 2019-12-31 at 05:34 +0100, Michał Górny wrote:
>> --- a/eclass/ruby-ng.eclass
>> +++ b/eclass/ruby-ng.eclass
>> @@ -137,7 +137,7 @@ ruby_samelib() {
>> local res=
>> for _ruby_implementation in $(_ruby_get_all_impls); do
>> has -${_ruby_implementation} $@ || \
>> -			res="${res}ruby_targets_${_ruby_implementation}
>> ?,"
>> +			res="${res}ruby_targets_${_ruby_implementation}
>> ?(-),"

> https://dev.gentoo.org/~ulm/pms/head/pms.html#x1-830008.3.4
> In a 4-style use dependency, the flag name may *immediately* be
> followed by a default specified by either (+) or (-)

> https://github.com/gentoo-mirror/gentoo/blob/stable/metadata/md5-cache/dev-libs/boost-1.72.0
> >=dev-python/numpy-1.17[python_targets_python3_6(-)?,...]

> Given that you ran this through CI, this smells of dead code...

AFAICS, ruby_samelib() was called only by _ruby_atoms_samelib(), and
that function has been removed in 2010 [1]. No direct calls (ever)
from any ebuild in the Gentoo repo.

So yes, ruby_samelib() seems to be dead code.

Ulrich

[1] https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/eclass/ruby-ng.eclass?r1=1.16&r2=1.17

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-12-31 11:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-31  4:34 [gentoo-dev] [PATCH] ruby-ng.eclass: Include (-) in RUBY_TARGETS USE-dependencies Michał Górny
2019-12-31  8:28 ` David Seifert
2019-12-31 11:03   ` Ulrich Mueller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox