You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by fu...@apache.org on 2006/08/11 07:03:08 UTC

svn commit: r430668 - in /db/derby/code/trunk/bin: ./ NetworkServerControl dblook derby_common.sh ij setEmbeddedCP setNetworkClientCP setNetworkServerCP startNetworkServer stopNetworkServer sysinfo

Author: fuzzylogic
Date: Thu Aug 10 22:03:07 2006
New Revision: 430668

URL: http://svn.apache.org/viewvc?rev=430668&view=rev
Log:
DERBY-1032 (partial): Add Unix scripts to bin directory

Added:
    db/derby/code/trunk/bin/
    db/derby/code/trunk/bin/NetworkServerControl   (with props)
    db/derby/code/trunk/bin/dblook   (with props)
    db/derby/code/trunk/bin/derby_common.sh   (with props)
    db/derby/code/trunk/bin/ij   (with props)
    db/derby/code/trunk/bin/setEmbeddedCP   (with props)
    db/derby/code/trunk/bin/setNetworkClientCP   (with props)
    db/derby/code/trunk/bin/setNetworkServerCP   (with props)
    db/derby/code/trunk/bin/startNetworkServer   (with props)
    db/derby/code/trunk/bin/stopNetworkServer   (with props)
    db/derby/code/trunk/bin/sysinfo   (with props)

Added: db/derby/code/trunk/bin/NetworkServerControl
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/bin/NetworkServerControl?rev=430668&view=auto
==============================================================================
--- db/derby/code/trunk/bin/NetworkServerControl (added)
+++ db/derby/code/trunk/bin/NetworkServerControl Thu Aug 10 22:03:07 2006
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+
+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

Propchange: db/derby/code/trunk/bin/NetworkServerControl
------------------------------------------------------------------------------
    svn:executable = *

Added: db/derby/code/trunk/bin/dblook
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/bin/dblook?rev=430668&view=auto
==============================================================================
--- db/derby/code/trunk/bin/dblook (added)
+++ db/derby/code/trunk/bin/dblook Thu Aug 10 22:03:07 2006
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+
+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.dblook $@"
+eval $derby_exec_command

Propchange: db/derby/code/trunk/bin/dblook
------------------------------------------------------------------------------
    svn:executable = *

Added: db/derby/code/trunk/bin/derby_common.sh
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/bin/derby_common.sh?rev=430668&view=auto
==============================================================================
--- db/derby/code/trunk/bin/derby_common.sh (added)
+++ db/derby/code/trunk/bin/derby_common.sh Thu Aug 10 22:03:07 2006
@@ -0,0 +1,162 @@
+#!/bin/sh
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+
+if [ -n "$derby_common_debug" ] ; then
+  set -x
+fi
+
+# OS specific support.  $var _must_ be set to either true or false.
+cygwin=false;
+darwin=false;
+case "`uname`" in
+  CYGWIN*) cygwin=true ;;
+  Darwin*) darwin=true
+           if [ -z "$JAVA_HOME" ] ; then
+             JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
+           fi
+           ;;
+esac
+
+if [ -z "$DERBY_HOME" -o ! -d "$DERBY_HOME" ] ; then
+  ## resolve links - $0 may be a link to derby's home
+  PRG="$0"
+  progname=`basename "$0"`
+
+  # need this for relative symlinks
+  while [ -h "$PRG" ] ; do
+    ls=`ls -ld "$PRG"`
+    link=`expr "$ls" : '.*-> \(.*\)$'`
+    if expr "$link" : '/.*' > /dev/null; then
+    PRG="$link"
+    else
+    PRG=`dirname "$PRG"`"/$link"
+    fi
+  done
+
+  DERBY_HOME=`dirname "$PRG"`/..
+
+  # make it fully qualified
+  DERBY_HOME=`cd "$DERBY_HOME" && pwd`
+fi
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched
+if $cygwin ; then
+  [ -n "$DERBY_HOME" ] &&
+    DERBY_HOME=`cygpath --unix "$DERBY_HOME"`
+  [ -n "$JAVA_HOME" ] &&
+    JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+fi
+
+# set DERBY_LIB location
+DERBY_LIB="${DERBY_HOME}/lib"
+
+if [ -z "$JAVACMD" ] ; then
+  if [ -n "$JAVA_HOME"  ] ; then
+    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+      # IBM's JDK on AIX uses strange locations for the executables
+      JAVACMD="$JAVA_HOME/jre/sh/java"
+    else
+      JAVACMD="$JAVA_HOME/bin/java"
+    fi
+  else
+    JAVACMD=`which java 2> /dev/null `
+    if [ -z "$JAVACMD" ] ; then
+        JAVACMD=java
+    fi
+  fi
+fi
+
+if [ ! -x "$JAVACMD" ] ; then
+  echo "Error: JAVA_HOME is not defined correctly."
+  echo "  We cannot execute $JAVACMD"
+  exit 1
+fi
+
+# set local classpath, don't overwrite the user's
+LOCALCLASSPATH=$DERBY_LIB/derby.jar:$DERBY_LIB/derbynet.jar:$DERBY_LIB/derbytools.jar:$DERBY_LIB/derbyclient.jar
+
+
+# if CLASSPATH_OVERRIDE env var is set, LOCALCLASSPATH will be
+# user CLASSPATH first and derby-found jars after.
+# In that case, the user CLASSPATH will override derby-found jars
+#
+# if CLASSPATH_OVERRIDE is not set, we'll have the normal behaviour
+# with derby-found jars first and user CLASSPATH after
+if [ -n "$CLASSPATH" ] ; then
+  # merge local and specified classpath 
+  if [ -z "$LOCALCLASSPATH" ] ; then 
+    LOCALCLASSPATH="$CLASSPATH"
+  elif [ -n "$CLASSPATH_OVERRIDE" ] ; then
+    LOCALCLASSPATH="$CLASSPATH:$LOCALCLASSPATH"
+  else
+    LOCALCLASSPATH="$LOCALCLASSPATH:$CLASSPATH"
+  fi
+
+  # remove class path from launcher -cp option
+  CLASSPATH=""
+fi
+
+# For Cygwin, switch paths to appropriate format before running java
+# For PATHs convert to unix format first, then to windows format to ensure
+# both formats are supported. Probably this will fail on directories with ;
+# in the name in the path. Let's assume that paths containing ; are more
+# rare than windows style paths on cygwin.
+if $cygwin; then
+  if [ "$OS" = "Windows_NT" ] && cygpath -m .>/dev/null 2>/dev/null ; then
+    format=mixed
+  else
+    format=windows
+  fi
+  DERBY_HOME=`cygpath --$format "$DERBY_HOME"`
+  DERBY_LIB=`cygpath --$format "$DERBY_LIB"`
+  if [ -n "$JAVA_HOME" ]; then
+    JAVA_HOME=`cygpath --$format "$JAVA_HOME"`
+  fi
+  LCP_TEMP=`cygpath --path --unix "$LOCALCLASSPATH"`
+  LOCALCLASSPATH=`cygpath --path --$format "$LCP_TEMP"`
+  if [ -n "$CLASSPATH" ] ; then
+    CP_TEMP=`cygpath --path --unix "$CLASSPATH"`
+    CLASSPATH=`cygpath --path --$format "$CP_TEMP"`
+  fi
+  CYGHOME=`cygpath --$format "$HOME"`
+fi
+
+# add a second backslash to variables terminated by a backslash under cygwin
+if $cygwin; then
+  case "$DERBY_HOME" in
+    *\\ )
+    DERBY_HOME="$DERBY_HOME\\"
+    ;;
+  esac
+  case "$CYGHOME" in
+    *\\ )
+    CYGHOME="$CYGHOME\\"
+    ;;
+  esac
+  case "$LOCALCLASSPATH" in
+    *\\ )
+    LOCALCLASSPATH="$LOCALCLASSPATH\\"
+    ;;
+  esac
+  case "$CLASSPATH" in
+    *\\ )
+    CLASSPATH="$CLASSPATH\\"
+    ;;
+  esac
+fi

Propchange: db/derby/code/trunk/bin/derby_common.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: db/derby/code/trunk/bin/derby_common.sh
------------------------------------------------------------------------------
    svn:executable = *

Added: db/derby/code/trunk/bin/ij
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/bin/ij?rev=430668&view=auto
==============================================================================
--- db/derby/code/trunk/bin/ij (added)
+++ db/derby/code/trunk/bin/ij Thu Aug 10 22:03:07 2006
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+
+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 $@"
+eval $derby_exec_command

Propchange: db/derby/code/trunk/bin/ij
------------------------------------------------------------------------------
    svn:executable = *

Added: db/derby/code/trunk/bin/setEmbeddedCP
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/bin/setEmbeddedCP?rev=430668&view=auto
==============================================================================
--- db/derby/code/trunk/bin/setEmbeddedCP (added)
+++ db/derby/code/trunk/bin/setEmbeddedCP Thu Aug 10 22:03:07 2006
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+
+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
+
+export CLASSPATH="${DERBY_HOME}/lib/derby.jar:${DERBY_HOME}/lib/derbytools.jar:${CLASSPATH}"

Propchange: db/derby/code/trunk/bin/setEmbeddedCP
------------------------------------------------------------------------------
    svn:executable = *

Added: db/derby/code/trunk/bin/setNetworkClientCP
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/bin/setNetworkClientCP?rev=430668&view=auto
==============================================================================
--- db/derby/code/trunk/bin/setNetworkClientCP (added)
+++ db/derby/code/trunk/bin/setNetworkClientCP Thu Aug 10 22:03:07 2006
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+
+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
+
+export CLASSPATH="${DERBY_HOME}/lib/derbyclient.jar:${DERBY_HOME}/lib/derbytools.jar:${CLASSPATH}"

Propchange: db/derby/code/trunk/bin/setNetworkClientCP
------------------------------------------------------------------------------
    svn:executable = *

Added: db/derby/code/trunk/bin/setNetworkServerCP
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/bin/setNetworkServerCP?rev=430668&view=auto
==============================================================================
--- db/derby/code/trunk/bin/setNetworkServerCP (added)
+++ db/derby/code/trunk/bin/setNetworkServerCP Thu Aug 10 22:03:07 2006
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+
+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
+
+export CLASSPATH="${DERBY_HOME}/lib/derby.jar:${DERBY_HOME}/lib/derbytools.jar:${DERBY_HOME}/lib/derbynet.jar:${CLASSPATH}"

Propchange: db/derby/code/trunk/bin/setNetworkServerCP
------------------------------------------------------------------------------
    svn:executable = *

Added: db/derby/code/trunk/bin/startNetworkServer
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/bin/startNetworkServer?rev=430668&view=auto
==============================================================================
--- db/derby/code/trunk/bin/startNetworkServer (added)
+++ db/derby/code/trunk/bin/startNetworkServer Thu Aug 10 22:03:07 2006
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+
+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

Propchange: db/derby/code/trunk/bin/startNetworkServer
------------------------------------------------------------------------------
    svn:executable = *

Added: db/derby/code/trunk/bin/stopNetworkServer
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/bin/stopNetworkServer?rev=430668&view=auto
==============================================================================
--- db/derby/code/trunk/bin/stopNetworkServer (added)
+++ db/derby/code/trunk/bin/stopNetworkServer Thu Aug 10 22:03:07 2006
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+
+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 stop"
+eval $derby_exec_command

Propchange: db/derby/code/trunk/bin/stopNetworkServer
------------------------------------------------------------------------------
    svn:executable = *

Added: db/derby/code/trunk/bin/sysinfo
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/bin/sysinfo?rev=430668&view=auto
==============================================================================
--- db/derby/code/trunk/bin/sysinfo (added)
+++ db/derby/code/trunk/bin/sysinfo Thu Aug 10 22:03:07 2006
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+
+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

Propchange: db/derby/code/trunk/bin/sysinfo
------------------------------------------------------------------------------
    svn:executable = *