jenkinsci/jenkins — pull request #988 by ikedam (2013-10-28 13:59:03+00:00)
Title: [FIX JENKINS-16255] Handle environment variables case-sensitive.

This is a fix for [JENKINS-16255] (https://issues.jenkins-ci.org/browse/JENKINS-16255).
Jenkins handles names of environment variables in case-insensitive way, and that often causes problems on UNIX platforms.

Jenkins have handled variables case-insensitively for Windows platforms ([JENKINS-968](https://issues.jenkins-ci.org/browse/JENKINS-968)):
* An exception occurs when launching dot-net programs on Windows.
* I'm not sure how to reproduce this.
* PATH environment variables are split (PATH and Path) and does not work.

I resolved these problems in following ways:
* When launching a native process, convert `EnvVars` into case-insensitive on Windows (`EnvVars#forNativeProcess`).
* Handles XYZ+ABC environment variables case-insensitively if that `EnvVars` will be used for Windows.
* XYZ+ABC is used for adding a new path to the PATH variable. For example, when you use a maven builder, a path to maven binary is added to PATH.
* `EnvVars` that is overridden with XYZ+ABC is always instantiated on the node where a process is launched (which is done in `LocalLauncher`).

Users can have Jenkins works as before by launching with -Dhudson.EnvVars.caseInsensitive=true.
Configuring in the system configuration page would be most convenient, but it is not possible for `EnvVars` are used in a very early stage of launching, and the system configuration is not yet loaded.