Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
8 bin/NetworkServerControl → bin/templates/NetworkServerControl
@@ -17,13 +17,5 @@
17 17 # specific language governing permissions and limitations
18 18 # under the License.
19 19
20   -if [ -z "$DERBY_HOME" ] ; then
21   - echo "Error: DERBY_HOME is not set. Please set the DERBY_HOME environment variable"
22   - echo "to the location of your Derby installation."
23   - exit 1
24   -fi
25   -
26   -. $DERBY_HOME/bin/derby_common.sh
27   -
28 20 derby_exec_command="exec \"$JAVACMD\" $DERBY_OPTS -classpath \"$LOCALCLASSPATH\" org.apache.derby.drda.NetworkServerControl $@"
29 21 eval $derby_exec_command
8 bin/dblook → bin/templates/dblook
@@ -17,12 +17,4 @@
17 17 # specific language governing permissions and limitations
18 18 # under the License.
19 19
20   -if [ -z "$DERBY_HOME" ] ; then
21   - echo "Error: DERBY_HOME is not set. Please set the DERBY_HOME environment variable"
22   - echo "to the location of your Derby installation."
23   - exit 1
24   -fi
25   -
26   -. $DERBY_HOME/bin/derby_common.sh
27   -
28 20 exec "$JAVACMD" $DERBY_OPTS -classpath "$LOCALCLASSPATH" org.apache.derby.tools.dblook "$@"
0  bin/derby_common.sh → bin/templates/derby_common.sh
File renamed without changes
8 bin/ij → bin/templates/ij
@@ -17,14 +17,6 @@
17 17 # specific language governing permissions and limitations
18 18 # under the License.
19 19
20   -if [ -z "$DERBY_HOME" ] ; then
21   - echo "Error: DERBY_HOME is not set. Please set the DERBY_HOME environment variable"
22   - echo "to the location of your Derby installation."
23   - exit 1
24   -fi
25   -
26   -. $DERBY_HOME/bin/derby_common.sh
27   -
28 20 # Execute derby using eval/exec to preserve spaces in paths,
29 21 # java options, and derby args
30 22 derby_exec_command="exec \"$JAVACMD\" $DERBY_OPTS -classpath \"$LOCALCLASSPATH\" org.apache.derby.tools.ij $@"
8 bin/startNetworkServer → bin/templates/startNetworkServer
@@ -17,13 +17,5 @@
17 17 # specific language governing permissions and limitations
18 18 # under the License.
19 19
20   -if [ -z "$DERBY_HOME" ]; then
21   - echo "Error: DERBY_HOME is not set. Please set the DERBY_HOME environment variable"
22   - echo "to the location of your Derby installation."
23   - exit 1
24   -fi
25   -
26   -. $DERBY_HOME/bin/derby_common.sh
27   -
28 20 derby_exec_command="exec \"$JAVACMD\" $DERBY_OPTS -classpath \"$LOCALCLASSPATH\" org.apache.derby.drda.NetworkServerControl start $@"
29 21 eval $derby_exec_command
8 bin/stopNetworkServer → bin/templates/stopNetworkServer
@@ -17,13 +17,5 @@
17 17 # specific language governing permissions and limitations
18 18 # under the License.
19 19
20   -if [ -z "$DERBY_HOME" ]; then
21   - echo "Error: DERBY_HOME is not set. Please set the DERBY_HOME environment variable"
22   - echo "to the location of your Derby installation."
23   - exit 1
24   -fi
25   -
26   -. $DERBY_HOME/bin/derby_common.sh
27   -
28 20 derby_exec_command="exec \"$JAVACMD\" $DERBY_OPTS -classpath \"$LOCALCLASSPATH\" org.apache.derby.drda.NetworkServerControl shutdown $@"
29 21 eval $derby_exec_command
8 bin/sysinfo → bin/templates/sysinfo
@@ -17,13 +17,5 @@
17 17 # specific language governing permissions and limitations
18 18 # under the License.
19 19
20   -if [ -z "$DERBY_HOME" ]; then
21   - echo "Error: DERBY_HOME is not set. Please set the DERBY_HOME environment variable"
22   - echo "to the location of your Derby installation."
23   - exit 1
24   -fi
25   -
26   -. $DERBY_HOME/bin/derby_common.sh
27   -
28 20 derby_exec_command="exec \"$JAVACMD\" $DERBY_OPTS -classpath \"$LOCALCLASSPATH\" org.apache.derby.tools.sysinfo $@"
29 21 eval $derby_exec_command
48 build.xml
@@ -32,7 +32,7 @@
32 32
33 33 <!-- Targets -->
34 34
35   - <target name="buildsource" depends="checkCompilerLevel,init,prebuild,setCompilerProperties,jsr169stubs,jdbc3stubs,jdbc4stubs,felixStubs,engine,storeless,tools,drda,client,build,versioninfo,localeinfo"/>
  35 + <target name="buildsource" depends="checkCompilerLevel,init,prebuild,setCompilerProperties,jsr169stubs,jdbc3stubs,jdbc4stubs,felixStubs,engine,storeless,tools,drda,client,build,versioninfo,localeinfo,binscripts"/>
36 36 <target name="all" depends="buildsource,demo,testing,pptesting,runmessagecheck"/>
37 37
38 38 <!-- ==================================================================== -->
@@ -728,6 +728,44 @@
728 728 </target>
729 729
730 730 <!-- =================================================================== -->
  731 +<!-- Build the Unix shell scripts under bin -->
  732 +<!-- =================================================================== -->
  733 +
  734 +<target name="binscripts">
  735 + <antcall target="makebinscript">
  736 + <param name="script" value="dblook"/>
  737 + </antcall>
  738 +
  739 + <antcall target="makebinscript">
  740 + <param name="script" value="ij"/>
  741 + </antcall>
  742 +
  743 + <antcall target="makebinscript">
  744 + <param name="script" value="sysinfo"/>
  745 + </antcall>
  746 +
  747 + <antcall target="makebinscript">
  748 + <param name="script" value="NetworkServerControl"/>
  749 + </antcall>
  750 +
  751 + <antcall target="makebinscript">
  752 + <param name="script" value="startNetworkServer"/>
  753 + </antcall>
  754 +
  755 + <antcall target="makebinscript">
  756 + <param name="script" value="stopNetworkServer"/>
  757 + </antcall>
  758 +</target>
  759 +
  760 +<target name="makebinscript">
  761 + <concat destfile="bin/${script}">
  762 + <fileset file="bin/templates/derby_common.sh"/>
  763 + <fileset file="bin/templates/${script}"/>
  764 + </concat>
  765 + <chmod perm="+x" file="bin/${script}"/>
  766 +</target>
  767 +
  768 +<!-- =================================================================== -->
731 769 <!-- Remove generated message files -->
732 770 <!-- =================================================================== -->
733 771 <target name="cleanmessages">
@@ -1835,23 +1873,23 @@
1835 1873 <property file="${basedir}/snapshot/maintversion.properties"/>
1836 1874 <zip destfile="${basedir}/snapshot/db-derby-snapshot-${major}.${minor}.${interim}.${point}-${changenumber}.zip">
1837 1875 <zipfileset prefix="db-derby-snapshot-${major}.${minor}.${interim}.${point}-${changenumber}/lib" dir="${basedir}/jars/insane" includes="*.jar,*.war"/>
1838   - <zipfileset prefix="db-derby-snapshot-${major}.${minor}.${interim}.${point}-${changenumber}" dir="${basedir}" includes="bin/**,LICENSE,NOTICE,README,javadoc/publishedapi/**"/>
  1876 + <zipfileset prefix="db-derby-snapshot-${major}.${minor}.${interim}.${point}-${changenumber}" dir="${basedir}" includes="bin/**,LICENSE,NOTICE,README,javadoc/publishedapi/**" excludes="bin/templates/**"/>
1839 1877 </zip>
1840 1878 <tar destfile="${basedir}/snapshot/db-derby-snapshot-${major}.${minor}.${interim}.${point}-${changenumber}.tar.gz"
1841 1879 compression="gzip">
1842 1880 <tarfileset prefix="db-derby-snapshot-${major}.${minor}.${interim}.${point}-${changenumber}/lib" dir="${basedir}/jars/insane" includes="*.jar,*.war"/>
1843   - <tarfileset prefix="db-derby-snapshot-${major}.${minor}.${interim}.${point}-${changenumber}" dir="${basedir}" includes="bin,LICENSE,NOTICE,README,javadoc/publishedapi/**"/>
  1881 + <tarfileset prefix="db-derby-snapshot-${major}.${minor}.${interim}.${point}-${changenumber}" dir="${basedir}" includes="bin/**,LICENSE,NOTICE,README,javadoc/publishedapi/**" excludes="bin/templates/**"/>
1844 1882 </tar>
1845 1883
1846 1884 <!-- debug archives - DERBY-178 -->
1847 1885 <zip destfile="${basedir}/snapshot/db-derby-snapshot-debug-${major}.${minor}.${interim}.${point}-${changenumber}.zip">
1848 1886 <zipfileset prefix="db-derby-snapshot-debug-${major}.${minor}.${interim}.${point}-${changenumber}/lib" dir="${basedir}/jars/sane" includes="*.jar,*.war"/>
1849   - <zipfileset prefix="db-derby-snapshot-debug-${major}.${minor}.${interim}.${point}-${changenumber}" dir="${basedir}" includes="bin/**,LICENSE,NOTICE,CHANGES,README,javadoc/publishedapi/**"/>
  1887 + <zipfileset prefix="db-derby-snapshot-debug-${major}.${minor}.${interim}.${point}-${changenumber}" dir="${basedir}" includes="bin/**,LICENSE,NOTICE,CHANGES,README,javadoc/publishedapi/**" excludes="bin/templates/**"/>
1850 1888 </zip>
1851 1889 <tar destfile="${basedir}/snapshot/db-derby-snapshot-debug-${major}.${minor}.${interim}.${point}-${changenumber}.tar.gz"
1852 1890 compression="gzip">
1853 1891 <tarfileset prefix="db-derby-snapshot-debug-${major}.${minor}.${interim}.${point}-${changenumber}/lib" dir="${basedir}/jars/sane" includes="*.jar,*.war"/>
1854   - <tarfileset prefix="db-derby-snapshot-debug-${major}.${minor}.${interim}.${point}-${changenumber}" dir="${basedir}" includes="bin/**,LICENSE,NOTICE,README,javadoc/publishedapi/**"/>
  1892 + <tarfileset prefix="db-derby-snapshot-debug-${major}.${minor}.${interim}.${point}-${changenumber}" dir="${basedir}" includes="bin/**,LICENSE,NOTICE,README,javadoc/publishedapi/**" excludes="bin/templates/**"/>
1855 1893 </tar>
1856 1894
1857 1895 <copy file="${basedir}/jars/insane/derby_core_plugin_${major}.${minor}.${interim}.zip"
4 tools/release/build.xml
@@ -156,7 +156,7 @@
156 156 <zipfileset dir="${basedir}" includes="index.html" prefix="${derby.bin}/"/>
157 157 <!-- bin -->
158 158 <zipfileset dir="${basedir}/bin" prefix="${derby.bin}/bin"
159   - filemode="755" includes="*"/>
  159 + filemode="755" includes="*" excludes="templates"/>
160 160 <!-- demo -->
161 161 <zipfileset file="${derby.demo.src.dir}/README.txt"
162 162 fullpath="${derby.bin}/demo/README.txt"/>
@@ -213,7 +213,7 @@
213 213 <tarfileset dir="${basedir}" includes="index.html" prefix="${derby.bin}/"/>
214 214 <!-- bin -->
215 215 <tarfileset dir="${basedir}/bin" prefix="${derby.bin}/bin"
216   - mode="755" includes="*"/>
  216 + mode="755" includes="*" excludes="templates"/>
217 217 <!-- demo -->
218 218 <tarfileset file="${derby.demo.src.dir}/README.txt"
219 219 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.