chewi 15/04/28 20:35:40
Modified: ChangeLog ant-tasks.eclass java-pkg-2.eclass
java-utils-2.eclass
Log:
Skip java-dep-check for ant tasks wrt bug #298955. Fix missing
ant-core dependency SLOT. Fix recording of BUILD_DEPEND. Fix
java-pkg_ensure-dep matching and adjust the error message. Fix
automatic loading of ant-junit and junit wrt bug #513522 among others.
Revision Changes Path
1.1597 eclass/ChangeLog
file :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1597&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1597&content-type=text/plain
diff :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.1596&r2=1.1597
Index: ChangeLog
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v
retrieving revision 1.1596
retrieving revision 1.1597
diff -u -r1.1596 -r1.1597
--- ChangeLog 28 Apr 2015 14:14:29 -0000 1.1596
+++ ChangeLog 28 Apr 2015 20:35:40 -0000 1.1597
@@ -1,6 +1,13 @@
# ChangeLog for eclass directory
# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1596 2015/04/28
14:14:29 kensington Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1597 2015/04/28
20:35:40 chewi Exp $
+
+ 28 Apr 2015; James Le Cuirot <[email protected]> java-pkg-2.eclass,
+ java-utils-2.eclass, ant-tasks.eclass:
+ Skip java-dep-check for ant tasks wrt bug #298955. Fix missing ant-core
+ dependency SLOT. Fix recording of BUILD_DEPEND. Fix java-pkg_ensure-dep
+ matching and adjust the error message. Fix automatic loading of ant-junit and
+ junit wrt bug #513522 among others.
28 Apr 2015; Michael Palimaka <[email protected]> kde4-base.eclass:
Update SRC_URI.
1.17 eclass/ant-tasks.eclass
file :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ant-tasks.eclass?rev=1.17&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ant-tasks.eclass?rev=1.17&content-type=text/plain
diff :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ant-tasks.eclass?r1=1.16&r2=1.17
Index: ant-tasks.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ant-tasks.eclass,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- ant-tasks.eclass 5 Oct 2013 12:07:01 -0000 1.16
+++ ant-tasks.eclass 28 Apr 2015 20:35:40 -0000 1.17
@@ -1,9 +1,9 @@
# Eclass for building dev-java/ant-* packages
#
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License, v2 or later
# Author Vlastimil Babka <[email protected]>
-# $Header: /var/cvsroot/gentoo-x86/eclass/ant-tasks.eclass,v 1.16 2013/10/05
12:07:01 caster Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ant-tasks.eclass,v 1.17 2015/04/28
20:35:40 chewi Exp $
# @ECLASS: ant-tasks.eclass
# @MAINTAINER:
@@ -98,7 +98,7 @@
LICENSE="Apache-2.0"
SLOT="0"
-RDEPEND="~dev-java/ant-core-${PV}"
+RDEPEND="~dev-java/ant-core-${PV}:0"
DEPEND="${RDEPEND}"
if [[ -z "${ANT_TASK_DISABLE_VM_DEPS}" ]]; then
1.40 eclass/java-pkg-2.eclass
file :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/java-pkg-2.eclass?rev=1.40&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/java-pkg-2.eclass?rev=1.40&content-type=text/plain
diff :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/java-pkg-2.eclass?r1=1.39&r2=1.40
Index: java-pkg-2.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/java-pkg-2.eclass,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- java-pkg-2.eclass 21 Jul 2012 11:57:30 -0000 1.39
+++ java-pkg-2.eclass 28 Apr 2015 20:35:40 -0000 1.40
@@ -1,11 +1,11 @@
# Eclass for Java packages
#
# Copyright (c) 2004-2005, Thomas Matthijs <[email protected]>
-# Copyright (c) 2004-2011, Gentoo Foundation
+# Copyright (c) 2004-2015, Gentoo Foundation
#
# Licensed under the GNU General Public License, v2
#
-# $Header: /var/cvsroot/gentoo-x86/eclass/java-pkg-2.eclass,v 1.39 2012/07/21
11:57:30 sera Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/java-pkg-2.eclass,v 1.40 2015/04/28
20:35:40 chewi Exp $
# @ECLASS: java-pkg-2.eclass
# @MAINTAINER:
@@ -123,33 +123,40 @@
[[ -e "${EANT_BUILD_XML:=build.xml}" ]] || return
if [[ ${EANT_TEST_TARGET} ]] || java-pkg-2_supports-test
${EANT_BUILD_XML}; then
- local opts task
+ local opts task_re junit_re pkg
if [[ ${EANT_TEST_JUNIT_INTO} ]]; then
java-pkg_jar-from --into "${EANT_TEST_JUNIT_INTO}" junit
fi
+ if [[ ${EANT_TEST_GENTOO_CLASSPATH} ]]; then
+ EANT_GENTOO_CLASSPATH="${EANT_TEST_GENTOO_CLASSPATH}"
+ fi
+
ANT_TASKS=${EANT_TEST_ANT_TASKS:-${ANT_TASKS:-${EANT_ANT_TASKS}}}
- if [[ ${DEPEND} = *dev-java/ant-junit* ]]; then
+ task_re="\bdev-java/ant-junit(4)?(-[^:]+)?(:\S+)\b"
+ junit_re="\bdev-java/junit(-[^:]+)?(:\S+)\b"
+
+ if [[ ${DEPEND} =~ ${task_re} ]]; then
+ pkg="ant-junit${BASH_REMATCH[1]}${BASH_REMATCH[3]}"
+ pkg="${pkg%:0}"
if [[ ${ANT_TASKS} && "${ANT_TASKS}" != none ]]; then
- ANT_TASKS="${ANT_TASKS} ant-junit"
+ ANT_TASKS="${ANT_TASKS} ${pkg}"
else
- ANT_TASKS="ant-junit"
+ ANT_TASKS="${pkg}"
fi
+ elif [[ ${DEPEND} =~ ${junit_re} ]]; then
+ pkg="junit${BASH_REMATCH[2]}"
+ pkg="${pkg%:0}"
- task=true
- fi
+ opts="-Djunit.jar=\"$(java-pkg_getjar ${pkg}
junit.jar)\""
- if [[ ${task} ]] || [[ ${DEPEND} = *dev-java/junit* ]]; then
- opts="-Djunit.jar=\"$(java-pkg_getjar junit
junit.jar)\""
- if [[ ${EANT_TEST_GENTOO_CLASSPATH} ]]; then
-
EANT_GENTOO_CLASSPATH="${EANT_TEST_GENTOO_CLASSPATH},junit"
- elif [[ ${EANT_GENTOO_CLASSPATH} ]]; then
- EANT_GENTOO_CLASSPATH+=',junit'
+ if [[ ${EANT_GENTOO_CLASSPATH} ]]; then
+ EANT_GENTOO_CLASSPATH+=",${pkg}"
else
- EANT_GENTOO_CLASSPATH=junit
+ EANT_GENTOO_CLASSPATH="${pkg}"
fi
fi
1.159 eclass/java-utils-2.eclass
file :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/java-utils-2.eclass?rev=1.159&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/java-utils-2.eclass?rev=1.159&content-type=text/plain
diff :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/java-utils-2.eclass?r1=1.158&r2=1.159
Index: java-utils-2.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v
retrieving revision 1.158
retrieving revision 1.159
diff -u -r1.158 -r1.159
--- java-utils-2.eclass 14 Apr 2015 14:08:34 -0000 1.158
+++ java-utils-2.eclass 28 Apr 2015 20:35:40 -0000 1.159
@@ -6,7 +6,7 @@
#
# Licensed under the GNU General Public License, v2
#
-# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.158
2015/04/14 14:08:34 chewi Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.159
2015/04/28 20:35:40 chewi Exp $
# @ECLASS: java-utils-2.eclass
# @MAINTAINER:
@@ -920,7 +920,7 @@
java-pkg_record-jar_ --build-only
"${target_pkg}" "${jar}"
fi
fi
- # otherwise, if the current jar is the target jar, link
it
+ # otherwise, if the current jar is the target jar, link it
elif [[ "${jar_name}" == "${target_jar}" ]] ; then
[[ -f "${destjar}" ]] && rm "${destjar}"
ln -snf "${jar}" "${destjar}" \
@@ -929,7 +929,7 @@
if [[ -z "${build_only}" ]]; then
java-pkg_record-jar_ "${target_pkg}"
"${jar}"
else
- java-pkg_record-jar_ --build-only
"${target_jar}" "${jar}"
+ java-pkg_record-jar_ --build-only
"${target_pkg}" "${jar}"
fi
fi
popd > /dev/null
@@ -1784,18 +1784,13 @@
# Don't call directly, but via java-pkg-2_pkg_preinst!
java-utils-2_pkg_preinst() {
if is-java-strict; then
+ if [[ ! -e "${JAVA_PKG_ENV}" ]] || has ant-tasks ${INHERITED};
then
+ return
+ fi
+
if has_version dev-java/java-dep-check; then
- [[ -e "${JAVA_PKG_ENV}" ]] || return
local output=$(GENTOO_VM= java-dep-check --image "${D}"
"${JAVA_PKG_ENV}")
- if [[ ${output} && has_version
<=dev-java/java-dep-check-0.2 ]]; then
- ewarn "Possibly unneeded dependencies found in
package.env:"
- for dep in ${output}; do
- ewarn "\t${dep}"
- done
- fi
- if [[ ${output} && has_version
>dev-java/java-dep-check-0.2 ]]; then
- ewarn "${output}"
- fi
+ [[ ${output} ]] && ewarn "${output}"
else
eerror "Install dev-java/java-dep-check for dependency
checking"
fi
@@ -1909,8 +1904,10 @@
if [[ ${EBUILD_PHASE} = "test" ]]; then
antflags="${antflags} -DJunit.present=true"
- [[ ${ANT_TASKS} = *ant-junit* ]] && gcp="${gcp} junit"
getjarsarg="--with-dependencies"
+
+ local re="\bant-junit4?([-:]\S+)?\b"
+ [[ ${ANT_TASKS} =~ ${re} ]] && gcp+=" ${BASH_REMATCH[0]}"
else
antflags="${antflags} -Dmaven.test.skip=true"
fi
@@ -2673,7 +2670,8 @@
# @INTERNAL
# @DESCRIPTION:
# Check that a package being used in jarfrom, getjars and getjar is contained
-# within DEPEND or RDEPEND.
+# within DEPEND or RDEPEND with the correct SLOT. See this mail for details:
+#
https://archives.gentoo.org/gentoo-dev/message/dcb644f89520f4bbb61cc7bbe45fdf6e
# @CODE
# Parameters:
# $1 - empty - check both vars; "runtime" or "build" - check only
@@ -2695,9 +2693,10 @@
# * The target package first has any dots escaped, e.g. foo-1.2
# becomes foo-1\.2.
#
- # * sed then looks at the component following the last - character,
- # or the whole string if there is no - character. It uses this to
- # build a new regexp with two significant branches.
+ # * sed then looks at the component following the last - or :
+ # character, or the whole string if there is no - or :
+ # character. It uses this to build a new regexp with two
+ # significant branches.
#
# * The first checks for the whole target package string, optionally
# followed by a version number, and then :0.
@@ -2706,36 +2705,36 @@
# string, optionally followed by a version number, followed by the
# aforementioned component, treating that as a SLOT.
#
- local stripped_pkg=/$(sed -r
's/-?([^-]+)$/(\0(-[^:]+)?:0|(-[^:]+)?:\1)/' <<< "${target_pkg//./\\.}")\\b
+ local stripped_pkg=/$(sed -r
's/[-:]?([^-:]+)$/(\0(-[^:]+)?:0|(-[^:]+)?:\1)/' <<< "${target_pkg//./\\.}")\\b
debug-print "Matching against: ${stripped_pkg}"
+ # Uncomment the lines below once we've dealt with more of these
+ # otherwise we'll be tempted to turn JAVA_PKG_STRICT off while
+ # getting hit with a wave of bug reports. :(
+
if [[ ${limit_to} != runtime && ! ( "${DEPEND}" =~ $stripped_pkg ) ]];
then
dev_error="The ebuild is attempting to use ${target_pkg}, which
is not "
dev_error+="declared with a SLOT in DEPEND."
- if is-java-strict; then
- die "${dev_error}"
- else
- eqawarn "${dev_error}"
- # Uncomment this once we've dealt with more of these or
- # we'll get hit with a wave of bug reports. :(
+# if is-java-strict; then
+# die "${dev_error}"
+# else
+ eqawarn "java-pkg_ensure-dep: ${dev_error}"
# eerror "Because you have ${target_pkg} installed,"
# eerror "the package will build without problems, but
please"
# eerror "report this to http://bugs.gentoo.org."
- fi
+# fi
elif [[ ${limit_to} != build && ! ( "${RDEPEND}${PDEPEND}" =~
${stripped_pkg} ) ]]; then
dev_error="The ebuild is attempting to use ${target_pkg}, which
is not "
dev_error+="declared with a SLOT in [RP]DEPEND and --build-only
wasn't given."
- if is-java-strict; then
- die "${dev_error}"
- else
- eqawarn "${dev_error}"
- # Uncomment this once we've dealt with more of these or
- # we'll get hit with a wave of bug reports. :(
+# if is-java-strict; then
+# die "${dev_error}"
+# else
+ eqawarn "java-pkg_ensure-dep: ${dev_error}"
# eerror "The package will build without problems, but
may fail to run"
# eerror "if you don't have ${target_pkg} installed,"
# eerror "so please report this to
http://bugs.gentoo.org."
- fi
+# fi
fi
}