From a96b9536990a2789d20bba6982a2ed933e25d176 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20NOBILI?= Date: Tue, 12 Mar 2024 11:00:10 +0100 Subject: [PATCH] fix: sample code doesn't run from Debian package --- sample/hsqldb/bin/lsc-sample | 8 +++++++- sample/ldap2hsqldb/bin/lsc-sample | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) mode change 100644 => 100755 sample/ldap2hsqldb/bin/lsc-sample diff --git a/sample/hsqldb/bin/lsc-sample b/sample/hsqldb/bin/lsc-sample index 86d17964..24e17213 100755 --- a/sample/hsqldb/bin/lsc-sample +++ b/sample/hsqldb/bin/lsc-sample @@ -58,7 +58,9 @@ if [ ${SAMPLE_HOME:0:1} != "/" ] ; then fi # HSQLDB jar file -HSQLDB_LIB=`ls $SAMPLE_HOME/../../lib/hsqldb*.jar` +[ -z "$HSQLDB_LIB" -a -e $SAMPLE_HOME/../../lib/hsqldb*.jar ] && HSQLDB_LIB=`ls $SAMPLE_HOME/../../lib/hsqldb*.jar` +[ -z "$HSQLDB_LIB" -a -e $SAMPLE_HOME/../lib/lsc/hsqldb*.jar ] && HSQLDB_LIB=`ls $SAMPLE_HOME/../lib/lsc/hsqldb*.jar` +[ -z "$HSQLDB_LIB" ] && echo "hsqldb driver (hsqldb*.jar) is missing" && exit 1 # Temporary directory so that HSQLDB server could store files HSQLDB_DIR=/tmp/lsc/hsqldb # HSQLDB configuration file @@ -243,6 +245,10 @@ run_java_command() LDAPCP="$LDAPCP:$jar" done + for jar in "$SAMPLE_HOME"/../lib/lsc/*.jar; do + LDAPCP="$LDAPCP:$jar" + done + # is this Cygwin? if so, convert path to Windows format for the JVM CYGPATH_COMMAND="$(which cygpath 2>/dev/null)" if [ -e "$CYGPATH_COMMAND" ]; then diff --git a/sample/ldap2hsqldb/bin/lsc-sample b/sample/ldap2hsqldb/bin/lsc-sample old mode 100644 new mode 100755 index c70f0c2c..bab01188 --- a/sample/ldap2hsqldb/bin/lsc-sample +++ b/sample/ldap2hsqldb/bin/lsc-sample @@ -58,7 +58,9 @@ if [ ${SAMPLE_HOME:0:1} != "/" ] ; then fi # HSQLDB jar file -HSQLDB_LIB=`ls $SAMPLE_HOME/../../lib/hsqldb*.jar` +[ -z "$HSQLDB_LIB" -a -e $SAMPLE_HOME/../../lib/hsqldb*.jar ] && HSQLDB_LIB=`ls $SAMPLE_HOME/../../lib/hsqldb*.jar` +[ -z "$HSQLDB_LIB" -a -e $SAMPLE_HOME/../lib/lsc/hsqldb*.jar ] && HSQLDB_LIB=`ls $SAMPLE_HOME/../lib/lsc/hsqldb*.jar` +[ -z "$HSQLDB_LIB" ] && echo "hsqldb driver (hsqldb*.jar) is missing" && exit 1 # Temporary directory so that HSQLDB server could store files HSQLDB_DIR=/tmp/lsc/hsqldb # HSQLDB configuration file @@ -182,6 +184,10 @@ run_java_command() LDAPCP="$LDAPCP:$jar" done + for jar in "$SAMPLE_HOME"/../lib/lsc/*.jar; do + LDAPCP="$LDAPCP:$jar" + done + # is this Cygwin? if so, convert path to Windows format for the JVM CYGPATH_COMMAND="$(which cygpath 2>/dev/null)" if [ -e "$CYGPATH_COMMAND" ]; then