changeset 2476:da549e428ff5

Windows - update command files, correct USER_THERMOSTAT_HOME under cygwin This patch updates some Windows command files, and fixes thermostat-common to always use the user's Windows home directory as the default location of USER_THERMOSTAT_HOME under Cygwin. (previously it used $HOME, so was confusing to the user) Reviewed-by: sgehwolf Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2016-October/021252.html
author Simon Tooke <stooke@redhat.com>
date Thu, 13 Oct 2016 15:02:25 -0400
parents 404613dd8275
children 0a1bb03d407c
files distribution/pom.xml distribution/scripts/thermostat-common distribution/windows/config/thermostatrc.cmd distribution/windows/scripts/thermostat-command-channel.cmd distribution/windows/scripts/thermostat-ipc-client-common.cmd distribution/windows/scripts/thermostat.cmd
diffstat 6 files changed, 112 insertions(+), 63 deletions(-) [+]
line wrap: on
line diff
--- a/distribution/pom.xml	Thu Oct 13 14:57:38 2016 -0400
+++ b/distribution/pom.xml	Thu Oct 13 15:02:25 2016 -0400
@@ -199,6 +199,11 @@
                       <targetPath>image/bin</targetPath>
                       <filtering>true</filtering>
                     </resource>
+                    <resource>
+                      <directory>windows/config</directory>
+                      <targetPath>image/etc</targetPath>
+                      <filtering>true</filtering>
+                    </resource>
                   </resources>
                 </configuration>
               </execution>
--- a/distribution/scripts/thermostat-common	Thu Oct 13 14:57:38 2016 -0400
+++ b/distribution/scripts/thermostat-common	Thu Oct 13 15:02:25 2016 -0400
@@ -71,12 +71,16 @@
 # on cygwin, convert to Unix format
 if [ $CYGWIN_MODE -eq 1 ]; then
   THERMOSTAT_HOME="`cygpath -u $THERMOSTAT_HOME`"
-  export THERMOSTAT_HOME
 fi
+export THERMOSTAT_HOME
 
 # Thermostat user home
 if [[ "${USER_THERMOSTAT_HOME}" = "" ]]; then
-  USER_THERMOSTAT_HOME="${HOME}/.thermostat"
+  if [ $CYGWIN_MODE -eq 1 ]; then
+    USER_THERMOSTAT_HOME="`cygpath -u ${USERPROFILE}`/.thermostat"
+  else
+    USER_THERMOSTAT_HOME="${HOME}/.thermostat"
+  fi
 fi
 export USER_THERMOSTAT_HOME
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/distribution/windows/config/thermostatrc.cmd	Thu Oct 13 15:02:25 2016 -0400
@@ -0,0 +1,73 @@
+@echo off
+::
+:: Copyright 2012-2015 Red Hat, Inc.
+::
+:: This file is part of Thermostat.
+::
+:: Thermostat is free software; you can redistribute it and/or modify
+:: it under the terms of the GNU General Public License as published
+:: by the Free Software Foundation; either version 2, or (at your
+:: option) any later version.
+::
+:: Thermostat is distributed in the hope that it will be useful, but
+:: WITHOUT ANY WARRANTY; without even the implied warranty of
+:: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+:: General Public License for more details.
+::
+:: You should have received a copy of the GNU General Public License
+:: along with Thermostat; see the file COPYING.  If not see
+:: <http://www.gnu.org/licenses/>.
+::
+:: Linking this code with other modules is making a combined work
+:: based on this code.  Thus, the terms and conditions of the GNU
+:: General Public License cover the whole combination.
+::
+:: As a special exception, the copyright holders of this code give
+:: you permission to link this code with independent modules to
+:: produce an executable, regardless of the license terms of these
+:: independent modules, and to copy and distribute the resulting
+:: executable under terms of your choice, provided that you also
+:: meet, for each linked independent module, the terms and conditions
+:: of the license of that module.  An independent module is a module
+:: which is not derived from or based on this code.  If you modify
+:: this code, you may extend this exception to your version of the
+:: library, but you are not obligated to do so.  If you do not wish
+:: to do so, delete this exception statement from your version.
+::
+::####################################################################
+::
+:: Environment variables for the system Thermostat profile. You
+:: can assume that THERMOSTAT_HOME variable is correctly set and you
+:: may override system variables via a user profile in
+:: USER_THERMOSTAT_HOME/etc/thermostatrc.
+::
+::####################################################################
+
+::
+:: Use a different JDK for running thermostat
+::
+rem JAVA_HOME=C:\java-1.8.0-openjdk
+
+::
+:: Extra jar files which need to be on the classpath when
+:: Thermostat boots.
+::
+set THERMOSTAT_EXT_BOOT_CLASSPATH=%JAVA_HOME%\lib\tools.jar%
+
+:: FIXME: Remove once jfreechart is a real OSGi bundle upstream
+set THERMOSTAT_EXT_BOOT_CLASSPATH=%THERMOSTAT_EXT_BOOT_CLASSPATH%;%THERMOSTAT_HOME%\libs\jfreechart-@jfreechart.version@.jar
+set THERMOSTAT_EXT_BOOT_CLASSPATH=%THERMOSTAT_EXT_BOOT_CLASSPATH%;%THERMOSTAT_HOME%\libs\jcommon-@jcommon.version@.jar
+:: Needed to parse web.xml files without network connection See PR 2029.
+set THERMOSTAT_EXT_BOOT_CLASSPATH=%THERMOSTAT_EXT_BOOT_CLASSPATH%;%THERMOSTAT_HOME%\plugins\embedded-web-endpoint\jetty-schemas-@jetty-schemas.version@.jar
+
+::
+:: Extra java options
+::
+rem set THERMOSTAT_EXT_JAVA_OPTS="-Xint -ea"
+
+::
+:: Extra options passed on to the Thermostat main class
+::
+rem set THERMOSTAT_EXT_OPTS=--ignore-bundle-versions
+
+
--- a/distribution/windows/scripts/thermostat-command-channel.cmd	Thu Oct 13 14:57:38 2016 -0400
+++ b/distribution/windows/scripts/thermostat-command-channel.cmd	Thu Oct 13 15:02:25 2016 -0400
@@ -64,17 +64,17 @@
 )
 
 :: Additional JARs necessary for the server
-set IPC_CLASSPATH=%IPC_CLASSPATH%:%THERMOSTAT_LIBS%\thermostat-common-core-@project.version@.jar
-set IPC_CLASSPATH=%IPC_CLASSPATH%:%THERMOSTAT_LIBS%\thermostat-shared-config-@project.version@.jar
-set IPC_CLASSPATH=%IPC_CLASSPATH%:%THERMOSTAT_LIBS%\thermostat-agent-command-@project.version@.jar
-set IPC_CLASSPATH=%IPC_CLASSPATH%:%THERMOSTAT_LIBS%\thermostat-common-command-@project.version@.jar
-set IPC_CLASSPATH=%IPC_CLASSPATH%:%THERMOSTAT_LIBS%\thermostat-agent-command-server-@project.version@.jar
-set IPC_CLASSPATH=%IPC_CLASSPATH%:%THERMOSTAT_LIBS%\netty-buffer-@netty.version@.jar
-set IPC_CLASSPATH=%IPC_CLASSPATH%:%THERMOSTAT_LIBS%\netty-common-@netty.version@.jar
-set IPC_CLASSPATH=%IPC_CLASSPATH%:%THERMOSTAT_LIBS%\netty-transport-@netty.version@.jar
-set IPC_CLASSPATH=%IPC_CLASSPATH%:%THERMOSTAT_LIBS%\netty-codec-@netty.version@.jar
-set IPC_CLASSPATH=%IPC_CLASSPATH%:%THERMOSTAT_LIBS%\netty-handler-@netty.version@.jar
-set IPC_CLASSPATH=%IPC_CLASSPATH%:%THERMOSTAT_LIBS%\gson-@gson.version@.jar
+set IPC_CLASSPATH=%IPC_CLASSPATH%;%THERMOSTAT_LIBS%\thermostat-common-core-@project.version@.jar
+set IPC_CLASSPATH=%IPC_CLASSPATH%;%THERMOSTAT_LIBS%\thermostat-shared-config-@project.version@.jar
+set IPC_CLASSPATH=%IPC_CLASSPATH%;%THERMOSTAT_LIBS%\thermostat-agent-command-@project.version@.jar
+set IPC_CLASSPATH=%IPC_CLASSPATH%;%THERMOSTAT_LIBS%\thermostat-common-command-@project.version@.jar
+set IPC_CLASSPATH=%IPC_CLASSPATH%;%THERMOSTAT_LIBS%\thermostat-agent-command-server-@project.version@.jar
+set IPC_CLASSPATH=%IPC_CLASSPATH%;%THERMOSTAT_LIBS%\netty-buffer-@netty.version@.jar
+set IPC_CLASSPATH=%IPC_CLASSPATH%;%THERMOSTAT_LIBS%\netty-common-@netty.version@.jar
+set IPC_CLASSPATH=%IPC_CLASSPATH%;%THERMOSTAT_LIBS%\netty-transport-@netty.version@.jar
+set IPC_CLASSPATH=%IPC_CLASSPATH%;%THERMOSTAT_LIBS%\netty-codec-@netty.version@.jar
+set IPC_CLASSPATH=%IPC_CLASSPATH%;%THERMOSTAT_LIBS%\netty-handler-@netty.version@.jar
+set IPC_CLASSPATH=%IPC_CLASSPATH%;%THERMOSTAT_LIBS%\gson-@gson.version@.jar
 
 set CMD_CHANNEL_CLASS=com.redhat.thermostat.agent.command.server.internal.CommandChannelServerMain
 
--- a/distribution/windows/scripts/thermostat-ipc-client-common.cmd	Thu Oct 13 14:57:38 2016 -0400
+++ b/distribution/windows/scripts/thermostat-ipc-client-common.cmd	Thu Oct 13 15:02:25 2016 -0400
@@ -42,28 +42,25 @@
 
 rem Build classpath shared by all IPC clients
 
-set IPC_CLASSPATH=%THERMOSTAT_LIBS%\thermostat-agent-ipc-client-%project.version%.jar
-set IPC_CLASSPATH=%IPC_CLASSPATH%:%THERMOSTAT_LIBS%\thermostat-agent-ipc-common-%project.version%.jar
-set IPC_CLASSPATH=%IPC_CLASSPATH%:%THERMOSTAT_LIBS%\thermostat-agent-ipc-unixsocket-client-%project.version%.jar
-set IPC_CLASSPATH=%IPC_CLASSPATH%:%THERMOSTAT_LIBS%\thermostat-agent-ipc-unixsocket-common-%project.version%.jar
-set IPC_CLASSPATH=%IPC_CLASSPATH%:%THERMOSTAT_LIBS%\thermostat-agent-ipc-tcpsocket-client-%project.version%.jar
-set IPC_CLASSPATH=%IPC_CLASSPATH%:%THERMOSTAT_LIBS%\thermostat-agent-ipc-tcpsocket-common-%project.version%.jar
-set IPC_CLASSPATH=%IPC_CLASSPATH%:%THERMOSTAT_LIBS%\jnr-unixsocket-%jnr-unixsocket.version%.jar
-set IPC_CLASSPATH=%IPC_CLASSPATH%:%THERMOSTAT_LIBS%\jnr-enxio-%jnr-enxio.version%.jar
-set IPC_CLASSPATH=%IPC_CLASSPATH%:%THERMOSTAT_LIBS%\jnr-constants-%jnr-constants.version%.jar
-set IPC_CLASSPATH=%IPC_CLASSPATH%:%THERMOSTAT_LIBS%\jnr-posix-%jnr-posix.version%.jar
-set IPC_CLASSPATH=%IPC_CLASSPATH%:%THERMOSTAT_LIBS%\jnr-ffi-%jnr-ffi.version%.jar
-set IPC_CLASSPATH=%IPC_CLASSPATH%:%THERMOSTAT_LIBS%\jnr-x86asm-%jnr-x86asm.version%.jar
-set IPC_CLASSPATH=%IPC_CLASSPATH%:%THERMOSTAT_LIBS%\jffi-%jffi.version%.jar
-set IPC_CLASSPATH=%IPC_CLASSPATH%:%THERMOSTAT_LIBS%\jffi-%jffi.version%-native.jar
-set IPC_CLASSPATH=%IPC_CLASSPATH%:%THERMOSTAT_LIBS%\asm-%asm.version%.jar
-set IPC_CLASSPATH=%IPC_CLASSPATH%:%THERMOSTAT_LIBS%\asm-commons-%asm.version%.jar
-set IPC_CLASSPATH=%IPC_CLASSPATH%:%THERMOSTAT_LIBS%\asm-util-%asm.version%.jar
-set IPC_CLASSPATH=%IPC_CLASSPATH%:%THERMOSTAT_LIBS%\asm-analysis-%asm.version%.jar
-set IPC_CLASSPATH=%IPC_CLASSPATH%:%THERMOSTAT_LIBS%\asm-tree-%asm.version%.jar
+set IPC_CLASSPATH=%THERMOSTAT_LIBS%\thermostat-agent-ipc-client-@project.version@.jar
+set IPC_CLASSPATH=%IPC_CLASSPATH%;%THERMOSTAT_LIBS%\thermostat-agent-ipc-common-@project.version@.jar
+set IPC_CLASSPATH=%IPC_CLASSPATH%;%THERMOSTAT_LIBS%\thermostat-agent-ipc-tcpsocket-client-@project.version@.jar
+set IPC_CLASSPATH=%IPC_CLASSPATH%;%THERMOSTAT_LIBS%\thermostat-agent-ipc-tcpsocket-common-@project.version@.jar
+set IPC_CLASSPATH=%IPC_CLASSPATH%;%THERMOSTAT_LIBS%\jnr-enxio-@jnr-enxio.version@.jar
+set IPC_CLASSPATH=%IPC_CLASSPATH%;%THERMOSTAT_LIBS%\jnr-constants-@jnr-constants.version@.jar
+set IPC_CLASSPATH=%IPC_CLASSPATH%;%THERMOSTAT_LIBS%\jnr-posix-@jnr-posix.version@.jar
+set IPC_CLASSPATH=%IPC_CLASSPATH%;%THERMOSTAT_LIBS%\jnr-ffi-@jnr-ffi.version@.jar
+set IPC_CLASSPATH=%IPC_CLASSPATH%;%THERMOSTAT_LIBS%\jnr-x86asm-@jnr-x86asm.version@.jar
+set IPC_CLASSPATH=%IPC_CLASSPATH%;%THERMOSTAT_LIBS%\jffi-@jffi.version@.jar
+set IPC_CLASSPATH=%IPC_CLASSPATH%;%THERMOSTAT_LIBS%\jffi-@jffi.version%-native.jar
+set IPC_CLASSPATH=%IPC_CLASSPATH%;%THERMOSTAT_LIBS%\asm-@asm.version@.jar
+set IPC_CLASSPATH=%IPC_CLASSPATH%;%THERMOSTAT_LIBS%\asm-commons-@asm.version@.jar
+set IPC_CLASSPATH=%IPC_CLASSPATH%;%THERMOSTAT_LIBS%\asm-util-@asm.version@.jar
+set IPC_CLASSPATH=%IPC_CLASSPATH%;%THERMOSTAT_LIBS%\asm-analysis-@asm.version@.jar
+set IPC_CLASSPATH=%IPC_CLASSPATH%;%THERMOSTAT_LIBS%\asm-tree-@asm.version@.jar
 
 rem set THERMOSTAT_LIBS=
 
-echo %IPC_CLASSPATH%
+rem echo %IPC_CLASSPATH%
 
 exit /b 0
--- a/distribution/windows/scripts/thermostat.cmd	Thu Oct 13 14:57:38 2016 -0400
+++ b/distribution/windows/scripts/thermostat.cmd	Thu Oct 13 15:02:25 2016 -0400
@@ -57,36 +57,6 @@
 set BOOT_CLASSPATH=%BOOT_CLASSPATH%;%THERMOSTAT_LIBS%\thermostat-main-@project.version@.jar
 set BOOT_CLASSPATH=%BOOT_CLASSPATH%;%THERMOSTAT_LIBS%\thermostat-shared-config-@project.version@.jar
 
-goto skip_setclasspath
-set BOOT_CLASSPATH=
-for %%f in (%THERMOSTAT_LIBS%\*.jar) do (
-  rem echo jar file %%f
-  set BOOT_CLASSPATH=!BOOT_CLASSPATH!;%f
-)
-:skip_setclasspath
-
-goto foo
-echo on
-set WANTED_JARS=org.apache.felix.framework- thermostat-launcher- thermostat-main- thermostat-shared-config-
-set BOOT_CLASSPATH=
-for %%j in (%WANTED_JARS%) do (
-  rem echo jar file %%j
-  for %%f in (%THERMOSTAT_LIBS%\%%j*.jar) do (
-    rem echo found file %f
-    set BOOT_CLASSPATH=!BOOT_CLASSPATH!;%f
-  )
-)
-echo off
-:foo
-
-echo off
-set WANTED_JARS=org.apache.felix.framework-4.2.0.jar thermostat-launcher-1.99.12-SNAPSHOT.jar thermostat-main-1.99.12-SNAPSHOT.jar thermostat-shared-config-1.99.12-SNAPSHOT.jar
-set BOOT_CLASSPATH=.
-for %%j in (%WANTED_JARS%) do (
-  rem echo jar file %%j
-  set BOOT_CLASSPATH=!BOOT_CLASSPATH!;%THERMOSTAT_LIBS%\%%j
-)
-
 :: Append extra class path entries coming from the profiles
 if defined THERMOSTAT_EXT_BOOT_CLASSPATH (
   set BOOT_CLASSPATH=%BOOT_CLASSPATH%;%THERMOSTAT_EXT_BOOT_CLASSPATH%