Setting environnement variable in a port

Blair Zajac blair at orcaware.com
Tue Jul 26 13:38:40 PDT 2011


On 7/26/11 1:33 PM, Ryan Schmidt wrote:
>
> On Jul 26, 2011, at 11:26, Blair Zajac wrote:
>
>> Another way is to drop a file in $prefix/etc/profile.d and than arrange to have the shell source it.
>
> I didn't think we typically did that in MacPorts. For one thing, it's not compatible with Tiger, but I guess we're caring even less about that now that Lion is out. Are there any existing ports using this strategy?

I don't know, but is the standard Unix way to add new environmental variables on 
Unix systems, so I think we should use this and tell people to source all 
$prefix/etc/profile.d/*.sh files:

On our Fedora 13 systems:

ls /etc/profile.d/
/etc/profile.d:
ccache.csh                 lang.csh
ccache.sh                  lang.sh
colorls.csh                less.csh
colorls.sh                 less.sh
cvs.csh                    modules.csh@
cvs.sh                     modules.sh
glib2.csh                  mpich2.csh
glib2.sh                   mpich2.sh
kde.csh                    qt.csh
kde.sh                     qt.sh
keychain.csh               udisks-bash-completion.sh
keychain.sh                vim.csh
krb5-devel.csh             vim.sh
krb5-devel.sh              which2.csh
krb5-workstation.csh       which2.sh
krb5-workstation.sh

Blair


More information about the macports-dev mailing list