File: setcp.sh

package info (click to toggle)
libdsiutils-java 2.7.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,956 kB
  • sloc: java: 33,461; xml: 407; makefile: 51; sh: 50
file content (18 lines) | stat: -rwxr-xr-x 548 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
JAR=dsiutils

sourcedir=$(cd $(dirname ${BASH_ARGV[0]}) && pwd) 
count=$(\ls -1 $sourcedir/$JAR-*.jar 2>/dev/null | wc -l)

if (( count == 0 )); then
	echo "WARNING: no $JAR jar file."
elif (( count > 1 )); then
	echo "WARNING: several $JAR jar files ($(\ls -m $JAR-*.jar))"
else
	if echo $CLASSPATH | grep -q slf4j; then
		deps=$(\ls -1 $sourcedir/jars/test/*.jar | grep -v slf4j | paste -d: -s)
	else
		deps=$(\ls -1 $sourcedir/jars/test/*.jar | paste -d: -s)
	fi

	export CLASSPATH=$(ls -1 $sourcedir/$JAR-*.jar | tail -n 1):$deps:$CLASSPATH
fi