[
https://issues.apache.org/jira/browse/DERBY-3207?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Knut Anders Hatlen updated DERBY-3207:
--------------------------------------
Attachment: d3207.diff
d3207.stat
Here's a patch that addresses this issue. Before the patch can be applied, the
original scripts must be moved from the bin directory to a new directory called
bin/templates. Use the following commands to do that:
mkdir bin/templates
svn add bin/templates
svn mv bin/dblook bin/templates/
svn mv bin/ij bin/templates/
svn mv bin/sysinfo bin/templates/
svn mv bin/NetworkServerControl bin/templates/
svn mv bin/startNetworkServer bin/templates/
svn mv bin/stopNetworkServer bin/templates/
svn mv bin/derby_common.sh bin/templates/
Then the patch can be applied. The patch will make the following changes:
*** build.xml:
- add a target that prepends the contents of derby_common.sh to each of the
scripts in bin/templates/ and puts the resulting concatenated scripts directly
under bin/
- exclude the bin/template directory from the archives produced by "ant
snapshot"
*** tools/release/build.xml:
- exclude the bin/template directory from the bin archives created by "ant
release"
***
bin/templates/{ij,dblook,sysinfo,startNetworkServer,stopNetworkServer,NetworkServerControl}:
- removed the following section from all the files, since the content of
derby_common.sh will now be included directly in the scripts:
-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
> The bin scripts should be able to run when DERBY_HOME is not set
> ----------------------------------------------------------------
>
> Key: DERBY-3207
> URL: https://issues.apache.org/jira/browse/DERBY-3207
> Project: Derby
> Issue Type: Improvement
> Components: Demos/Scripts
> Affects Versions: 10.4.1.3
> Reporter: Knut Anders Hatlen
> Assignee: Knut Anders Hatlen
> Priority: Minor
> Attachments: d3207.diff, d3207.stat
>
>
> The scripts under bin should be able to run without requiring the users to
> set DERBY_HOME explicitly. The script derby_common.sh, which is sourced by
> all the scripts under bin, contains code to detect DERBY_HOME based on the
> value of $0, but since the scripts need to know DERBY_HOME in order to source
> derby_common.sh, they still fail when DERBY_HOME is not set.
> When I removed this part of bin/ij
> -------
> 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
> -------
> and in-lined the code in derby_common.sh in its place, I was able to run ij
> successfully by typing the command './bin/ij' without setting DERBY_HOME
> first.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.