Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 162634 - following portage features: code listing 9 nukes PATH
Summary: following portage features: code listing 9 nukes PATH
Status: RESOLVED FIXED
Alias: None
Product: [OLD] Docs on www.gentoo.org
Classification: Unclassified
Component: Installation Handbook (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: nm (RETIRED)
URL: http://www.gentoo.org/doc/en/handbook...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-18 10:22 UTC by Christian Becke
Modified: 2007-01-18 11:17 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Becke 2007-01-18 10:22:36 UTC
Following code listing 9 will set a user's PATH variable to only "/usr/lib/ccache/bin:/opt/bin", overwriting any previous settings.
Code Listing 9 should be changed to:

PATH="/usr/lib/ccache/bin:/opt/bin:${PATH}"
Comment 1 nm (RETIRED) gentoo-dev 2007-01-18 10:34:20 UTC
Doesn't interfere with anything for me. I added it to ~/.bash_profile, and it is only sourced if I run source ~/.bash_profile, in which case, yes, this is all that PATH will contain. However, by simply running source /etc/profile, I am returned to my full path listing.

If you're using ccache for non-portage compiling, then it is of benefit to only temporarily switch PATH to /usr/lib/ccache/bin. There's no point in it being in PATH the rest of the time. Plus, as is mentioned in that paragraph, .bash_profile is only *one* way of setting PATH; don't forget about /etc/profile.

Also, your PATH suggestion is invalid because it duplicates /opt/bin which might already be a part of a user's system in /etc/profile.

As suggested by this snippet:
"(before /usr/bin)", the code in blue is just an example of what could go into a full PATH in the file.
Comment 2 Jan Kundrát (RETIRED) gentoo-dev 2007-01-18 10:43:52 UTC
(In reply to comment #1)
> Doesn't interfere with anything for me. I added it to ~/.bash_profile, and it
> is only sourced if I run source ~/.bash_profile

False, see bash(1) manpage:

--noprofile
              Do not read either the system-wide startup file /etc/profile or any of the personal initialization files ~/.bash_profile, ~/.bash_login, or
              ~/.profile.  By default, bash reads these files when it is invoked as a login shell (see INVOCATION below).

Not everyone uses X.
Comment 3 nm (RETIRED) gentoo-dev 2007-01-18 11:12:26 UTC
Seems I already had the proper ${PATH} fix in my bash_profile before this bug was reported, which is why I couldn't reproduce. Let's see about appending the proper variable so that it is added, not overwritten.
Comment 4 nm (RETIRED) gentoo-dev 2007-01-18 11:17:14 UTC
Thanks for reporting, and thanks to Jan for some pointers on bash -l. Changed so that it doesn't overwrite PATH, but instead adds to it cumulatively.

Fixed in CVS.