Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 99760 - method for packages to customize portage settings
Summary: method for packages to customize portage settings
Status: RESOLVED WORKSFORME
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Configuration (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-21 00:43 UTC by Robin Johnson
Modified: 2007-06-06 00:53 UTC (History)
1 user (show)

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 2005-07-21 00:43:02 UTC
doing "ssh MACHINE emerge info"
has different output from manually ssh'ing to MACHINE, and running 'emerge 
info'.

It seems that /etc/profile.env is not loaded in the non-interactive ssh case 
anymore. (I'm pretty certain it used to be).

This breaks some emerges where the CONFIG_PROTECT settings 
from /etc/profile.env are not loaded, and emerge then wipes out stuff that 
would be protected otherwise.


Reproducible: Always
Steps to Reproduce:
1.
2.
3.



Expected Results:  
portage should ensure that profile.env (And possibly profile) are loaded.
strangely putting 'source /etc/profile.env' inside /etc/portage/bashrc didn't 
seem to help either.


head ~ # ssh node009 emerge info
Gentoo Base System version 1.12.0_pre1
Portage 2.0.51.22-r2 (default-linux/x86/2005.0, gcc-3.4.4, glibc-2.3.5-r0, 
2.6.12-gentoo-r4 i686)
=================================================================
System uname: 2.6.12-gentoo-r4 i686 Intel(R) Pentium(R) 4 CPU 3.00GHz
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) 
[disabled]
ccache version 2.4 [enabled]
dev-lang/python:     2.3.4-r1, 2.4.1-r1
sys-apps/sandbox:    1.2.11
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.18-r1
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=pentium4 -O2 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/
config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-march=pentium4 -O2 -pipe"
DISTDIR="/mnt/distfiles"
FEATURES="autoaddcvs autoconfig buildpkg ccache distlocks sandbox sfperms"
GENTOO_MIRRORS="http://distfiles.gentoo.org 
http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j4"
PKGDIR="/mnt/packages/node/nodebug"
PORTAGE_TMPDIR="/scratch/gentoo-portage-tmp"
PORTDIR="/usr/portage"
SYNC="rsync://mirror.iat.sfu.ca/gentoo-portage"
USE="x86 aalib acl alsa berkdb crypt cscope erandom f77 fam floppyboot fortran 
gcj gdbm hpn ipv6 java jikes jpeg kerberos krb5 ldap libwww mmx ncurses netboot 
objc pam pbs pcap perl pic png python quota quotas readline rpc sasl slang slp 
snmp spell sse ssh ssl tcpd urandom userlocales xfs xml xml2 zlib userland_GNU 
kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY

head ~ # ssh node009
Last login: Thu Jul 21 00:09:32 2005 from head
node009 ~ # emerge info
Portage 2.0.51.22-r2 (default-linux/x86/2005.0, gcc-3.4.4, glibc-2.3.5-r0, 
2.6.12-gentoo-r4 i686)
=================================================================
System uname: 2.6.12-gentoo-r4 i686 Intel(R) Pentium(R) 4 CPU 3.00GHz
Gentoo Base System version 1.12.0_pre1
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) 
[disabled]
ccache version 2.4 [enabled]
dev-lang/python:     2.3.4-r1, 2.4.1-r1
sys-apps/sandbox:    1.2.11
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.18-r1
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=pentium4 -O2 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/
config /usr/spool/PBS /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=pentium4 -O2 -pipe"
DISTDIR="/mnt/distfiles"
FEATURES="autoaddcvs autoconfig buildpkg ccache distlocks sandbox sfperms"
GENTOO_MIRRORS="http://distfiles.gentoo.org 
http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j4"
PKGDIR="/mnt/packages/node/nodebug"
PORTAGE_TMPDIR="/scratch/gentoo-portage-tmp"
PORTDIR="/usr/portage"
SYNC="rsync://mirror.iat.sfu.ca/gentoo-portage"
USE="x86 aalib acl alsa berkdb crypt cscope erandom f77 fam floppyboot fortran 
gcj gdbm hpn ipv6 java jikes jpeg kerberos krb5 ldap libwww mmx ncurses netboot 
objc pam pbs pcap perl pic png python quota quotas readline rpc sasl slang slp 
snmp spell sse ssh ssl tcpd urandom userlocales xfs xml xml2 zlib userland_GNU 
kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
Comment 1 Alec Warner (RETIRED) archtester gentoo-dev Security 2005-07-29 17:31:15 UTC
This points more to the fact that CONFIG_PROTECT and it's cousins probably 
shouldn't be stored in the ENV, but should be put elsewhere.

kyoto portage # cat bashrc
echo $EBUILD_PHASE
PATH=/usr/bin:/bin/
. /etc/profile.env
echo $CONFIG_PROTECT

kyoto portage # CONFIG_PROTECT="-*" emerge bash   
Calculating dependencies ...done!
>>> emerge (1 of 1) app-shells/bash-3.0-r12 to /
clean
/usr/lib/X11/xkb /usr/kde/3.4/share/config /usr/kde/3.4/env /usr/kde/3.4/
shutdown /usr/kde/3.3/share/config /usr/kde/3.3/env /usr/kde/3.3/shutdown /usr/
share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/
texmf/dvips/config/ /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/xdvi/ /
usr/share/config
....

Putting . /etc/profile.env in your /etc/portage/bashrc should work for you if 
you don't do command line CONFIG_PROTECT things.  Otherwise the command line 
CONFIG_PROTECT gets quashed by the many sourcings of /etc/profile.env that the 
bashrc will do.

I would suggest looking at your ssh configuration as well.  The point is valid ( 
user uses a different shell or has a weird ENV portage should take notice ).  
However I think your ssh settings can take care of this in your case.

As for this working in an older version, what version did you first notice the 
problem?  I'll dive into the CVS logs to see if I can find the commit that broke 
it and attempt to get it fixed.

Note that it could also be that this was always broken and your ssh 
configuration changed.  Please check that as well.
Comment 2 SpanKY gentoo-dev 2005-07-29 17:58:52 UTC
yeah, i agree CONFIG_PROTECT / CONFIG_PROTECT_MASK in the env is wrong
Comment 3 Jason Stubbs (RETIRED) gentoo-dev 2005-07-29 18:37:53 UTC
While I also agree that it's wrong, somewhere along the line it was decided to 
be a good thing. Now there's several packages that depend on it, so... How 
about sourcing /etc/env.d and inserting the result after make.conf but before 
the real env? 
Comment 4 Marius Mauch (RETIRED) gentoo-dev 2007-06-06 00:26:22 UTC
Is this still an issue? (seems to work fine here)
Comment 5 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2007-06-06 00:53:38 UTC
yeah it seems to have gone away with newer baselaoyuts.