First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 51370
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Portage team <dev-portage@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Russell Adams <rladams@kelsey-seybold.com>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 51370 depends on: 56408 Show dependency tree
Show dependency graph
Bug 51370 blocks: 136244
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)







View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2004-05-18 02:28 0000
I'm uncertain why AMANDA_SERVER, AMANDA_SERVER_TAPE, and AMANDA_SERVER_INDEX
aren't honored in the ebuild. There's a large configuration section that should
catch these, however when the compile occurs its using defaults.

I'm doing:

AMANDA_SERVER=localhost emerge amanda

which ought to be sufficient.

I've ended up directly modifying the options passed to configure in the ebuild.

Russell

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

------- Comment #1 From Sven Wegener 2004-05-18 03:49:32 0000 -------
which version of amanda? please supply the output of emerge --info as requested

i've had several times that passing env vars this way, the env vars won't
be recognized by the ebuild. what happens when you do:

export AMANDA_SERVER=localhost
emerge amanda

------- Comment #2 From Russell Adams 2004-05-18 05:24:44 0000 -------
emerge --info:

keroberos root # emerge --info
Portage 2.0.50-r6 (default-x86-2004.0, gcc-3.3.2, glibc-2.3.2-r9, 2.4.26)
=================================================================
System uname: 2.4.26 i686 Intel(R) Celeron(R) CPU 1.70GHz
Gentoo Base System version 1.4.10
Autoconf: sys-devel/autoconf-2.58-r1
Automake: sys-devel/automake-1.8.3
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -mcpu=pentium4 -march=pentium4 -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -mcpu=pentium4 -march=pentium4 -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox"
GENTOO_MIRRORS="ftp://cudlug.cudenver.edu/pub/mirrors/distributions/gentoo/ http://128.213.5.34/gentoo/ http://ftp-mirror.internap.com/pub/gentoo/ ftp://ftp.ussg.iu.edu/pub/linux/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X apm arts avi berkdb cdr crypt encode esd foomaticdb gdbm gif gnome gpm gtk gtk2 imlib jpeg kde libg++ libwww mad mikmod motif mpeg ncurses nls oggvorbis opengl oss pam pdflib perl png python qt quicktime readline sdl slang spell ssl svga tcpd truetype x86 xml2 xmms xv zlib"


Yes, I tried the export route. I also tried to modify the ebuild to change the defaults in the configuration section.

The amanda_variable_setup() routine is called in all the ebuild functions EXCEPT the compile function (which is where its really needed...). Simply adding it in didn't help though.

However, I'm concerned that the environment variables aren't reaching the ebuild... I added debugging lines to print the variables passed to  amanda_variable_setup() and its always using the defaults, as if the environment vars didn't exist. Next up I tried using USE=debug to trigger some of the informational einfo calls in the ebuild, that didn't work either.

Is there something hosing the environment here?

------- Comment #3 From Russell Adams 2004-05-18 05:25:35 0000 -------
Ack, sorry. I'm using amanda-2.4.4-r3.ebuild.

------- Comment #4 From Sven Wegener 2004-05-18 08:30:30 0000 -------
ok, seems like this error is triggered when amanda has already been
installed and has placed it's settings in /etc/env.d/97amanda. these
settings are placed in /etc/profile.env by env-update. the ebuild
command sources these settings and will override settings you specifiy
via command line.

you can delete /etc/env.d/97amanda and run "env-update && source /etc/profile"
afterwards to get rid of these settings. or edit the settings in
/etc/env.d/97amanda to fit your needs and then run the above command.

------- Comment #5 From Russell Adams 2004-05-18 18:19:58 0000 -------
You're most likely 100% correct.

I had installed it first with defaults, having forgotten to specify "localhost" for my AMANDA_SERVER. I think that ought to be default anyway. ;] At least, that was the default in the amanda ebuild I created ages ago.

Nevermind, and thanks for the assistance. I was worried there for a bit. =]

Russell

------- Comment #6 From Robin Johnson 2004-05-19 23:36:46 0000 -------
the behavior of the ebuild is definetly correct, however it _is_ affected by
how portage caches the environment.
if you do:
'USE=debug AMANDA_SERVER=test1 emerge amanda' then cancel it after it's about
to unpack, it will have those environment variables cached.
then if you do 'emerge amanda' again, it will use those environment variables.

if you do happen into this, just remove the amanda build dir,
/var/tmp/portage/amanda* and run emerge again with your new env vars and they
will override the ones in /etc/env.d/97amanda.

I went to a lot of effort to make sure the environment stuff worked correctly.
the behavior of amanda_variable_setup is as such:
1. make a backup of current env
2. read in the defaults from the ebuild
3. read in your existing env file if any
4. apply the backup of the current env

this process takes some time, so in src_unpack, once it's safe to write files,
i make a cache file of my own, and write the final data out to it, and then i
source that file in the rest of the ebuild instead of using
amanda_variable_setup.

The entire reason I invented the crazy enviroment variable system for amanda
was so that I could install a full server farm with the minimum of effort,
while still being customizable.

------- Comment #7 From Sven Wegener 2004-05-20 03:50:11 0000 -------
> the behavior of amanda_variable_setup is as such:
> 1. make a backup of current env
> 2. read in the defaults from the ebuild
> 3. read in your existing env file if any
> 4. apply the backup of the current env

Robin, what I wanted to say in comment 4 is that I see one problem
for this. As I said, the ebuild command (run directly or via emerge)
will set up the environment for building. And this includes sourcing
/etc/profile which sources /etc/profile.env and this includes the
contents of /etc/env.d/97amanda. So when I specify AMANDA_SERVER in my
environment before I call emerge/ebuild the variable will get overwritten
when emerge/ebuild sets up the build environment. When you do a backup
of the current environment in your ebuild, you'll backup the settings
from /etc/env.d/97amanda. The user has no possibility of specifiying new
values via command line. He has to edit /etc/env.d/97amanda.

I modified the ebuild to print out the variable AMANDA_SERVER when it is
sourced, I put it not in any function. AMANDA_SERVER is set to localhost
in /etc/env.d/97amanda. Here's the result:


mrx-nb root # ebuild /usr/portage/app-admin/amanda/amanda-2.4.4-r3.ebuild unpack
>>> md5 src_uri ;-) amanda-2.4.4.tar.gz
AMANDA_SERVER=localhost
berkdb
AMANDA_SERVER=localhost
>>> Unpacking source...
>>> Unpacking amanda-2.4.4.tar.gz to /var/tmp/portage/amanda-2.4.4-r3/work
>>> Source unpacked.
mrx-nb root # rm -r /var/tmp/portage/amanda-2.4.4-r3/
mrx-nb root # export AMANDA_SERVER=mrx-nb
mrx-nb root # ebuild /usr/portage/app-admin/amanda/amanda-2.4.4-r3.ebuild unpack
>>> md5 src_uri ;-) amanda-2.4.4.tar.gz
AMANDA_SERVER=localhost
berkdb
AMANDA_SERVER=localhost
>>> Unpacking source...
>>> Unpacking amanda-2.4.4.tar.gz to /var/tmp/portage/amanda-2.4.4-r3/work
>>> Source unpacked.


maybe portage should provide the ebuilds with some function to store
values between emerges, so that the ebuild don't use /etc/env.d which
is really bad because these ones are global and we'll end up with a lot of
variables in the user's environment. I'm thinking of something like I
proposed in bug 51061 but modifyable by ebuilds.

Comments?

------- Comment #8 From Robin Johnson 2004-05-20 04:35:20 0000 -------
i've filed bug #51552, in your further testing there (i've reproduced it now
too), i see that the behavior of portage has changed since I wrote the amanda
ebuilds originally.

thanks.

------- Comment #9 From Robin Johnson 2005-06-08 13:08:41 0000 -------
fixed in portage now.

------- Comment #10 From Simon Stelling (RETIRED) 2006-05-02 02:34:55 0000 -------
apparently not

------- Comment #11 From Simon Stelling (RETIRED) 2006-05-02 02:35:01 0000 -------
*** Bug 130229 has been marked as a duplicate of this bug. ***

------- Comment #12 From Jakub Moc 2006-05-02 02:45:02 0000 -------
*** Bug 123563 has been marked as a duplicate of this bug. ***

------- Comment #13 From Jakub Moc 2006-05-02 02:46:56 0000 -------
*** Bug 131920 has been marked as a duplicate of this bug. ***

------- Comment #14 From Jakub Moc 2006-05-02 02:57:11 0000 -------
*** Bug 51552 has been marked as a duplicate of this bug. ***

------- Comment #15 From Alec Warner 2006-05-25 21:01:36 0000 -------
*** Bug 128420 has been marked as a duplicate of this bug. ***

------- Comment #16 From Jakub Moc 2006-07-29 04:44:46 0000 -------
*** Bug 142076 has been marked as a duplicate of this bug. ***

------- Comment #17 From Zac Medico 2006-07-29 07:27:49 0000 -------
Why don't we just stack profile.env inside portage.config, since we already to
environment stacking there anyway?  Here's the current stacking order:

globals
defaults
conf
pkg
auto
backupenv
env

How about if we slide it in between auto and backupenv?

------- Comment #18 From Zac Medico 2006-07-29 11:21:49 0000 -------
This is fixed in svn r4048.

------- Comment #19 From Zac Medico 2006-07-30 16:59:34 0000 -------
This has been released in 2.1.1_pre4-r1.

First Last Prev Next    No search results available      Search page      Enter new bug