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
Created attachment 200495 [details] testing ebuild Testing ebuild. You can save it as app-misc/test into overlay.
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 #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.