| Summary: | app-admin/eselect fails on env variables with whitespace in value, despite quoting | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | Holger Hoffstätte <holger> |
| Component: | [OLD] Core system | Assignee: | Gentoo eselect Team <eselect> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | cphil, I.zaufi |
| Priority: | High | Keywords: | InVCS |
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
| Attachments: |
bash trace
Patch for config.bash |
||
Forgot to mention the eselect version I'm using: eselect-1.0.11-r1 eselect-opengl-1.0.6-r1 Does the following patch fix the problem? <http://sources.gentoo.org/viewcvs.py/eselect/trunk/libs/config.bash.in?r1=305&r2=328> (In reply to comment #2) > Does the following patch fix the problem? > <http://sources.gentoo.org/viewcvs.py/eselect/trunk/libs/config.bash.in?r1=305&r2=328> Thanks for responding - unfortunately it does not help, same result as before. (In reply to comment #3) > Thanks for responding - unfortunately it does not help, same result as before. I was just guessing, since I can't reproduce it. Works for me with both eselect-1.0.11-r1 or eselect branch 1.0.x as of today. Could you please attach the output of the following command: $ bash -vx /usr/bin/eselect opengl set xorg-x11 Created attachment 188562 [details]
bash trace
Created attachment 188570 [details, diff]
Patch for config.bash
Thanks. That trace really helped.
"eselect env update" should show the problem more clearly.
Does attached patch fix the issue for you?
(In reply to comment #6) Yay! It works. Great job :) Committed to trunk (r434) and 1.0.x branch (r436). This will be fixed in the upcoming 1.0.12 release. Thank you for reporting the issue. *** Bug 257502 has been marked as a duplicate of this bug. *** Fixed in 1.0.12. |
eselect is a wonderful system, but for the longest time I was wondering why eselect opengl set <opengl-impl> always died with a unhelpful "Killed" message, corrupting the generated /etc/profile.env. Turns out that this was caused by a custom entry in /etc/env.d/99java with Java-typical property definitions, like e.g.: ANT_OPTS='-Duser.language=en -Djava.awt.headless=true'. After removing this entry from env.d, eselect would work fine without crapping out. Reproducible: Always Steps to Reproduce: 1. echo "BUG='-Dfoo=bar -Dfrob=blob'" > /etc/env.d/99bug 2. eselect opengl set xorg-x11 3. eh? Actual Results: Switching to xorg-x11 OpenGL interface...zsh: killed eselect opengl set xorg-x11 Expected Results: $echo "BUG='-Dfoo=bar'" > /etc/env.d/99bug $eselect opengl set xorg-x11 Switching to xorg-x11 OpenGL interface... done I first suspected that eselect's key/value parser would blindly split on '=' without treating the value of a variable definition as a whole, but it turned out that the bug is with the space between multiple -D property definitions. As demonstrated, it works just fine with only one property. FWIW the quoting style of the variable (" vs. ') does not make a difference.