mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-11-07 18:07:08 -08:00
java-utils-2.eclass: Added new function java-pkg_gen-cp
Java package generate classpath will create a classpath based on special variable CP_DEPEND in the ebuild. This allows for automatic classpath creation based on depends. Reduces chance of error in ebuild with slots in deps not matching slots in classpath variable, etc. Not to most elegant. Elected for multiple passes using bash vs external sed or awk. Closes: https://github.com/gentoo/gentoo/pull/2286 Signed-off-by: James Le Cuirot <chewi@gentoo.org>
This commit is contained in:
@@ -2886,3 +2886,28 @@ java-pkg_clean() {
|
||||
find "${@}" '(' -name '*.class' -o -name '*.jar' ')' -type f -delete -print || die
|
||||
fi
|
||||
}
|
||||
|
||||
# @FUNCTION: java-pkg_gen-cp
|
||||
# @INTERNAL
|
||||
# @DESCRIPTION:
|
||||
# Java package generate classpath will create a classpath based on
|
||||
# special variable CP_DEPEND in the ebuild.
|
||||
#
|
||||
# @CODE
|
||||
# Parameters:
|
||||
# $1 - classpath variable either EANT_GENTOO_CLASSPATH or JAVA_GENTOO_CLASSPATH
|
||||
# @CODE
|
||||
java-pkg_gen-cp() {
|
||||
debug-print-function ${FUNCNAME} "${@}"
|
||||
|
||||
if [[ ${CP_DEPEND} ]]; then
|
||||
local cp="${!1}"
|
||||
local p
|
||||
for p in ${CP_DEPEND}; do
|
||||
p="${p/-[0-9]*:/-}"
|
||||
cp="${cp} ${p#*/}"
|
||||
done
|
||||
cp="${cp//:/-}"
|
||||
[[ ${cp} ]] && export ${1}="${cp//-0/}"
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user