Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 280653 - emerge --config ignores current environment variables
Summary: emerge --config ignores current environment variables
Status: CONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Configuration (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on: 189417
Blocks:
  Show dependency tree
 
Reported: 2009-08-07 13:03 UTC by Filip Jirsák
Modified: 2009-08-07 18:35 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
testing ebuild (test-1.ebuild,262 bytes, text/plain)
2009-08-07 13:05 UTC, Filip Jirsák
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Jirsák 2009-08-07 13:03:22 UTC
emerge --config uses environment stored in /var/db/pkg/*/*/environment.bz2 which overwrites environment variables in current environment or passed by command line.

Reproducible: Always

Steps to Reproduce:
1. emerge app-misc/test
2. TEST="test1" emerge --config app-misc/test
3. TEST="test2" emerge app-misc/test
4. TEST="test3" emerge --config app-misc/test


Actual Results:  
*
* test2

Expected Results:  
* test1
* test3
Comment 1 Filip Jirsák 2009-08-07 13:05:39 UTC
Created attachment 200495 [details]
testing ebuild

Testing ebuild. You can save it as app-misc/test into overlay.
Comment 2 Petr Polezhaev 2009-08-07 14:48:14 UTC
This is not a bug, this is feature. Actually emerge --config even not uses ebuild itself, as it could be removed from tree already (or only newer versions availibile, with probably changed pkg_config), so it uses functions from environment.bz2 (and environment also).

Actually, it should use exactly same environment as that it was installed in, just becouse there could be some variables that vital to the compilation/configuration process, and changing them at real-time could result in emerge --config's wrong actions.

Use 'read' build-in bash function instead. If you want to automatise configuration process, you can always supply arguments with echo via pipe, in such case, like echo -e "aaaa\nbbbb\n" | emerge --config =foo/bar-1. See mysql ebuild/eclass as example.
Comment 3 Zac Medico gentoo-dev 2009-08-07 18:35:44 UTC
Comment #2 is correct. Specifically, the environment needs to be isolated for cases like bug #189417. For ebuilds that require modification of variables for emerge --config, it's possible to use /etc/portage/bashrc to set those variables.