Repository: incubator-trafodion Updated Branches: refs/heads/master 9b2b5671e -> e203d42a1
TRAFODION-2402 Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/76e9e87b Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/76e9e87b Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/76e9e87b Branch: refs/heads/master Commit: 76e9e87bb95c7a1fdca1cd4a4e0925b65b1344d0 Parents: 7155a0e Author: mashengchen <[email protected]> Authored: Thu Dec 22 03:12:00 2016 +0000 Committer: mashengchen <[email protected]> Committed: Thu Dec 22 03:12:00 2016 +0000 ---------------------------------------------------------------------- core/conn/trafci/Makefile | 2 +- core/conn/trafci/install/Installer.java-tmpl | 20 +++++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/76e9e87b/core/conn/trafci/Makefile ---------------------------------------------------------------------- diff --git a/core/conn/trafci/Makefile b/core/conn/trafci/Makefile index b608e79..5425ca2 100644 --- a/core/conn/trafci/Makefile +++ b/core/conn/trafci/Makefile @@ -34,7 +34,7 @@ Trafci_installer: mvn -f installer_pom.xml -DbldId=${buildId} clean package -DskipTests$ Trafci_deploy: zip -r ../clients/trafci.zip -j target/trafciInstaller.jar utils/README - java -jar target/trafciInstaller.jar -silent -jdbcFile ${TRAF_HOME}/export/lib/jdbcT4.jar -installDir ${TRAF_HOME} + java -jar target/trafciInstaller.jar -silent -installDir ${TRAF_HOME} clean: mvn -f installer_pom.xml clean http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/76e9e87b/core/conn/trafci/install/Installer.java-tmpl ---------------------------------------------------------------------- diff --git a/core/conn/trafci/install/Installer.java-tmpl b/core/conn/trafci/install/Installer.java-tmpl index 54182ac..3b4d79a 100644 --- a/core/conn/trafci/install/Installer.java-tmpl +++ b/core/conn/trafci/install/Installer.java-tmpl @@ -93,7 +93,10 @@ public class Installer final static String cardInstallationComplete = "INSTALLATION COMPLETE"; final static String ERROR_INVALID_NCI_DIR = "Invalid " + productTitle + " Installation Directory"; - + + final static String INSTALL_DIR = "TRAF_HOME"; + final static String INSTALL_DIR_STR = "${TRAF_HOME}" + File.separator + productName; + final String NEW_JDBC = "JDBC Type 4 Driver JAR File"; final String NEW_JDBC_PKG = "org/trafodion/jdbc/t4/"; @@ -115,7 +118,8 @@ public class Installer private static String nixDefaultInstallDir="/usr/local/"; private static String wDefaultInstallDir="\\Trafodion\\" + productTitle; private static String defaultInstallDir=wDefaultInstallDir; - + private static boolean isTrafHome = false; + //private static String wDefaultInstallJDBC=""; //private static String nixDefaultInstallJDBC="/usr/local/trafci/jdbcT4.jar"; //private static String defaultInstallJDBC=wDefaultInstallJDBC; @@ -3142,6 +3146,11 @@ void processCmdMode(String zipfile) { if(i+1<args.length){ defaultInstallDir = args[i+1].trim(); + if (defaultInstallDir.equals(System.getenv(INSTALL_DIR))) { + isTrafHome = true; + } else { + isTrafHome = false; + } i++; } continue; @@ -3278,7 +3287,12 @@ void processCmdMode(String zipfile) StringBuffer path = new StringBuffer(); for (String jarFile : jarFiles) { - path.append(outputDir.getAbsolutePath()).append(File.separator).append(jarFile).append(File.pathSeparator); + if (isTrafHome) { + path.append(INSTALL_DIR_STR); + } else { + path.append(outputDir.getAbsolutePath()); + } + path.append(File.separator).append(jarFile).append(File.pathSeparator); } String replaceStr = path.substring(0, path.length() - File.pathSeparator.length());
