This is the mail archive of the
cygwin-apps
mailing list for the Cygwin project.
Re: base-files: Does not permit the use of symlinks in /etc/profile.d/
- From: Eric Blake <ebb9 at byu dot net>
- Cc: Max Bowsher <maxb at ukf dot net>, cygwin-apps <cygwin-apps at cygwin dot com>
- Date: Sat, 17 Sep 2005 07:34:55 -0600
- Subject: Re: base-files: Does not permit the use of symlinks in /etc/profile.d/
- References: <04f301c5bb0d$cc90ae50$5304a8c0@chimaera> <432C17DE.1070509@byu.net>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Eric Blake on 9/17/2005 7:19 AM:
>
> Here's my idea - add a /etc/profile/symlinkhandler.sh that detects whether
> /etc/profile has been patched yet, and if not, source all the symlinks in
> /etc/profile.
And after more thought, one easy way for symlinkhandler to realize if
symlinks have been sourced, which works since the profile.d scripts are
sourced in alphabetical order:
/etc/profile.d/symlinkhandler1.sh -> /etc/profile.d/symlinkhandler1
/etc/profile.d/symlinkhandler1:
# set to let symlinkhandler2.sh know that symlinkhandler1.sh was called
symlinks_in_profile_d_have_been_sourced=yes
/etc/profile.d/symlinkhandler2.sh:
if [ "x$symlinks_in_profile_d_have_been_sourced" != xyes ] ; then
# only regular files have been sourced so far; source the symlinks
for f in `find /etc/profile.d -type l -xtype f -name '*.sh'` ; do
. "$f"
done
fi
# unset to avoid polluting the shell variable namespace
unset symlinks_in_profile_d_have_been_sourced
- --
Life is short - so eat dessert first!
Eric Blake ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFDLBt+84KuGfSFAYARAt4zAKCMSISRkvbGtOuaMU7OHVgHysY7nQCeM5h3
j37zXYFTYOl1GN/gAAvnQm0=
=tLOq
-----END PGP SIGNATURE-----