This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Dynamic Environment Update Patch, Take One


You can find my first attempt at a patch to allow dynamic environment variable
translation in cygwin at http://www.rich-paul.net, in the left-hand column.

It's pretty easy to use:  Set an environment variable called 

CYGWIN_TRANSPATHS
and/or one called
CYGWIN_TRANSFILES

Those will be interpreted as semicolon separated lists of environment
variables that should be treated like HOME and PATH currently are.  I use
them for things like my java CLASSPATH (much easier to manipulate in shell
scripts than it ever was in .bat files), and since my marketing dept. insists
that I code in vc++, my INCLUDE and LIB paths.  Might be useful for things
like your profile dir.

Anyway, if the name is in TRANSFILES, it's like running cygpath on the thing,
and if it's in TRANSPATHS, it's like running cygpath -p on it.

One known bug:  Once you've added a name to this list in a cygwin process,
all of it's children will translate this variable, even if you unset it
before starting the child.  But if you unset it in explorer, and start up
a second console window, THAT window will not do the translations.  You
just can't stop the inheritance once it's started.  I believe that this has
to do with the fact that sometimes the environment is passed in pre-parsed,
but I"m not sure, cause it's not documented when that happens.

Happy Hacking,
Rich

-- 
---------------------------------------------------------------------
If this message was not digitally signed, do you really know who it
came from?  Encrypt everything, let the NSA sort it out.

Unsolicited email advertisements will be proofread and returned for a fee of
$500 per message.  Sending such email to this address implies acceptance
of these terms.

smime.p7s


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]