I have a definition of GREP_OPTIONS variable in /etc/env.d/99my_env file which is used to set some system-wide environment variables. Variable definition looks like: GREP_OPTIONS="--color=auto --exclude-dir=.svn --exclude-dir=CVS --exclude-dir=.git" As u may notice it contains spaces as options seperator. As found in env.eselect module such definition should be handled as non-cummultative (despite it is not quite correct, it doesn't matter in my case because there is the only point of definition of this variable). But after `eselect env update` I've got incorrect /etc/profile.env file (which is leads to a lot of errors during command execution). profile.env contains the following lines: export GREP_OPTIONS='--color=auto --exclude-dir=.svn --exclude-dir=CVS --exclude-dir=.git' export --exclude-dir='' export --exclude-dir='' export --exclude-dir='' [last line repeated many times] Reproducible: Always Steps to Reproduce: 1. add /etc/env.d/99my_env which contains the only line: GREP_OPTIONS='--color=auto --exclude-dir=.svn --exclude-dir=CVS --exclude-dir=.git' 2. do `eselect env update` Actual Results: incorrect /etc/profile.env which contains illegal definitions: export GREP_OPTIONS='--color=auto --exclude-dir=.svn --exclude-dir=CVS --exclude-dir=.git' export --exclude-dir='' export --exclude-dir='' export --exclude-dir='' [last line repeated many times] Expected Results: definition of GREP_OPTIONS expected to be like: export GREP_OPTIONS='--color=auto --exclude-dir=.svn --exclude-dir=CVS --exclude-dir=.git'
Please post your `emerge --info' too.
(In reply to comment #1) > Please post your `emerge --info' too. > Portage 2.1.6.7 (default/linux/amd64/2008.0/desktop, gcc-4.3.3, glibc-2.9_p20081201-r1, 2.6.28-gentoo-r1 x86_64) ================================================================= System uname: Linux-2.6.28-gentoo-r1-x86_64-Intel-R-_Core-TM-2_Quad_CPU_@_2.40GHz-with-glibc2.2.5 Timestamp of tree: Wed, 04 Feb 2009 06:30:01 +0000 ccache version 2.4 [disabled] app-shells/bash: 3.2_p48 dev-java/java-config: 1.3.7-r1, 2.1.7 dev-lang/python: 2.4.4-r15, 2.5.4-r2 dev-util/ccache: 2.4-r8 dev-util/cmake: 2.6.2-r1 sys-apps/baselayout: 2.0.0 sys-apps/openrc: 0.4.2 sys-apps/sandbox: 1.3.3 sys-devel/autoconf: 2.13, 2.63 sys-devel/automake: 1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2 sys-devel/binutils: 2.19 sys-devel/gcc-config: 1.4.1 sys-devel/libtool: 2.2.6a virtual/os-headers: 2.6.28-r1 ACCEPT_KEYWORDS="amd64 ~amd64" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=native -O2 -pipe -minline-stringops-dynamically -ftree-vectorize -falign-jumps=64 -falign-functions=64" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/kde/4.2/env /usr/kde/4.2/share/config /usr/kde/4.2/shutdown /usr/share/config" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d" CXXFLAGS="-march=native -O2 -pipe -minline-stringops-dynamically -ftree-vectorize -falign-jumps=64 -falign-functions=64" DISTDIR="/storage/soft/gentoo/distfiles" FEATURES="distlocks fixpackages nostrip nouserpriv parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch" GENTOO_MIRRORS="http://ftp.linux.ee/pub/gentoo/distfiles/ http://distro.ibiblio.org/pub/linux/distributions/gentoo/" INSTALL_MASK="*/usr/share/*/AUTHORS* */usr/share/*/ABOUT-NLS* */usr/share/*/CREDITS* */usr/share/*/COPYING* */usr/share/*/TODO* */usr/share/*/THANKS* */usr/share/*/NEW* */usr/share/*/INSTALL* */usr/share/*/ACKNOWLEDGEMENTS* */usr/share/*/LICENSE* */usr/share/*/LGPL* */usr/share/*/MANIFEST* */usr/share/*/ChangeLog* */usr/share/*/HISTORY* */usr/share/*/VERSION* */usr/share/*/MAINTAINER*" LANG="en_US.UTF-8" LDFLAGS="-Wl,-O1" LINGUAS="" MAKEOPTS="-j4" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/storage/tmp/portage" PORTDIR="/usr/portage" PORTDIR_OVERLAY=" " SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="3dnow 3dnowext X a52 aac acpi alsa amd64 apache2 bash-completion berkdb bluetooth boost branding bzip2 cairo cdr cli cracklib crypt ctype cups curl dbus dga dri dvd dvdnav dvdr dvdread eds emboss encode evo exif expat fam ffmpeg fftw firefox flac fontconfig ftp gd gdbm gif gphoto2 gpm graphviz gtk2 hal iconv icq id3 id3tag idn imagemagick imap imlib innodb ipv4 isdnlog ithreads jabber jingle jpeg kde latex ldap libnotify libwww lm_sensors logitech-mouse mad midi mikmod mmap mmx mmxext mp3 mpeg mudflap multilib musicbrainz mysql mysqli ncurses network-cron nptl nptlonly ogg openexr opengl openmp oscar pam pcntl pcre pdf perl php png posix ppds pppd python qt3 qt3support qt4 quicktime readline reflection samba session slang slp sockets speex spell spl sqlite sqlite3 sse sse2 ssl ssse3 startup-notification subversion svg sysfs syslog tcpd tetex theora threads tidy truetype unicode usb vhosts vorbis xcomposite xface xine xinerama xml xmlrpc xorg xscreensaver xsl xulrunner xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_alias authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status substitute unique_id userdir usertrack vhost_alias" APACHE2_MPMS="worker" CAMERAS="canon ptp2" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="nvidia vesa" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Please attach 99my_env to this bug.
Created attachment 181193 [details] buggy env file put it into /etc/env.d
It's an issue with 'for line in ${content[@]}' in store_config() in libs/config.bash. It iterates over every word in the generated profile.env and treats every word containing an = sign as a variable assignment. The easiest solution is to surround that for loop with IFS=$'\n'. The simplest way to reproduce is a foo=" --blah= " entry followed by any further entries.
also I suppose it will be nice to user to have a configuration file with lists of SPACE_CLASS and PATH_CLASS variables (somewhere in /etc/env.d/env/env.conf for example). So user may modify this lists to add his variables into it (to give a hint to env.eselect how to manage user defined variables). So, in my case, I would like to add GREP_OPTIONS into list of SPACE_CLASS variables.
*** This bug has been marked as a duplicate of bug 219864 ***