From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id DC2CB13904D for ; Wed, 22 Jul 2015 09:20:17 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6162BE0853; Wed, 22 Jul 2015 09:20:12 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id F2003E0853 for ; Wed, 22 Jul 2015 09:20:11 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id E9BC934074D for ; Wed, 22 Jul 2015 09:20:10 +0000 (UTC) Received: by oystercatcher.gentoo.org (Postfix, from userid 2363) id 6C58FBD; Wed, 22 Jul 2015 09:20:07 +0000 (UTC) From: "Patrice Clement (monsieurp)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, monsieurp@gentoo.org Subject: [gentoo-commits] gentoo-x86 commit in eclass: ChangeLog java-utils-2.eclass X-VCS-Repository: gentoo-x86 X-VCS-Files: ChangeLog java-utils-2.eclass X-VCS-Directories: eclass X-VCS-Committer: monsieurp X-VCS-Committer-Name: Patrice Clement Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Message-Id: <20150722092007.6C58FBD@oystercatcher.gentoo.org> Date: Wed, 22 Jul 2015 09:20:07 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: d674ef40-00a0-4802-97b5-7bba6fc2d614 X-Archives-Hash: 1337d20eeceb9617d36effd258c0400a monsieurp 15/07/22 09:20:07 Modified: ChangeLog java-utils-2.eclass Log: Introduce java-pkg_rm_files as a helper function along with JAVA_RM_FILES array to readily get rid of useless files. Derived from perl_rm_files by Kent Fredric. Revision Changes Path 1.1724 eclass/ChangeLog file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1724&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1724&content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.1723&r2=1.1724 Index: ChangeLog =================================================================== RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v retrieving revision 1.1723 retrieving revision 1.1724 diff -u -r1.1723 -r1.1724 --- ChangeLog 20 Jul 2015 15:05:49 -0000 1.1723 +++ ChangeLog 22 Jul 2015 09:20:07 -0000 1.1724 @@ -1,6 +1,10 @@ # ChangeLog for eclass directory # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1723 2015/07/20 15:05:49 slyfox Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1724 2015/07/22 09:20:07 monsieurp Exp $ + + 22 Jul 2015; Patrice Clement java-utils-2.eclass: + Introduce java-pkg_rm_files as a helper function along with JAVA_RM_FILES + array to readily get rid of useless files. 20 Jul 2015; Sergei Trofimovich haskell-cabal.eclass: Workaround upstream cabal tests hangup bug #537500 by Michael Orlitzky; use 1.166 eclass/java-utils-2.eclass file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/java-utils-2.eclass?rev=1.166&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/java-utils-2.eclass?rev=1.166&content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/java-utils-2.eclass?r1=1.165&r2=1.166 Index: java-utils-2.eclass =================================================================== RCS file: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v retrieving revision 1.165 retrieving revision 1.166 diff -u -r1.165 -r1.166 --- java-utils-2.eclass 28 Jun 2015 13:33:48 -0000 1.165 +++ java-utils-2.eclass 22 Jul 2015 09:20:07 -0000 1.166 @@ -6,7 +6,7 @@ # # Licensed under the GNU General Public License, v2 # -# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.165 2015/06/28 13:33:48 chewi Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.166 2015/07/22 09:20:07 monsieurp Exp $ # @ECLASS: java-utils-2.eclass # @MAINTAINER: @@ -248,6 +248,46 @@ popd > /dev/null || die "popd failed" } +# @FUNCTION: java-pkg_rm_files +# @USAGE: java-pkg_rm_files File1.java File2.java ... +# @DESCRIPTION: +# Remove unneeded files in ${S}. +# +# Every now and then, you'll run into situations whereby a file needs removing, +# be it a unit test or a regular java class. +# +# You can use this function by either: +# - calling it yourself in java_prepare() and feeding java-pkg_rm_files with +# the list of files you wish to remove. +# - defining an array in the ebuild named JAVA_RM_FILES with the list of files +# you wish to remove. +# +# Both way work and it is left to the developer's preferences. If the +# JAVA_RM_FILES array is defined, it is will be automatically handed over to +# java-pkg_rm_files. +# +# See java-utils-2_src_prepare. +# +# @CODE +# +# @param $* - list of files to remove. +# JAVA_RM_FILES - array containing files to remove. +# if defined, automatically handed over to java-pkg_rm_files in java-utils-2_src_prepare. +# +# @CODE +java-pkg_rm_files() { + debug-print-function ${FUNCNAME} $* + OIFS="$IFS" + IFS="\n" + for filename in "$@"; do + [[ ! -f "${filename}" ]] && die "${filename} is not a regular file. Aborting." + einfo "Removing unneeded file ${filename}" + rm -f "${S}/${filename}" || die "cannot remove ${filename}" + eend $? + done + IFS="$OIFS" +} + # @FUNCTION: java-pkg_dojar # @USAGE: [ ...] # @DESCRIPTION: @@ -1782,6 +1822,12 @@ [[ ${EBUILD_PHASE} == prepare ]] && java-pkg_func-exists java_prepare && java_prepare + # Check for files in JAVA_RM_FILES array. + if [[ ${JAVA_RM_FILES[@]} ]]; then + debug-print "$FUNCNAME: removing unneeded files" + java-pkg_rm_files "${JAVA_RM_FILES[@]}" + fi + # Remember that eant will call this unless called via Portage if [[ ! -e "${T}/java-utils-2_src_prepare-run" ]] && is-java-strict; then echo "Searching for bundled jars:"