a variable is set in /etc/profile.env, say 'AMANDA_CONFIG_NAME=xyz'. now in the emerge enviroment 'export AMANDA_CONFIG_NAME=foobar' 'emerge package' inside the package, AMANDA_CONFIG_NAME is xyz and not foobar. Reproducible: Always Steps to Reproduce: 'emerge amanda' then see bug 51370, comment #7. Expected Results: local environment should override /etc/profile.env Portage 2.0.50-r6 (default-x86-1.4, gcc-3.3.3, glibc-2.3.3_pre20040207-r0, 2.4.22-pre10-ac1) ================================================================= System uname: 2.4.22-pre10-ac1 i686 Intel(R) Xeon(TM) CPU 2.66GHz Gentoo Base System version 1.4.9 distcc 2.13 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled] ccache version 2.3 [enabled] Autoconf: sys-devel/autoconf-2.59-r3 Automake: sys-devel/automake-1.7.8 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CFLAGS="-O3 -march=pentium3 -funroll-loops -fprefetch-loop-arrays -pipe" CHOST="i686-pc-linux-gnu" COMPILER="gcc3" CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3/s hare/config /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/ dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/c onfig/ /usr/share/texmf/xdvi/ /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O3 -march=pentium3 -funroll-loops -fprefetch-loop-arrays -pipe" DISTDIR="/export/mirror/gentoo/distfiles" FEATURES="autoaddcvs buildpkg ccache distcc sandbox" GENTOO_MIRRORS="http://adelie.polymtl.ca/ ftp://cs.ubishops.ca/pub/gentoo ftp://ftp.ussg.iu.edu/pub/linux/gentoo" MAKEOPTS="-j5" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://yamato.iat.sfu.ca/gentoo-portage" USE="aalib acl acpi apache2 cdr cjk crypt curl doc dvd gdbm ipv6 kerberos ldap libwww mmx pam perl readline samba sasl slang slp snmp sse ssl tcpd usb x86 xfs xml xml2 zlib"
as a further note, older versions of portage do this correctly, as the app-admin/amanda package used to rely on it and work perfectly when I originally wrote it.
*** This bug has been marked as a duplicate of 51095 ***
Jason: they are not the same! the changes listed under that bug only provide a special environment for portage. i want emerge to use the environment present when it is run, which is NOT the same as the contents as profile*, .bashrc, et al, as I've set environment variables locally. the closest thing is the mention of 'It should go after CC/CXX are saved and restored from sourcing profile.env, because the admin may wish to override CC for a particular package in /etc/portage/bashrc.' I want practially all variables to have the same behavior as CC/CXX.
That's not easy in the least... Although it semi-reasonable...
carpaski: i don't see it as that difficult at all. at the very start of emerge, it should capture the enviroment in place. 1. printenv > tmpfile (this needs to be done as early as possible) 2. source /etc/profile, /etc/portage/bashrc etc. 3. remove all special items from tmpfile (just use egrep -v) 4. eval `cat tmpfile` 5. you may want to save this environment now so it can be re-used faster instead of re-doing the above.
Robin: Apologies. The bugs are definately related though.
any progress on this?
*bump*
*bump back* Nick, the daemon fixes this (fyi)...
Just testing again, this seems to work as of 2.0.51.22-r1
Erm, not really fixed.
*** This bug has been marked as a duplicate of 51370 ***