env_helper
Rainer Müller
raimue at macports.org
Wed Mar 18 13:27:22 PDT 2009
Bradley Giesbrecht wrote:
> On Mar 18, 2009, at 11:44 AM, Rainer Müller wrote:
>
>> Rainer Müller wrote:
> [...]
>>> A user would only need to add this line to his .profile to load
>>> MacPorts:
>>> [ -f /opt/local/etc/profile ] && source /opt/local/etc/profile
>> What is left is the caching, I would still prefer that.
>
> What is your idea as to when the cache gets updated?
>
> I have mentioned user overrides so I would want the cache function to
> be aware of things that might happen outside the port command like a
> user editing a conf file.
>
> I might not understand what you mean by caching. Since ~/.profile is
> only sourced when a shell is first opened is the complexity of a cache
> going to pay for itself?
If you are going to traverse the filesystem in ${prefix}/etc/profile and
concatenating values like PATH this probably gets slow. As long as no
file changes this will give the same result each time anyway.
So I would like to see a cache of this being generated by a command and
the result saved to ${prefix}/etc/profile.
We could also do the cache updates automatically in activate/deactivate
(install/uninstall in direct mode). But then we need to tell the user
that he absolutely has to do 'source ${prefix}/etc/profile' right now
after this command.
Rainer
More information about the macports-dev
mailing list