/[gentoo-x86]/eclass/java-utils-2.eclass
Gentoo

Diff of /eclass/java-utils-2.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.165 Revision 1.166
4# Copyright (c) 2004, Karl Trygve Kalleberg <karltk@gentoo.org> 4# Copyright (c) 2004, Karl Trygve Kalleberg <karltk@gentoo.org>
5# Copyright (c) 2004-2015, Gentoo Foundation 5# Copyright (c) 2004-2015, Gentoo Foundation
6# 6#
7# Licensed under the GNU General Public License, v2 7# Licensed under the GNU General Public License, v2
8# 8#
9# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.165 2015/06/28 13:33:48 chewi Exp $ 9# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.166 2015/07/22 09:20:07 monsieurp Exp $
10 10
11# @ECLASS: java-utils-2.eclass 11# @ECLASS: java-utils-2.eclass
12# @MAINTAINER: 12# @MAINTAINER:
13# java@gentoo.org 13# java@gentoo.org
14# @AUTHOR: 14# @AUTHOR:
244 shift 2 244 shift 2
245 245
246 pushd "${dir}" > /dev/null || die "pushd ${dir} failed" 246 pushd "${dir}" > /dev/null || die "pushd ${dir} failed"
247 find -L -type f ! -path "./target/*" ! -path "./sources.lst" ! -name "MANIFEST.MF" ! -regex ".*\.\(class\|jar\|java\)" "${@}" -print0 | xargs -0 jar uf "${jar}" || die "jar failed" 247 find -L -type f ! -path "./target/*" ! -path "./sources.lst" ! -name "MANIFEST.MF" ! -regex ".*\.\(class\|jar\|java\)" "${@}" -print0 | xargs -0 jar uf "${jar}" || die "jar failed"
248 popd > /dev/null || die "popd failed" 248 popd > /dev/null || die "popd failed"
249}
250
251# @FUNCTION: java-pkg_rm_files
252# @USAGE: java-pkg_rm_files File1.java File2.java ...
253# @DESCRIPTION:
254# Remove unneeded files in ${S}.
255#
256# Every now and then, you'll run into situations whereby a file needs removing,
257# be it a unit test or a regular java class.
258#
259# You can use this function by either:
260# - calling it yourself in java_prepare() and feeding java-pkg_rm_files with
261# the list of files you wish to remove.
262# - defining an array in the ebuild named JAVA_RM_FILES with the list of files
263# you wish to remove.
264#
265# Both way work and it is left to the developer's preferences. If the
266# JAVA_RM_FILES array is defined, it is will be automatically handed over to
267# java-pkg_rm_files.
268#
269# See java-utils-2_src_prepare.
270#
271# @CODE
272#
273# @param $* - list of files to remove.
274# JAVA_RM_FILES - array containing files to remove.
275# if defined, automatically handed over to java-pkg_rm_files in java-utils-2_src_prepare.
276#
277# @CODE
278java-pkg_rm_files() {
279 debug-print-function ${FUNCNAME} $*
280 OIFS="$IFS"
281 IFS="\n"
282 for filename in "$@"; do
283 [[ ! -f "${filename}" ]] && die "${filename} is not a regular file. Aborting."
284 einfo "Removing unneeded file ${filename}"
285 rm -f "${S}/${filename}" || die "cannot remove ${filename}"
286 eend $?
287 done
288 IFS="$OIFS"
249} 289}
250 290
251# @FUNCTION: java-pkg_dojar 291# @FUNCTION: java-pkg_dojar
252# @USAGE: <jar1> [<jar2> ...] 292# @USAGE: <jar1> [<jar2> ...]
253# @DESCRIPTION: 293# @DESCRIPTION:
1779# src_prepare Searches for bundled jars 1819# src_prepare Searches for bundled jars
1780# Don't call directly, but via java-pkg-2_src_prepare! 1820# Don't call directly, but via java-pkg-2_src_prepare!
1781java-utils-2_src_prepare() { 1821java-utils-2_src_prepare() {
1782 [[ ${EBUILD_PHASE} == prepare ]] && 1822 [[ ${EBUILD_PHASE} == prepare ]] &&
1783 java-pkg_func-exists java_prepare && java_prepare 1823 java-pkg_func-exists java_prepare && java_prepare
1824
1825 # Check for files in JAVA_RM_FILES array.
1826 if [[ ${JAVA_RM_FILES[@]} ]]; then
1827 debug-print "$FUNCNAME: removing unneeded files"
1828 java-pkg_rm_files "${JAVA_RM_FILES[@]}"
1829 fi
1784 1830
1785 # Remember that eant will call this unless called via Portage 1831 # Remember that eant will call this unless called via Portage
1786 if [[ ! -e "${T}/java-utils-2_src_prepare-run" ]] && is-java-strict; then 1832 if [[ ! -e "${T}/java-utils-2_src_prepare-run" ]] && is-java-strict; then
1787 echo "Searching for bundled jars:" 1833 echo "Searching for bundled jars:"
1788 java-pkg_find-normal-jars || echo "None found." 1834 java-pkg_find-normal-jars || echo "None found."

Legend:
Removed from v.1.165  
changed lines
  Added in v.1.166

  ViewVC Help
Powered by ViewVC 1.1.20