Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

DERBY-3207: Allow bin scripts to run without DERBY_HOME set

Inline the contents of derby_common.sh in the shell scripts at build
time so that they contain the necessary logic to find the jar files
even when DERBY_HOME has not been set.


git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@924209 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
commit b8e524192b7a80748d689b18ea5b4081b2ba8409 1 parent abe46d0
@kahatlen kahatlen authored
View
8 bin/NetworkServerControl → bin/templates/NetworkServerControl
@@ -17,13 +17,5 @@
# specific language governing permissions and limitations
# under the License.
-if [ -z "$DERBY_HOME" ] ; then
- echo "Error: DERBY_HOME is not set. Please set the DERBY_HOME environment variable"
- echo "to the location of your Derby installation."
- exit 1
-fi
-
-. $DERBY_HOME/bin/derby_common.sh
-
derby_exec_command="exec \"$JAVACMD\" $DERBY_OPTS -classpath \"$LOCALCLASSPATH\" org.apache.derby.drda.NetworkServerControl $@"
eval $derby_exec_command
View
8 bin/dblook → bin/templates/dblook
@@ -17,12 +17,4 @@
# specific language governing permissions and limitations
# under the License.
-if [ -z "$DERBY_HOME" ] ; then
- echo "Error: DERBY_HOME is not set. Please set the DERBY_HOME environment variable"
- echo "to the location of your Derby installation."
- exit 1
-fi
-
-. $DERBY_HOME/bin/derby_common.sh
-
exec "$JAVACMD" $DERBY_OPTS -classpath "$LOCALCLASSPATH" org.apache.derby.tools.dblook "$@"
View
0  bin/derby_common.sh → bin/templates/derby_common.sh
File renamed without changes
View
8 bin/ij → bin/templates/ij
@@ -17,14 +17,6 @@
# specific language governing permissions and limitations
# under the License.
-if [ -z "$DERBY_HOME" ] ; then
- echo "Error: DERBY_HOME is not set. Please set the DERBY_HOME environment variable"
- echo "to the location of your Derby installation."
- exit 1
-fi
-
-. $DERBY_HOME/bin/derby_common.sh
-
# Execute derby using eval/exec to preserve spaces in paths,
# java options, and derby args
derby_exec_command="exec \"$JAVACMD\" $DERBY_OPTS -classpath \"$LOCALCLASSPATH\" org.apache.derby.tools.ij $@"
View
8 bin/startNetworkServer → bin/templates/startNetworkServer
@@ -17,13 +17,5 @@
# specific language governing permissions and limitations
# under the License.
-if [ -z "$DERBY_HOME" ]; then
- echo "Error: DERBY_HOME is not set. Please set the DERBY_HOME environment variable"
- echo "to the location of your Derby installation."
- exit 1
-fi
-
-. $DERBY_HOME/bin/derby_common.sh
-
derby_exec_command="exec \"$JAVACMD\" $DERBY_OPTS -classpath \"$LOCALCLASSPATH\" org.apache.derby.drda.NetworkServerControl start $@"
eval $derby_exec_command
View
8 bin/stopNetworkServer → bin/templates/stopNetworkServer
@@ -17,13 +17,5 @@
# specific language governing permissions and limitations
# under the License.
-if [ -z "$DERBY_HOME" ]; then
- echo "Error: DERBY_HOME is not set. Please set the DERBY_HOME environment variable"
- echo "to the location of your Derby installation."
- exit 1
-fi
-
-. $DERBY_HOME/bin/derby_common.sh
-
derby_exec_command="exec \"$JAVACMD\" $DERBY_OPTS -classpath \"$LOCALCLASSPATH\" org.apache.derby.drda.NetworkServerControl shutdown $@"
eval $derby_exec_command
View
8 bin/sysinfo → bin/templates/sysinfo
@@ -17,13 +17,5 @@
# specific language governing permissions and limitations
# under the License.
-if [ -z "$DERBY_HOME" ]; then
- echo "Error: DERBY_HOME is not set. Please set the DERBY_HOME environment variable"
- echo "to the location of your Derby installation."
- exit 1
-fi
-
-. $DERBY_HOME/bin/derby_common.sh
-
derby_exec_command="exec \"$JAVACMD\" $DERBY_OPTS -classpath \"$LOCALCLASSPATH\" org.apache.derby.tools.sysinfo $@"
eval $derby_exec_command
View
48 build.xml
@@ -32,7 +32,7 @@
<!-- Targets -->
- <target name="buildsource" depends="checkCompilerLevel,init,prebuild,setCompilerProperties,jsr169stubs,jdbc3stubs,jdbc4stubs,felixStubs,engine,storeless,tools,drda,client,build,versioninfo,localeinfo"/>
+ <target name="buildsource" depends="checkCompilerLevel,init,prebuild,setCompilerProperties,jsr169stubs,jdbc3stubs,jdbc4stubs,felixStubs,engine,storeless,tools,drda,client,build,versioninfo,localeinfo,binscripts"/>
<target name="all" depends="buildsource,demo,testing,pptesting,runmessagecheck"/>
<!-- ==================================================================== -->
@@ -728,6 +728,44 @@
</target>
<!-- =================================================================== -->
+<!-- Build the Unix shell scripts under bin -->
+<!-- =================================================================== -->
+
+<target name="binscripts">
+ <antcall target="makebinscript">
+ <param name="script" value="dblook"/>
+ </antcall>
+
+ <antcall target="makebinscript">
+ <param name="script" value="ij"/>
+ </antcall>
+
+ <antcall target="makebinscript">
+ <param name="script" value="sysinfo"/>
+ </antcall>
+
+ <antcall target="makebinscript">
+ <param name="script" value="NetworkServerControl"/>
+ </antcall>
+
+ <antcall target="makebinscript">
+ <param name="script" value="startNetworkServer"/>
+ </antcall>
+
+ <antcall target="makebinscript">
+ <param name="script" value="stopNetworkServer"/>
+ </antcall>
+</target>
+
+<target name="makebinscript">
+ <concat destfile="bin/${script}">
+ <fileset file="bin/templates/derby_common.sh"/>
+ <fileset file="bin/templates/${script}"/>
+ </concat>
+ <chmod perm="+x" file="bin/${script}"/>
+</target>
+
+<!-- =================================================================== -->
<!-- Remove generated message files -->
<!-- =================================================================== -->
<target name="cleanmessages">
@@ -1835,23 +1873,23 @@
<property file="${basedir}/snapshot/maintversion.properties"/>
<zip destfile="${basedir}/snapshot/db-derby-snapshot-${major}.${minor}.${interim}.${point}-${changenumber}.zip">
<zipfileset prefix="db-derby-snapshot-${major}.${minor}.${interim}.${point}-${changenumber}/lib" dir="${basedir}/jars/insane" includes="*.jar,*.war"/>
- <zipfileset prefix="db-derby-snapshot-${major}.${minor}.${interim}.${point}-${changenumber}" dir="${basedir}" includes="bin/**,LICENSE,NOTICE,README,javadoc/publishedapi/**"/>
+ <zipfileset prefix="db-derby-snapshot-${major}.${minor}.${interim}.${point}-${changenumber}" dir="${basedir}" includes="bin/**,LICENSE,NOTICE,README,javadoc/publishedapi/**" excludes="bin/templates/**"/>
</zip>
<tar destfile="${basedir}/snapshot/db-derby-snapshot-${major}.${minor}.${interim}.${point}-${changenumber}.tar.gz"
compression="gzip">
<tarfileset prefix="db-derby-snapshot-${major}.${minor}.${interim}.${point}-${changenumber}/lib" dir="${basedir}/jars/insane" includes="*.jar,*.war"/>
- <tarfileset prefix="db-derby-snapshot-${major}.${minor}.${interim}.${point}-${changenumber}" dir="${basedir}" includes="bin,LICENSE,NOTICE,README,javadoc/publishedapi/**"/>
+ <tarfileset prefix="db-derby-snapshot-${major}.${minor}.${interim}.${point}-${changenumber}" dir="${basedir}" includes="bin/**,LICENSE,NOTICE,README,javadoc/publishedapi/**" excludes="bin/templates/**"/>
</tar>
<!-- debug archives - DERBY-178 -->
<zip destfile="${basedir}/snapshot/db-derby-snapshot-debug-${major}.${minor}.${interim}.${point}-${changenumber}.zip">
<zipfileset prefix="db-derby-snapshot-debug-${major}.${minor}.${interim}.${point}-${changenumber}/lib" dir="${basedir}/jars/sane" includes="*.jar,*.war"/>
- <zipfileset prefix="db-derby-snapshot-debug-${major}.${minor}.${interim}.${point}-${changenumber}" dir="${basedir}" includes="bin/**,LICENSE,NOTICE,CHANGES,README,javadoc/publishedapi/**"/>
+ <zipfileset prefix="db-derby-snapshot-debug-${major}.${minor}.${interim}.${point}-${changenumber}" dir="${basedir}" includes="bin/**,LICENSE,NOTICE,CHANGES,README,javadoc/publishedapi/**" excludes="bin/templates/**"/>
</zip>
<tar destfile="${basedir}/snapshot/db-derby-snapshot-debug-${major}.${minor}.${interim}.${point}-${changenumber}.tar.gz"
compression="gzip">
<tarfileset prefix="db-derby-snapshot-debug-${major}.${minor}.${interim}.${point}-${changenumber}/lib" dir="${basedir}/jars/sane" includes="*.jar,*.war"/>
- <tarfileset prefix="db-derby-snapshot-debug-${major}.${minor}.${interim}.${point}-${changenumber}" dir="${basedir}" includes="bin/**,LICENSE,NOTICE,README,javadoc/publishedapi/**"/>
+ <tarfileset prefix="db-derby-snapshot-debug-${major}.${minor}.${interim}.${point}-${changenumber}" dir="${basedir}" includes="bin/**,LICENSE,NOTICE,README,javadoc/publishedapi/**" excludes="bin/templates/**"/>
</tar>
<copy file="${basedir}/jars/insane/derby_core_plugin_${major}.${minor}.${interim}.zip"
View
4 tools/release/build.xml
@@ -156,7 +156,7 @@
<zipfileset dir="${basedir}" includes="index.html" prefix="${derby.bin}/"/>
<!-- bin -->
<zipfileset dir="${basedir}/bin" prefix="${derby.bin}/bin"
- filemode="755" includes="*"/>
+ filemode="755" includes="*" excludes="templates"/>
<!-- demo -->
<zipfileset file="${derby.demo.src.dir}/README.txt"
fullpath="${derby.bin}/demo/README.txt"/>
@@ -213,7 +213,7 @@
<tarfileset dir="${basedir}" includes="index.html" prefix="${derby.bin}/"/>
<!-- bin -->
<tarfileset dir="${basedir}/bin" prefix="${derby.bin}/bin"
- mode="755" includes="*"/>
+ mode="755" includes="*" excludes="templates"/>
<!-- demo -->
<tarfileset file="${derby.demo.src.dir}/README.txt"
fullpath="${derby.bin}/demo/README.txt"/>

0 comments on commit b8e5241

Please sign in to comment.
Something went wrong with that request. Please try again.