[javatools] 01/04: add patch to handle source folders with spaces

Tony Mancill tmancill at moszumanska.debian.org
Sun Oct 18 01:18:45 UTC 2015


This is an automated email from the git hooks/post-receive script.

tmancill pushed a commit to branch master
in repository javatools.

commit 249da5fd1a50b36cbca2405c8da3fabcb6b17fc6
Author: tony mancill <tmancill at debian.org>
Date:   Sat Oct 17 14:20:14 2015 -0700

    add patch to handle source folders with spaces
    
    Closes: #799375
---
 jh_build | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/jh_build b/jh_build
index 6e99dee..cd5834c 100755
--- a/jh_build
+++ b/jh_build
@@ -73,13 +73,13 @@ function dobuild()
 	jarfile="$1"
 	shift
 	ext="`basename "$jarfile" .jar`"
-	srcdirs=
-	srcfiles=
+	srcdirs=()
+	srcfiles=()
 	while [ -n "$1" ]; do 
 		if [ -f "$1" ]; then
-			srcfiles="$srcfiles $1"
+			srcfiles+=("$1")
 		elif [ -d "$1" ]; then
-			srcdirs="$srcdirs $1"
+			srcdirs+=("$1")
 		else
 			echo "Ignoring $1 because it does not exist"
 		fi
@@ -110,32 +110,32 @@ function dobuild()
 	if [ -n "$srcdirs" ]; then
 
 		if [ -z "`getarg q quiet`" ]; then
-			echo find $srcdirs -name '*.java' -and -type f -print0 '|' xargs -0 $JAVAC -g -cp $CLASSPATH:debian/_jh_build.$ext -d debian/_jh_build.$ext $JH_JAVAC_OPTS $srcfiles
+			echo find "${srcdirs[@]}" -name '*.java' -and -type f -print0 '|' xargs -0 $JAVAC -g -cp $CLASSPATH:debian/_jh_build.$ext -d debian/_jh_build.$ext $JH_JAVAC_OPTS "${srcfiles[@]}"
 		fi
 
-		find $srcdirs -name '*.java' -and -type f -print0 | xargs -0 $JAVAC -g -cp $CLASSPATH:debian/_jh_build.$ext -d debian/_jh_build.$ext $JH_JAVAC_OPTS $srcfiles
+		find "${srcdirs[@]}" -name '*.java' -and -type f -print0 | xargs -0 $JAVAC -g -cp $CLASSPATH:debian/_jh_build.$ext -d debian/_jh_build.$ext $JH_JAVAC_OPTS "${srcfiles[@]}"
 
 		if [ -n "`getarg J javadoc`" ] || [ -z "`getarg N no-javadoc`" ]; then
 			if [ -z "`getarg q quiet`" ]; then
-				echo find $srcdirs -name '*.java' -and -type f -print0 '|' xargs -0 $JAVADOC $CLASSPATHDOCS -classpath $CLASSPATH:debian/_jh_build.$ext -d debian/_jh_build.javadoc/api -quiet $JH_JAVADOC_OPTS $srcfiles
+				echo find "${srcdirs[@]}" -name '*.java' -and -type f -print0 '|' xargs -0 $JAVADOC $CLASSPATHDOCS -classpath $CLASSPATH:debian/_jh_build.$ext -d debian/_jh_build.javadoc/api -quiet $JH_JAVADOC_OPTS "${srcfiles[@]}"
 			fi
 
-			find $srcdirs -name '*.java' -and -type f -print0 | xargs -0 $JAVADOC $CLASSPATHDOCS -classpath $CLASSPATH:debian/_jh_build.$ext -d debian/_jh_build.javadoc/api -quiet $JH_JAVADOC_OPTS $srcfiles
+			find "${srcdirs[@]}" -name '*.java' -and -type f -print0 | xargs -0 $JAVADOC $CLASSPATHDOCS -classpath $CLASSPATH:debian/_jh_build.$ext -d debian/_jh_build.javadoc/api -quiet $JH_JAVADOC_OPTS "${srcfiles[@]}"
 		fi
 
 	elif [ -n "$srcfiles" ]; then
 
 		if [ -z "`getarg q quiet`" ]; then
-			echo $JAVAC -g -cp $CLASSPATH:debian/_jh_build.$ext -d debian/_jh_build.$ext $JH_JAVAC_OPTS $srcfiles
+			echo $JAVAC -g -cp $CLASSPATH:debian/_jh_build.$ext -d debian/_jh_build.$ext $JH_JAVAC_OPTS "${srcfiles[@]}"
 		fi
 
-		$JAVAC -g -cp $CLASSPATH:debian/_jh_build.$ext -d debian/_jh_build.$ext $JH_JAVAC_OPTS $srcfiles
+		$JAVAC -g -cp $CLASSPATH:debian/_jh_build.$ext -d debian/_jh_build.$ext $JH_JAVAC_OPTS "${srcfiles[@]}"
 
 		if [ -n "`getarg J javadoc`" ] || [ -z "`getarg N no-javadoc`" ]; then
 			if [ -z "`getarg q quiet`" ]; then
-				echo $JAVADOC $CLASSPATHDOCS -classpath $CLASSPATH:debian/_jh_build.$ext -d debian/_jh_build.javadoc/api -quiet $JH_JAVADOC_OPTS $srcfiles
+				echo $JAVADOC $CLASSPATHDOCS -classpath $CLASSPATH:debian/_jh_build.$ext -d debian/_jh_build.javadoc/api -quiet $JH_JAVADOC_OPTS "${srcfiles[@]}"
 			fi
-			$JAVADOC $CLASSPATHDOCS -classpath $CLASSPATH:debian/_jh_build.$ext -d debian/_jh_build.javadoc/api -quiet $JH_JAVADOC_OPTS $srcfiles
+			$JAVADOC $CLASSPATHDOCS -classpath $CLASSPATH:debian/_jh_build.$ext -d debian/_jh_build.javadoc/api -quiet $JH_JAVADOC_OPTS "${srcfiles[@]}"
 		fi
 
 	else

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/javatools.git



More information about the pkg-java-commits mailing list