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

Bug 471776

Summary: support USE_EXPAND prefix in package.use
Product: Portage Development Reporter: Tiziano Müller (RETIRED) <dev-zero>
Component: Enhancement/Feature RequestsAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal CC: gentoo, jcallen, mgorny, sera, slyfox
Priority: Normal Keywords: InVCS
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://thread.gmane.org/gmane.linux.gentoo.portage.devel/5138
See Also: https://bugs.gentoo.org/show_bug.cgi?id=922307
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 484436    

Description Tiziano Müller (RETIRED) gentoo-dev 2013-05-30 06:35:18 UTC
Since we get a lot of package-specific USE_EXPAND variables nowadays it would be nice to improve portage's support for it a bit:

Currently there are 3 ways to change USE_EXPAND'ed variables (in /etc/portage):

* make.conf: MY_USE_EXPAND="someflag"
* profile/make.defaults: MY_USE_EXPAND="someflag"
* package.use: cat/foo my_use_expand_some_flag

The first option overwrites the USE_EXPAND completely while the second one augments it only but doesn't permit to disable a flag from the USE_EXPAND (error: Invalid '-' operator in non-incremental variable).
So only the last option allows to disable a single flag in a specific USE_EXPAND.

Paludis has the following syntax which makes this a bit easier:

  cat/foo usualflag SOME_USE_EXPAND: someflag OTHER_USE_EXPAND: yetanotherflag

where the USE_EXPAND specifier (SOME_USE_EXPAND, OTHER_USE_EXPAND in the example above) are case-insensitive, so one could also write:

  cat/foo usualflag some_use_expand: someflag other_use_expand: yetanotherflag

it would be nice if portage would support that too (in the portage-specific configuration is enough for now, profile-support would have to go through EAPI of course).
Comment 1 Arfrever Frehtes Taifersar Arahesis 2013-05-30 22:48:26 UTC
I would suggest the following syntax in package.use:

cat/pn flag1 SOME_USE_EXPAND="flag2 -flag3" OTHER_USE_EXPAND="flag4" flag5
Comment 2 Ralph Sennhauser (RETIRED) gentoo-dev 2013-06-01 08:23:34 UTC
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #1)
> I would suggest the following syntax in package.use:
> 
> cat/pn flag1 SOME_USE_EXPAND="flag2 -flag3" OTHER_USE_EXPAND="flag4" flag5

To make it harder to parse, incompatible to existing syntax and different in nature to a possible future unified DEPENDENCIES using labels?
Comment 3 Tiziano Müller (RETIRED) gentoo-dev 2013-06-01 09:01:54 UTC
(In reply to Ralph Sennhauser from comment #2)
> To make it harder to parse, incompatible to existing syntax and different in
> nature to a possible future unified DEPENDENCIES using labels?

While I don't think we must take features which may or may not get implemented at some point in the future into account I would prefer a syntax which is similar or equal to something which already exists, like paludis' use.conf:

  cat/foo usualflag SOME_USE_EXPAND: someflag OTHER_USE_EXPAND: yetanotherflag
  cat/foo usualflag some_use_expand: someflag other_use_expand: yetanotherflag

given that it needs less specification (single/double quotes, variable substition possible, etc.) and is probably a bit easier to parse (no need to look for matching quotes).
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-11-16 22:01:37 UTC
I'd say we go for the 'FOO:' form. This has the extra advantage of being compatible with paludis format [1]. Less divergence, less confusion.

[1]:http://paludis.exherbo.org/configuration/use.html
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-01-24 09:33:51 UTC
Here's the final patch for review. Now you have to convince dol-sen to accept it ;).
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-01-24 09:40:15 UTC
/me silently swaps patches for the correct one.
Comment 8 Brian Dolbec (RETIRED) gentoo-dev 2015-02-15 00:56:26 UTC
Released in portage-2.2.16.