james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [02/10] james-project git commit: JAMES-2355 setenv vs setenv.sh
Date Wed, 18 Apr 2018 00:36:54 GMT
JAMES-2355 setenv vs setenv.sh

Fixes a bug where two of the scripts (run.sh and james-cli.sh)
attempts to source 'setenv.sh' while the script james will attempt
to source 'setenv'. (JAMES-2355)

Adds extra feature to setenv.sh:  Can now optionally be put
in conf dir instead of bin dir (where configuration-like data do
not really belong)

Added extra comments in the setenv files.

Changed semi-bug in setenv.bat:  The CLASSPATH_PREFIX variable was
using Unix syntax, not Windows syntax. This has been changed to 
Windows syntax. I'm not sure this has had any negative effect in
the past as the Java classpath variable on Windows seems to be 
forgiving about use of Unix path separator. However, this is an 
undocumented feature and we should not rely on undocumented features.

Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/356b47ec
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/356b47ec
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/356b47ec

Branch: refs/heads/master
Commit: 356b47ecdd5cc033bba3d4cf00879216ecd75400
Parents: 68d013f
Author: phansson <peterhansson_se@yahoo.com>
Authored: Mon Mar 26 08:08:51 2018 +0200
Committer: benwa <btellier@linagora.com>
Committed: Wed Apr 18 07:34:25 2018 +0700

----------------------------------------------------------------------
 server/app/pom.xml                     |  1 +
 server/app/src/main/app/bin/setenv.bat | 50 ++++++++++++++++++-----------
 server/app/src/main/app/bin/setenv.sh  | 49 ++++++++++++++++------------
 3 files changed, 61 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/356b47ec/server/app/pom.xml
----------------------------------------------------------------------
diff --git a/server/app/pom.xml b/server/app/pom.xml
index 3b91ff5..027e1cc 100644
--- a/server/app/pom.xml
+++ b/server/app/pom.xml
@@ -829,6 +829,7 @@
                                 <!-- this is needed because appassembler is not really
smart on some settings -->
                                 <replace file="${project.build.directory}/appassembler/jsw/james/conf/wrapper.conf"
token="lib/wrapper.jar" value="%REPO_DIR%/wrapper.jar" />
                                 <replace file="${project.build.directory}/appassembler/jsw/james/bin/james"
token="logs" value="var" />
+                                <replace file="${project.build.directory}/appassembler/jsw/james/bin/james"
token="setenv" value="setenv.sh" />
 
                                 <!-- copy the linux wrapper-linux-x86-32 to wrapper, so
use it as default if no matching wrapper was found -->
                                 <copy file="${project.build.directory}/appassembler/jsw/james/bin/wrapper-linux-x86-32"
tofile="${project.build.directory}/appassembler/jsw/james/bin/wrapper" />

http://git-wip-us.apache.org/repos/asf/james-project/blob/356b47ec/server/app/src/main/app/bin/setenv.bat
----------------------------------------------------------------------
diff --git a/server/app/src/main/app/bin/setenv.bat b/server/app/src/main/app/bin/setenv.bat
index cc22659..3a96a1e 100644
--- a/server/app/src/main/app/bin/setenv.bat
+++ b/server/app/src/main/app/bin/setenv.bat
@@ -1,19 +1,31 @@
-@REM ----------------------------------------------------------------------------
-@REM Copyright 2001-2010 The Apache Software Foundation.
-@REM
-@REM Licensed under the Apache License, Version 2.0 (the "License");
-@REM you may not use this file except in compliance with the License.
-@REM You may obtain a copy of the License at
-@REM
-@REM      http://www.apache.org/licenses/LICENSE-2.0
-@REM
-@REM Unless required by applicable law or agreed to in writing, software
-@REM distributed under the License is distributed on an "AS IS" BASIS,
-@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-@REM See the License for the specific language governing permissions and
-@REM limitations under the License.
-@REM ----------------------------------------------------------------------------
-@REM
-
-@REM Add every needed extra jar to this 
-set CLASSPATH_PREFIX=../conf/lib/*
\ No newline at end of file
+@REM ----------------------------------------------------------------------------
+@REM Copyright 2001-2018 The Apache Software Foundation.
+@REM
+@REM Licensed under the Apache License, Version 2.0 (the "License");
+@REM you may not use this file except in compliance with the License.
+@REM You may obtain a copy of the License at
+@REM
+@REM      http://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing, software
+@REM distributed under the License is distributed on an "AS IS" BASIS,
+@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@REM See the License for the specific language governing permissions and
+@REM limitations under the License.
+@REM ----------------------------------------------------------------------------
+@REM
+
+@REM   This file is sourced (using 'CALL') by the various start scripts. 
+@REM   You can use it to add extra environment variables to the startup 
+@REM   procedure.
+@REM   
+@REM   NOTE:  Instead of changing this file it is better to create a new file
+@REM          named setenv.bat in the ../conf directory as the files in the
+@REM          bin directory should generally not be changed.
+
+
+@REM Add every needed extra jar to this 
+set CLASSPATH_PREFIX=..\conf\lib\*
+
+
+if exist "%BASEDIR%\conf\setenv.bat" call "%BASEDIR%\conf\setenv.bat"

http://git-wip-us.apache.org/repos/asf/james-project/blob/356b47ec/server/app/src/main/app/bin/setenv.sh
----------------------------------------------------------------------
diff --git a/server/app/src/main/app/bin/setenv.sh b/server/app/src/main/app/bin/setenv.sh
index 1e6094c..5488469 100644
--- a/server/app/src/main/app/bin/setenv.sh
+++ b/server/app/src/main/app/bin/setenv.sh
@@ -1,20 +1,29 @@
-#!/bin/sh
-# ----------------------------------------------------------------------------
-# Copyright 2001-2010 The Apache Software Foundation.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ----------------------------------------------------------------------------
-#
-# Add every needed extra jar to this
-CLASSPATH_PREFIX=../conf/lib/*
-export CLASSPATH_PREFIX
\ No newline at end of file
+#!/bin/sh
+# ----------------------------------------------------------------------------
+# Copyright 2001-2018 The Apache Software Foundation.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------
+#
+# This file is sourced by the various start scripts. You can use it to
+# add extra environment variables to the startup procedure.
+#
+#   NOTE:  Instead of changing this file it is better to create a file
+#          named setenv.sh in the ../conf directory as the files in the
+#          bin directory should generally not be changed.
+
+# Add every needed extra jar to this
+CLASSPATH_PREFIX=../conf/lib/*
+export CLASSPATH_PREFIX
+
+[ -f "$BASEDIR"/conf/setenv.sh ] && . "$BASEDIR"/conf/setenv.sh


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


Mime
View raw message