Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 659700

Summary: Dependency foo[bar?,baz?] seems not working if baz is not in IUSE of foo
Product: Gentoo Linux Reporter: Tupone Alfredo <tupone>
Component: Current packagesAssignee: Portage team <dev-portage>
Status: RESOLVED INVALID    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Tupone Alfredo gentoo-dev 2018-06-30 19:49:42 UTC
In dev-ada/xmlada I had to do:
-	dev-ada/gprbuild[gnat_2016=,gnat_2017=,gnat_2018=]
+	dev-ada/gprbuild[gnat_2016?]
+	dev-ada/gprbuild[gnat_2017?]
+	dev-ada/gprbuild[gnat_2018?]
with gnat_2016 !gnat_2017 !gnat_2018 and without doing this change emerge asked me to use the only dev-ada/gprbuild that has in the IUSE gnat_2018 (dev-ada/gprbuild-2018)

Reproducible: Always
Comment 1 Zac Medico gentoo-dev 2018-07-01 09:32:51 UTC
This is the intended behavior, you need to use (+) or (-) to indicate whether missing IUSE should behave if if the flag is enabled or disabled. For example, this would indicate that the flag should be considered disabled for packages that have missing IUSE:

dev-ada/gprbuild[gnat_2016(-)?]
dev-ada/gprbuild[gnat_2017(-)?]
dev-ada/gprbuild[gnat_2018(-)?]

This is referred to as use-dep-defaults in PMS:

https://dev.gentoo.org/~ulm/pms/head/pms.html#x1-790008.2.6.4
Comment 2 Tupone Alfredo gentoo-dev 2018-07-01 18:09:49 UTC
Thanks for pointing to that part of the document.

That hopefully solve my problem.

But why

DEPEND="dev-ada/gprbuild[gnat_2016?,gnat_2017?,gnat_2018?]"

is different from 

DEPEND="dev-ada/gprbuild[gnat_2016?] dev-ada/gprbuild[gnat_2017?] dev-ada/gprbuild[gnat_2018?]"

It should be the same if I understand correctly but it was the way I previously found to solve it
Comment 3 Zac Medico gentoo-dev 2018-07-01 18:21:16 UTC
For DEPEND="dev-ada/gprbuild[gnat_2016?,gnat_2017?,gnat_2018?]" it will not match unless all of the specified use-deps match, but of course you can use (+) and (-) use-dep-defaults to change that.

The DEPEND="dev-ada/gprbuild[gnat_2016?] dev-ada/gprbuild[gnat_2017?] dev-ada/gprbuild[gnat_2018?]" thing is clever, and is equivalent to (-) use-dep-defaults.
Comment 4 Tupone Alfredo gentoo-dev 2018-07-01 19:38:08 UTC
++