Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Dashes in environment variable causing portage builds to fai
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
digler99
n00b
n00b


Joined: 01 Dec 2007
Posts: 16

PostPosted: Mon Dec 03, 2007 6:39 am    Post subject: Dashes in environment variable causing portage builds to fai Reply with quote

I finally figured out why portage quit letting me do updates, because variables in my environment have dashes in them. Here are some examples:

Code:
cirrus etc # printenv |grep \-
MenuPosition-Below=mouse o100+50m 15p
Colorset-Author=Social
MANPATH=/etc/java-config-2/current-system-vm/man:/usr/local/share/man:/usr/share/man:/usr/share/binutils-data/i686-pc-linux-gnu/2.18/man:/usr/share/gcc-data/i686-pc-linux-gnu/4.1.2/man:${MANPATH}:/opt/blackdown-jre-1.4.2.03/man:/etc/java-config/system-vm/man/:/usr/kde/3.5/share/man:/usr/qt/3/doc/man:/opt/vmware/workstation/man
EWMH-BS-Panel-Bottom=3
EWMH-BS-Desktop-Left=3
FvwmPager-Height=48
FVWM_USERDIR=/home/digler/.fvwm-crystal
MenuPosition-ES=Rectangle $widthx$height+$left+$top@c 100 0
Desk-Pages-Y=2
cs-panel-active=2
MenuPosition-WN=Rectangle $widthx$height+$left+$top@c -100m o100
Desk-Pages-X=8
Icon-Theme=Default


So the build errors out because variables like EWMH-BS-Desktop are interpreted as commands instead of variables, it says "command not found" when it copies `printenv`>/var/tmp/portage....

So how did this happen ? I can't remember if it used to let me do statements like var-with-a-dash=4 or not...Now when I do it, it says command not found, in bash or csh. These vars are from the window manager, I didn't personally break it, all I did was try to emerge compiz, so it forward-updated some packages. What do I do ?
Back to top
View user's profile Send private message
xbmodder
Guru
Guru


Joined: 25 Feb 2004
Posts: 404

PostPosted: Mon Dec 03, 2007 8:28 am    Post subject: Reply with quote

Did you think of filing a bug report?
_________________
http://xbmodder.us/
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9632
Location: beyond the rim

PostPosted: Mon Dec 03, 2007 9:15 am    Post subject: Reply with quote

dashes aren't legal characters in variable names in bash.
Back to top
View user's profile Send private message
digler99
n00b
n00b


Joined: 01 Dec 2007
Posts: 16

PostPosted: Thu Dec 06, 2007 6:53 am    Post subject: Reply with quote

I don't want to file a bug report because it could very well be something I did. I'm somewhere between a newbie and an intermediate, know enough to break it, but not enough to fix it.

Is there an easy way to find out what my last successful emerge was ? I think equery returns them in alphabetical order, maybe I'll RTFM on equery and see if theres an option to see what the last successful emerge was, and find out "whodunnit" ?
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9632
Location: beyond the rim

PostPosted: Fri Dec 07, 2007 1:56 am    Post subject: Reply with quote

digler99 wrote:
I don't want to file a bug report because it could very well be something I did.

As I said, it's not a bug, your variable names are simply invalid in bash (don't know what shell you're using)

Quote:
Is there an easy way to find out what my last successful emerge was ?

genlop, qlop or read /var/log/emerge.log manually.
Back to top
View user's profile Send private message
digler99
n00b
n00b


Joined: 01 Dec 2007
Posts: 16

PostPosted: Fri Dec 07, 2007 5:31 am    Post subject: Reply with quote

Thanks for the info about qlop. the last successful package was alsa-lib, (going backwards) cracklib, corefonts, ... I don't think they were what jacked up the environment variables. I'm feeling confident this is an fvwm-crystal or fvwm update. What probably happened is the change happened way earlier and the environment didn't get updated till I rebooted. (I know about env-update, but maybe the actual fvwm binary file sets env. vars. is that possible/customary ?) I just need to figure out how it's writing those variables and comment them out (and submit the bug report). /etc/profile didn't have anything.
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9632
Location: beyond the rim

PostPosted: Fri Dec 07, 2007 2:20 pm    Post subject: Reply with quote

Well, do they still exist after a reboot/when you login at a different terminal? To me it looks like you've somehow sourced a config file in your shell. Anyway, might try
Code:
grep -r MenuPosition-Below /etc ~

to find out where it's set.
Back to top
View user's profile Send private message
digler99
n00b
n00b


Joined: 01 Dec 2007
Posts: 16

PostPosted: Sat Dec 15, 2007 1:40 am    Post subject: Reply with quote

thanks Genome. I did the grep, and got 2 hits:

Code:
Binary file /etc/java-config-2/current-system-vm/lib/i386/libXm.so.3 matches
Binary file /etc/java-config-2/current-system-vm/lib/i386/libawt.so matches


what I think I'm going to do is RTFM on 'export/declare' and find out how to unregister those env. variables, then I'm going to emerge -pvuD world to downgrade me back to the latest stable version (recall I updated these to unstable packages to try to get compiz to work) and see what it does. Thanks for your help, let me know if you have any more suggestions.

Just for chutes and giggles here's the total output from `export`:

( sorry I dont know how to put these in a dialog box for cleanliness :(
Code:
declare -x ApplicationPanelLength="5"
declare -x CLASSPATH="."
declare -x COLORFGBG="15;0"
declare -x COLORTERM="rxvt-xpm"
declare -x CONFIG_PROTECT="/usr/lib/X11/xkb /usr/kde/3.5/share/config /usr/kde/3.5/env /usr/kde/3.5/shutdown /usr/share/config /usr/kde/3.4/share/config /usr/kde/3.4/env /usr/kde/3.4/shutdown"
declare -x CONFIG_PROTECT_MASK="/etc/env.d/java/ /etc/udev/rules.d /etc/fonts/fonts.conf /etc/gconf /etc/terminfo /etc/revdep-rebuild"
declare -x CVS_RSH="ssh"
declare -x Colorset-Author="Social"
declare -x Colorset-Name="WhiteDesktop"
declare -x Colorsets_Suffix=".cs"
declare -x DBUS_SESSION_BUS_ADDRESS="unix:abstract=/tmp/dbus-oCmi9TOQ5M,guid=7dedf06f818ee11f8ae1cb0047631b1d"
declare -x DCCC_PATH="/usr/lib/distcc/bin"
declare -x DESKTOP_SESSION="fvwm-crystal"
declare -x DISPLAY=":0.0"
declare -x DISPLAYMANAGER="gdm"
declare -x DISTCC_LOG=""
declare -x DISTCC_VERBOSE="0"
declare -x DefaultTerminal="aterm"
declare -x Desk-Pages-X="8"
declare -x Desk-Pages-Y="2"
declare -x EDITOR="/bin/nano"
declare -x EWMH-BS-Desktop-Bottom="3"
declare -x EWMH-BS-Desktop-Left="3"
declare -x EWMH-BS-Desktop-Right="3"
declare -x EWMH-BS-Desktop-Top="3"
declare -x EWMH-BS-Panel-Bottom="3"
declare -x EWMH-BS-Panel-Left="3"
declare -x EWMH-BS-Panel-Right="3"
declare -x EWMH-BS-Panel-Top="30"
declare -x ExternalFontColor="gray40"
declare -x FLTK_DOCDIR="/usr/share/doc/fltk-1.1.7-r2/html"
declare -x FVWM_CONFIGDIR="/etc/X11/fvwm/fvwm-crystal"
declare -x FVWM_DISTROMENUDIR="/var/lib/fvwm-crystal"
declare -x FVWM_DISTROMENUNAME="debian"
declare -x FVWM_MODULEDIR="/usr/lib/fvwm/2.5.18"
declare -x FVWM_SYSTEMDIR="/usr/bin/../share/fvwm-crystal/fvwm"
declare -x FVWM_USERDIR="/home/digler/.fvwm-crystal"
declare -x FvwmConsoleTerminal="xterm"
declare -x FvwmPager-Height="48"
declare -x FvwmPager-Width="280"
declare -x GCC_SPECS=""
declare -x GDK_USE_XFT="1"
declare -x GDMSESSION="fvwm-crystal"
declare -x GDM_LANG="C"
declare -x GDM_Query="OK HALT;REBOOT;SUSPEND"
declare -x GDM_XSERVER_LOCATION="local"
declare -x GUILE_LOAD_PATH="/usr/share/guile/1.8"
declare -x HOME="/root"
declare -x HOSTDISPLAY="cirrus:0.0"
declare -x INFOPATH="/usr/share/info:/usr/share/binutils-data/i686-pc-linux-gnu/2.18/info:/usr/share/gcc-data/i686-pc-linux-gnu/4.1.2/info"
declare -x Icon-Theme="Default"
declare -x JAVAC="/etc/java-config-2/current-system-vm/bin/javac"
declare -x JAVA_HOME="/etc/java-config-2/current-system-vm"
declare -x JDK_HOME="/etc/java-config-2/current-system-vm"
declare -x JRE_HOME="/opt/blackdown-jre-1.4.2.03"
declare -x KDEDIRS="/usr:/usr/local:/usr/kde/3.5"
declare -x LANG="C"
declare -x LESS="-R -M --shift 5"
declare -x LESSOPEN="|lesspipe.sh %s"
declare -x LOGNAME="root"
declare -x LS_COLORS="no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.pdf=00;32:*.ps=00;32:*.txt=00;32:*.patch=00;32:*.diff=00;32:*.log=00;32:*.tex=00;32:*.doc=00;32:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:"
declare -x MANPATH="/etc/java-config-2/current-system-vm/man:/usr/local/share/man:/usr/share/man:/usr/share/binutils-data/i686-pc-linux-gnu/2.18/man:/usr/share/gcc-data/i686-pc-linux-gnu/4.1.2/man:\${MANPATH}:/opt/blackdown-jre-1.4.2.03/man:/etc/java-config/system-vm/man/:/usr/kde/3.5/share/man:/usr/qt/3/doc/man:/opt/vmware/workstation/man"
declare -x MenuPosition-Above="mouse o100+50m -100m-5p"
declare -x MenuPosition-AboveLeft="mouse -100m-5p -100m-5p"
declare -x MenuPosition-AboveRight="mouse 15p -100m-5p"
declare -x MenuPosition-Below="mouse o100+50m 15p"
declare -x MenuPosition-BelowLeft="mouse -100m-5p 15p"
declare -x MenuPosition-BelowRight="mouse 15p 15p"
declare -x MenuPosition-E="Rectangle \$widthx\$height+\$left+\$top@c 100 o50"
declare -x MenuPosition-EN="Rectangle \$widthx\$height+\$left+\$top@c 100 o100"
declare -x MenuPosition-ES="Rectangle \$widthx\$height+\$left+\$top@c 100 0"
declare -x MenuPosition-N="Rectangle \$widthx\$height+\$left+\$top@c o50 -100m"
declare -x MenuPosition-NE="Rectangle \$widthx\$height+\$left+\$top@c 0 -100m"
declare -x MenuPosition-NW="Rectangle \$widthx\$height+\$left+\$top@c o100 -100m"
declare -x MenuPosition-S="Rectangle \$widthx\$height+\$left+\$top@c o50 100"
declare -x MenuPosition-SE="Rectangle \$widthx\$height+\$left+\$top@c 0 100"
declare -x MenuPosition-SW="Rectangle \$widthx\$height+\$left+\$top@c o100 100"
declare -x MenuPosition-W="Rectangle \$widthx\$height+\$left+\$top@c -100m o50"
declare -x MenuPosition-WN="Rectangle \$widthx\$height+\$left+\$top@c -100m o100"
declare -x MenuPosition-WS="Rectangle \$widthx\$height+\$left+\$top@c -100m 0"
declare -x Mod="A"
declare -x Mod0="N"
declare -x Mod1="M"
declare -x Mod2="MS"
declare -x MusicPlayer="xmms"
declare -x OLDPWD
declare -x OPENGL_PROFILE="nvidia"
declare -x PAGER="/usr/bin/less"
declare -x PATH="/sbin:/bin:/usr/sbin:/usr/bin"
declare -x PKG_CONFIG_PATH="/usr/qt/3/lib/pkgconfig"
declare -x PWD="/home/digler"
declare -x PYTHONPATH="/usr/lib/portage/pym"
declare -x QMAKESPEC="linux-g++"
declare -x QTDIR="/usr/qt/3"
declare -x QuakeConsole-Border="1"
declare -x QuakeConsole-Height="50"
declare -x QuakeConsoleTerminal="aterm"
declare -x SHELL="/bin/bash"
declare -x SHLVL="2"
declare -x SSH_AGENT_PID="4979"
declare -x SSH_AUTH_SOCK="/tmp/ssh-cxnXHb4950/agent.4950"
declare -x SelectOnReleaseKey="Alt_L"
declare -x TERM="rxvt"
declare -x TERMINFO="/usr/share/terminfo"
declare -x ThumbBorderColor="gray"
declare -x ThumbDirectory="/tmp"
declare -x ThumbHeight="128"
declare -x ThumbQuality="resize"
declare -x ThumbWidth="128"
declare -x TrayerAlpha="128"
declare -x TrayerTint="0xaaaaaa"
declare -x USER="root"
declare -x USERNAME="digler"
declare -x VMWARE="/opt/vmware/workstation/bin/vmware"
declare -x WINDOWID="35651589"
declare -x WINDOWPATH="7"
declare -x WallpaperThumbnails="/home/digler/.fvwm-crystal/wallpaper-thumbnails"
declare -x Window-Decorations_ButtonModel="Theme.fvwm-crystal"
declare -x XAUTHORITY="/root/.xauthUCHcJZ"
declare -x XDG_DATA_DIRS="/usr/share:/usr/kde/3.5/share:/usr/local/share"
declare -x XINITRC="/etc/X11/xinit/xinitrc"
declare -x XMMS-Playlists="/home/digler/.fvwm/xmms-playlists"
declare -x cs-menu-active="7"
declare -x cs-menu-inactive="6"
declare -x cs-panel-active="2"
declare -x cs-panel-border="5"
declare -x cs-panel-inactive="1"
declare -x cs-panel-winactive="4"
declare -x cs-panel-wininactive="3"
declare -x cs-quakeconsole="0"
declare -x cs-window-active="10"
declare -x cs-window-inactive="9"
declare -x test_var="yipee"
Back to top
View user's profile Send private message
digler99
n00b
n00b


Joined: 01 Dec 2007
Posts: 16

PostPosted: Sat Dec 15, 2007 2:22 am    Post subject: Reply with quote

UPDATE

I tried unmerging FVWM-crystal and FVWM thinking they were the culprits. I decided to change direction, and attempt to proceed with emerging compiz. What I came to notice about this problem was that certain packages would install, but then when portage tried unmerging the old version, it would blow up because the /var/temp/package/environment file would still have some of the bad variables in them. I tried env-update and source /etc/profile, the result is that even though this would error out, if I keep re-emerging it will keep installing newer packages.

I checked 'declare' and the error-causing dashes aren't in any of my variables, they just appear in the /.../environment file when I do unmerges. Does anyone now how that might be possible ?
Back to top
View user's profile Send private message
digler99
n00b
n00b


Joined: 01 Dec 2007
Posts: 16

PostPosted: Sat Dec 15, 2007 7:22 am    Post subject: Reply with quote

UPDATE 2

I seem to have a band-aid on the problem, I went ahead and downgraded the newer packages, down to the current world, then instead of doing "emerge -pvuD compiz" I'm doing an "emerge compiz" and so far it's working. I still dont know why I had crazy variables in my path and environment file after I remvoed the packages. I reinstalled fvwm and crystal and everything is running normal. weird stuff.
Back to top
View user's profile Send private message
mindsmith
n00b
n00b


Joined: 05 Feb 2008
Posts: 1

PostPosted: Tue Feb 05, 2008 11:25 pm    Post subject: Reply with quote

I am having a similar issue, however I can't unmerge many packages because they were apparently built with this environment variable littered with fvwm-crystal's variables (the variables are not there until I startx and fvwm-crystal is executed, but I cannot unmerge even then because the old environment is recalled for packages built under it). Is there a way to change the shell that portage uses? Simply changing the SHELL variable (to say /bin/tcsh) doesn't work.
Back to top
View user's profile Send private message
ThomasAdam
Guru
Guru


Joined: 20 Mar 2005
Posts: 448
Location: England

PostPosted: Tue Feb 05, 2008 11:43 pm    Post subject: Reply with quote

See:

http://www.mail-archive.com/fvwm-workers@fvwm.org/msg00689.html

-- Thomas Adam
Back to top
View user's profile Send private message
why knot
n00b
n00b


Joined: 04 Jan 2006
Posts: 15

PostPosted: Sun Feb 17, 2008 7:00 pm    Post subject: Reply with quote

This issue was causing "emerge portage" to fail for me. Which is odd, because I've had this version of FVWM and FVWM-crystal for months, so I do not know why this has just recently started adversely affecting my ability to upgrade portage.

But as was said earlier, this is a bash issue. So the following fix worked for me:
Code:
downpour dan # sh
sh-3.2# emerge portage


To address mindsmith:
Portage is coded in Python, so I don't think it has a connection to bash (someone correct me if that is incorrect), except if you are running portage from bash.
So changing your shell variable isn't the correct step, rather, actually changing your shell is what is needed. So just type tcsh or sh and then try your portage command again.
Back to top
View user's profile Send private message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10315
Location: Córdoba (Spain)

PostPosted: Sun Feb 17, 2008 7:09 pm    Post subject: Reply with quote

why knot wrote:
This issue was causing "emerge portage" to fail for me. Which is odd, because I've had this version of FVWM and FVWM-crystal for months, so I do not know why this has just recently started adversely affecting my ability to upgrade portage.

But as was said earlier, this is a bash issue. So the following fix worked for me:
Code:
downpour dan # sh
sh-3.2# emerge portage



In gentoo, sh is a symlink to bash.

Code:

$ ls -l `which sh`
lrwxrwxrwx 1 root root 4 ene  3 00:32 /bin/sh -> bash


So, you are still using bash. So, the thing that fixes it is that the env in the new bash session is not polluted.


Quote:

To address mindsmith:
Portage is coded in Python, so I don't think it has a connection to bash (someone correct me if that is incorrect), except if you are running portage from bash.
So changing your shell variable isn't the correct step, rather, actually changing your shell is what is needed. So just type tcsh or sh and then try your portage command again.


Actually, the ebuilds are bash scripts. So, yes, bash is a very important factor. Eclasses are also pure bash.
Back to top
View user's profile Send private message
why knot
n00b
n00b


Joined: 04 Jan 2006
Posts: 15

PostPosted: Mon Feb 18, 2008 1:50 am    Post subject: Reply with quote

Hmm... well it still did work for me. Perhaps it was because I was using a terminal instead of X. But regardless of the fix, it only allowed me to emerge portage, and wouldn't let me, for example, emerge -C fvwm-crystal. So that restored some functionality.
Back to top
View user's profile Send private message
elTimo
n00b
n00b


Joined: 21 Aug 2006
Posts: 21
Location: b-stok

PostPosted: Mon Feb 18, 2008 2:52 pm    Post subject: Re: Dashes in environment variable causing portage builds to Reply with quote

i had the same problem..
Code:
/var/tmp/portage/app-text/xpdf-3.02-r1/temp/environment: line 6: Aumix-VolumeAmo
unt-Button=10: command not found
/var/tmp/portage/app-text/xpdf-3.02-r1/temp/environment: line 7: Aumix-VolumeAmo
unt-Wheel=2: command not found
/var/tmp/portage/app-text/xpdf-3.02-r1/temp/environment: line 17: Colorset-Autho
r=fRiQ: command not found
/var/tmp/portage/app-text/xpdf-3.02-r1/temp/environment: line 18: Colorset-Name=
DarkDesktop: command not found
... etc


finally i solved it in that way:
Quote:

in file /usr/lib/portage/bin/ebuild.sh

filter_readonly_variables() {
[...]
my_var_grep="^(|(declare.*))[[:alnum:]]+(-[[:alnum:]]+)+(=.*)"
var_grep=${var_grep:1} # strip the first |
var_grep="(^|^declare[[:space:]]+-[^[:space:]]+[[:space:]]+|^export[[:space:]]+)(${var_grep})=.*|${my_var_grep}"
[...]
}


i know it isn't good, and any reemegre portage will destroy it, but... it's all i can do now 8)
_________________
elTimo
Wirtualny doradca - Rekomendacje filmów
Back to top
View user's profile Send private message
kenshis
n00b
n00b


Joined: 12 Feb 2007
Posts: 13
Location: Lithuania

PostPosted: Tue Feb 19, 2008 7:26 pm    Post subject: Reply with quote

very nice, it solved my problem too
Back to top
View user's profile Send private message
zmedico
Developer
Developer


Joined: 02 Jan 2004
Posts: 353
Location: California USA

PostPosted: Sat Mar 01, 2008 8:40 am    Post subject: Reply with quote

There is a patch attached to bug 211949.
_________________
Zac
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum