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

Bug 530222

Summary: sys-apps/portage: treats USE_EXPAND variables in make.defaults as semi-incremental
Product: Portage Development Reporter: Michał Górny <mgorny>
Component: CoreAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal CC: cdf123, pms
Priority: Normal Keywords: InVCS
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=541378
https://bugs.gentoo.org/show_bug.cgi?id=559280
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 484436    

Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-11-23 19:16:23 UTC
Let's say I have two profiles: base and subprofile, with subprofile inheriting base. If base has:

  USE_EXPAND="PYTHON_TARGETS"
  PYTHON_TARGETS="python2_7 python3_4"

and subprofile has:

  PYTHON_TARGETS="python3_3"

Portage appends 3.3 as if PYTHON_TARGETS were incremental. However, if I do:

  PYTHON_TARGETS="-* python3_3"

It complains:

  Invalid '-' operator in non-incremental variable 'PYTHON_TARGETS': '-*'

and ignores the unset.


Now, reading PMS. '5.3.2 Specific variables and their meanings' says:

  USE_EXPAND
    Defines a list of variables which are to be treated incrementally
    and whose contents are to be expanded into the USE variable as passed
    to ebuilds. See section 11.1.1 for details.

So I'd say Portage should treat it fully incrementally, and respect '-flag' incl. '-*'. CC-ing pms-bugs@ to confirm.
Comment 1 Zac Medico gentoo-dev 2014-11-23 21:05:35 UTC
I have a patch in this branch:

	https://github.com/zmedico/portage/tree/bug_530222

I'll post it for review after I've added some unit tests.
Comment 2 Zac Medico gentoo-dev 2014-11-27 07:36:14 UTC
I've posted a patch with tests for review here:

	http://thread.gmane.org/gmane.linux.gentoo.portage.devel/4840
Comment 3 Zac Medico gentoo-dev 2014-11-27 08:05:55 UTC
This is in the master branch now:

https://github.com/gentoo/portage/commit/ffbc3416f535752e50a60adfaf0d64486c50a035
Comment 4 Zac Medico gentoo-dev 2014-11-27 08:20:55 UTC
(In reply to Zac Medico from comment #3)
> This is in the master branch now:
> 
> https://github.com/gentoo/portage/commit/
> ffbc3416f535752e50a60adfaf0d64486c50a035

The above commit broke tests strangely somehow, so here it is with fixup:

https://github.com/gentoo/portage/commit/10f991041672f36b05a42752c81ffc6ede0c3326
Comment 5 Zac Medico gentoo-dev 2014-11-27 08:51:54 UTC
Here's the final version which uses filter(None, self.make_defaults_use) to fix the previously mentioned test failure:

https://github.com/gentoo/portage/commit/b9c06a6a2dd4ccc875f8b9dd3139ea582e1e5621
Comment 6 Brian Dolbec gentoo-dev 2014-12-04 05:36:49 UTC
This is in the portage-2.2.15 release.
Comment 7 Zac Medico gentoo-dev 2015-03-04 22:26:35 UTC
*** Bug 351591 has been marked as a duplicate of this bug. ***