Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 51552 - /etc/profile.env vars override local enviroment variables
Summary: /etc/profile.env vars override local enviroment variables
Status: RESOLVED DUPLICATE of bug 51370
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-20 04:33 UTC by Robin Johnson
Modified: 2006-05-02 02:57 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-05-20 04:33:03 UTC
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"
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-05-20 04:34:27 UTC
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.
Comment 2 Jason Stubbs (RETIRED) gentoo-dev 2004-05-20 04:37:36 UTC

*** This bug has been marked as a duplicate of 51095 ***
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-05-20 10:27:19 UTC
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.
Comment 4 Nicholas Jones (RETIRED) gentoo-dev 2004-05-20 12:14:02 UTC
That's not easy in the least... Although it semi-reasonable...
Comment 5 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-05-20 13:16:37 UTC
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.
Comment 6 Jason Stubbs (RETIRED) gentoo-dev 2004-05-20 18:24:14 UTC
Robin: Apologies. The bugs are definately related though.
Comment 7 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-06-11 16:07:14 UTC
any progress on this?
Comment 8 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-08-30 13:49:20 UTC
*bump*
Comment 9 Brian Harring (RETIRED) gentoo-dev 2004-08-30 14:23:51 UTC
*bump back*
Nick, the daemon fixes this (fyi)...
Comment 10 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2005-06-08 13:08:28 UTC
Just testing again, this seems to work as of 2.0.51.22-r1
Comment 11 Jakub Moc (RETIRED) gentoo-dev 2006-05-02 02:56:18 UTC
Erm, not really fixed.
Comment 12 Jakub Moc (RETIRED) gentoo-dev 2006-05-02 02:57:11 UTC

*** This bug has been marked as a duplicate of 51370 ***