[oe-commits] : java.bbclass: Make oe_makeclasspath behavior more sane.

OE GIT Trial gittrial at amethyst.openembedded.net
Tue Oct 7 23:57:38 UTC 2008


Module: org.openembedded.dev.git
Branch: org.openembedded.dev
Commit: 55d94b8d695b157bbf3a88066b256ff561f7d0c9
URL:    http://gitweb.openembedded.net/?p=org.openembedded.dev.git&a=commit;h=55d94b8d695b157bbf3a88066b256ff561f7d0c9

Author:  <thebohemian at openembedded.org>
Date:   Tue Oct  7 21:08:06 2008 +0000

java.bbclass: Make oe_makeclasspath behavior more sane.
 * return oe_makeclasspath result in variable
 * check for file existence only when -s is given

---

 classes/java.bbclass |   26 +++++++++++++++++---------
 1 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/classes/java.bbclass b/classes/java.bbclass
index 11a2bf5..620dae7 100644
--- a/classes/java.bbclass
+++ b/classes/java.bbclass
@@ -70,19 +70,27 @@ oe_jarinstall() {
 
 oe_makeclasspath() {
   # Purpose: Generate a classpath variable from the given Jar file names
-  # where the ".jar" has been omitted.
+  # where the ".jar" has been omitted. The string is stored in the script
+  # variable whose name is given in the first argument to this function.
   #
-  # oe_makeclasspath foo baz bar
-  # Prints ${datadir_java}/foo.jar:${datadir_java}/baz.jar:${datadir_java}/bar.jar
-  #
-  # oe_makeclasspath -s foo baz bar
-  # Prints ${STAGING_DATADIR_JAVA}/foo.jar:${STAGING_DATADIR_JAVA}/baz.jar:${STAGING_DATADIR_JAVA}/bar.jar
+  # oe_makeclasspath cp foo baz bar
+  # Stores ${datadir_java}/foo.jar:${datadir_java}/baz.jar:${datadir_java}/bar.jar
+	# in variable "cp".
   #
+  # oe_makeclasspath bootcp -s foo baz bar
+  # Stores ${STAGING_DATADIR_JAVA}/foo.jar:${STAGING_DATADIR_JAVA}/baz.jar:${STAGING_DATADIR_JAVA}/bar.jar
+	# in variable "bootcp".
+	# 
   # Provide the -s at the beginning otherwise strange things happen.
-  #
+	# If -s is given the function checks whether the requested jar file exists
+	#	and exits with an error message if it cannot be found.
+	#
   dir=${datadir_java}
 	classpath=
 	delimiter=
+	retval=$1
+
+	shift
 
   while [ "$#" -gt 0 ]; do
     case "$1" in
@@ -95,7 +103,7 @@ oe_makeclasspath() {
     *)
       file=$dir/$1.jar
 
-			if [ ! -f $file ]; then
+			if [ -z "$dir" -a ! -f $file ]; then
 				oefatal "oe_makeclasspath: Jar file for '$1' not found at $file"
 			fi
 
@@ -106,7 +114,7 @@ oe_makeclasspath() {
     shift
   done
 
-	echo $classpath
+	eval $retval="$classpath"
 }
 
 # Creates a simple wrapper script for your Java program.





More information about the Openembedded-commits mailing list