ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 23323] - VSS task uses SSDIR environment variable instead of serverPath parameter
Date Mon, 22 Sep 2003 12:35:55 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23323>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23323

VSS task uses SSDIR environment variable instead of serverPath parameter





------- Additional Comments From chienbd@fsoft.com.vn  2003-09-22 12:35 -------
I changed run method to below and it work
    protected int run(Commandline cmd) {
        try {
            Execute exe = new Execute(new LogStreamHandler(this,
                                                           Project.MSG_INFO,
                                                           Project.MSG_WARN));

            //exe.setAntRun(project);
            // If location of ss.ini is specified we need to set the
            // environment-variable SSDIR to this value
            if (m_serverPath != null) {
                String[] env = exe.getEnvironment();
                if (env == null) {
                    env = new String[0];
                }
                String[] newEnv = new String[env.length + 1];
                //for (int i = 0; i < env.length ; i++) {
                //    newEnv[i] = env[i];
                //}
                //newEnv[env.length] = "SSDIR=" + m_serverPath;
                boolean bMatch = false;
                for (int i = 0; i < env.length ; i++) {
                    if ((env[i] != null) && (env[i].toUpperCase().startsWith
("SSDIR="))) {
                        env[i] = "SSDIR=" + m_serverPath;
                        bMatch = true;
                        break;
                    }
                    newEnv[i] = env[i];
                }
                if (bMatch) {
                    exe.setEnvironment(env);
                } else {
                    newEnv[env.length] = "SSDIR=" + m_serverPath;
                    exe.setEnvironment(newEnv);
                }
            }

            exe.setAntRun(project);

            exe.setNewenvironment(true);

            exe.setWorkingDirectory(project.getBaseDir());
            exe.setCommandline(cmd.getCommandline());
            return exe.execute();
        } catch (java.io.IOException e) {
            throw new BuildException(e, location);
        }
    }
I think it need exe.setNewenvironment(true);
By the way, I can not get any value for env variable. I dont know why.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message