First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 172472
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Gentoo eselect Team <eselect@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Ulrich Müller <ulm@gentoo.org>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
eselect.patch Patch for eselect-1.0.9 patch Ulrich Müller 2007-06-07 00:00 0000 263 bytes Details | Diff
eselect.patch Patch for eselect-1.0.9 patch Ulrich Müller 2007-06-07 00:12 0000 261 bytes Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 172472 depends on: Show dependency tree
Show dependency graph
Bug 172472 blocks: 179880 181166
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: 2007-03-27 21:27 0000
"eselect env update" behaves differently from "env-update". Path elements are
accumulated in profile.env and are not deleted, even if they are removed from
the files in env.d. The following session illustrates the problem:

# echo INFOPATH=foo >/etc/env.d/99test
# env-update; . /etc/profile
>>> Regenerating /etc/ld.so.cache...
# echo $INFOPATH
/usr/share/info:[...]:foo
[O.K.]

# echo INFOPATH=bar >/etc/env.d/99test
# env-update; . /etc/profile
>>> Regenerating /etc/ld.so.cache...
# echo $INFOPATH
/usr/share/info:[...]:bar
[O.K.]

# rm /etc/env.d/99test
# env-update; . /etc/profile
>>> Regenerating /etc/ld.so.cache...
# echo $INFOPATH
/usr/share/info:[...]
[O.K.]

# echo INFOPATH=foo >/etc/env.d/99test
# eselect env update; . /etc/profile
Regenerating /etc/ld.so.cache...
# echo $INFOPATH
/usr/share/info:[...]:foo
[O.K.]

# echo INFOPATH=bar >/etc/env.d/99test
# eselect env update; . /etc/profile
Regenerating /etc/ld.so.cache...
# echo $INFOPATH
/usr/share/info:[...]:foo:bar
[This should contain "bar" only.]

# rm /etc/env.d/99test
# eselect env update; . /etc/profile
Regenerating /etc/ld.so.cache...
# echo $INFOPATH
/usr/share/info:[...]:foo:bar
[Should contain neither "foo" nor "bar".]

# env-update; . /etc/profile
>>> Regenerating /etc/ld.so.cache...
# echo $INFOPATH
/usr/share/info:[...]
[O.K.]

------- Comment #1 From Ulrich Müller 2007-03-29 08:14:41 0000 -------
Still the same in 1.0.9.

------- Comment #2 From George Shapovalov 2007-05-19 12:11:48 0000 -------
I observe the same. 
I tried to use "do_action env update &> /dev/null" in gnat.eselect module, but
that pulls in active enc settings (like active PATH, ADA_INCLUDE_PATH, etc)
which essentially breaks functionality of gnat.eselect module. This can be
worked around by using env-update directly inside the gnat.eselect, however
this is flagged "incorrect" in the eselect documentation (in
developer-guide.html), plus it only makes sense to use eselect's own modules
where possible.

I could provide a gnat specific extra test case, but the one above is way more
simple and represents the issue well enough (short version: add "do_action env
update &> /dev/null" to the end of do_set and do_update functions of
gnat.eselect module and try switching from e.g.
x86_64-pc-linux-gnu-gnat-gcc-4.2 to x86_64-pc-linux-gnu-gnat-gcc-4.1
(gnat-gcc-4.1.2 and gnat-gcc-4.2.0 would need to be installed) and then do ".
/etc/profile" in some shell without running env-update first and then check
PATH and ADA_INCLUDE_PATH vars. They should not contain old (but that were
active at the moment of running eselect gnat set or env update) values (4.1
when activating 4.2 or vice verse).

I also upped the severity one notch, as eselect is an important package and env
is a central its module and this is indeed a major issue for any package trying
to utilize this functionality.

George

------- Comment #3 From Ulrich Müller 2007-06-06 23:57:55 0000 -------
Looks like the problem is in lib/config.bash, function load_config(). The
${key} variable misses a local declaration; so if it is not set in the config
file, then its value will happily be taken from the environment.

Attached patch should fix the problem.

------- Comment #4 From Ulrich Müller 2007-06-07 00:00:21 0000 -------
Created an attachment (id=121363) [edit]
Patch for eselect-1.0.9

------- Comment #5 From Ulrich Müller 2007-06-07 00:12:48 0000 -------
Created an attachment (id=121365) [edit]
Patch for eselect-1.0.9

Quotation marks are not neccessary here.

------- Comment #6 From Ulrich Müller 2007-06-08 06:56:52 0000 -------
george: Can you confirm if the patch fixes the problem for you?

------- Comment #7 From George Shapovalov 2007-06-14 12:09:54 0000 -------
Sorry for the delay, got carried out by other stuff.
Yes, this fixes it. Thanks! Now we only need this fix to be picked up :).

George

------- Comment #8 From Ulrich Müller 2007-06-16 20:49:49 0000 -------
Changed summary since the problem is not in env.eselect, but in config.bash.

------- Comment #9 From Danny van Dyk (RETIRED) 2007-06-17 10:06:58 0000 -------
Fixed as of 1.0.10

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