diff options
| author | Paul Eggleton <bluelightning@bluelightning.org> | 2008-10-08 19:07:08 +0000 |
|---|---|---|
| committer | Paul Eggleton <bluelightning@bluelightning.org> | 2008-10-08 19:07:08 +0000 |
| commit | bfc178f2ca021d618aa5bfa225c13bd4269c1e33 (patch) | |
| tree | d44628cdd697bb41748e8b5e58adf6e81afed81f /classes | |
| parent | 7924bb1416f9cab4ae68630e2ac971ed2699330e (diff) | |
| parent | 8a3e21cc84fb3fc6c661089156287b82099eede5 (diff) | |
merge of '88676b03209e4a8147b6f9ab4d6f5c66d0132128'
and 'bcae381ccf0226faafe756ae8699c9b1623bf951'
Diffstat (limited to 'classes')
| -rw-r--r-- | classes/base.bbclass | 2 | ||||
| -rw-r--r-- | classes/java.bbclass | 26 |
2 files changed, 18 insertions, 10 deletions
diff --git a/classes/base.bbclass b/classes/base.bbclass index ac73e909f8..1a7ef4f143 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -636,7 +636,7 @@ def oe_unpack_file(file, data, url = None): cmd = 'gzip -dc %s > %s' % (file, efile) elif file.endswith('.bz2'): cmd = 'bzip2 -dc %s > %s' % (file, efile) - elif file.endswith('.zip'): + elif file.endswith('.zip') or file.endswith('.jar'): cmd = 'unzip -q -o' (type, host, path, user, pswd, parm) = bb.decodeurl(url) if 'dos' in parm: diff --git a/classes/java.bbclass b/classes/java.bbclass index 11a2bf5c0c..620dae79fb 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. |
