summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetteri Räty <betelgeuse@gentoo.org>2007-01-15 21:03:24 +0000
committerPetteri Räty <betelgeuse@gentoo.org>2007-01-15 21:03:24 +0000
commit14d5b06866cb28a3faea7d7c82e13f499309295d (patch)
tree4f7a3c9da5971ef02ed5398bb8860de01bec09b3 /eclass/java-utils-2.eclass
parentchanged dependencies as per bug# 162205 (diff)
downloadgentoo-2-14d5b06866cb28a3faea7d7c82e13f499309295d.tar.gz
gentoo-2-14d5b06866cb28a3faea7d7c82e13f499309295d.tar.bz2
gentoo-2-14d5b06866cb28a3faea7d7c82e13f499309295d.zip
Added --with-dependencies option to jar-from and getjars and made dojar warn when overwriting an existing destination jar.
Diffstat (limited to 'eclass/java-utils-2.eclass')
-rw-r--r--eclass/java-utils-2.eclass23
1 files changed, 20 insertions, 3 deletions
diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
index 6aeaf27dc2c7..41b382158969 100644
--- a/eclass/java-utils-2.eclass
+++ b/eclass/java-utils-2.eclass
@@ -6,7 +6,7 @@
#
# Licensed under the GNU General Public License, v2
#
-# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.42 2007/01/15 00:01:21 caster Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.43 2007/01/15 21:03:24 betelgeuse Exp $
# -----------------------------------------------------------------------------
@@ -183,6 +183,13 @@ java-pkg_dojar() {
# check if it exists
if [[ -e "${jar}" ]] ; then
+ # Don't overwrite if jar has already been installed with the same
+ # name
+ local dest="${D}${JAVA_PKG_JARDEST}/${jar_basename}"
+ if [[ -e "${dest}" ]]; then
+ ewarn "Overwriting ${dest}"
+ fi
+
# install it into JARDEST if it's a non-symlink
if [[ ! -L "${jar}" ]] ; then
INSDESTTREE="${JAVA_PKG_JARDEST}" \
@@ -732,6 +739,11 @@ java-pkg_jar-from() {
shift
fi
+ if [[ "${1}" = "--with-dependencies" ]]; then
+ local deep="--with-dependencies"
+ shift
+ fi
+
local target_pkg="${1}" target_jar="${2}" destjar="${3}"
[[ -z ${target_pkg} ]] && die "Must specify a package"
@@ -741,7 +753,7 @@ java-pkg_jar-from() {
local error_msg="There was a problem getting the classpath for ${target_pkg}."
local classpath
- classpath="$(java-config --classpath=${target_pkg})"
+ classpath="$(java-config ${deep} --classpath=${target_pkg})"
[[ $? != 0 ]] && die ${error_msg}
local jar
@@ -812,10 +824,15 @@ java-pkg_getjars() {
shift
fi
+ if [[ "${1}" = "--with-dependencies" ]]; then
+ local deep="--with-dependencies"
+ shift
+ fi
+
[[ ${#} -ne 1 ]] && die "${FUNCNAME} takes only one argument besides --build-only"
local classpath pkgs="${1}"
- jars="$(java-config --classpath=${pkgs})"
+ jars="$(java-config ${deep} --classpath=${pkgs})"
[[ -z "${jars}" ]] && die "java-config --classpath=${pkgs} failed"
debug-print "${pkgs}:${jars}"