/[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.157 Revision 1.158
1# Base eclass for Java packages 1# Base eclass for Java packages
2# 2#
3# Copyright (c) 2004-2005, Thomas Matthijs <axxo@gentoo.org> 3# Copyright (c) 2004-2005, Thomas Matthijs <axxo@gentoo.org>
4# Copyright (c) 2004, Karl Trygve Kalleberg <karltk@gentoo.org> 4# Copyright (c) 2004, Karl Trygve Kalleberg <karltk@gentoo.org>
5# Copyright (c) 2004-2011, 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.157 2015/04/04 21:04:49 chewi Exp $ 9# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.158 2015/04/14 14:08:34 chewi 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:
2685 2685
2686 local limit_to="${1}" 2686 local limit_to="${1}"
2687 local target_pkg="${2}" 2687 local target_pkg="${2}"
2688 local dev_error="" 2688 local dev_error=""
2689 2689
2690 # remove the version specification, which may include globbing (* and [123]) 2690 # Transform into a regular expression to look for a matching package
2691 local stripped_pkg=$(echo "${target_pkg}" | sed \ 2691 # and SLOT. SLOTs don't have to be numeric so foo-bar could either
2692 's/-\([0-9*]*\(\[[0-9]*\]\)*\)*\(\.\([0-9*]*\(\[[0-9]*\]\)*\)*\)*$//') 2692 # mean foo-bar:0 or foo:bar. So you want to get your head around the
2693 # line below?
2694 #
2695 # * The target package first has any dots escaped, e.g. foo-1.2
2696 # becomes foo-1\.2.
2697 #
2698 # * sed then looks at the component following the last - character,
2699 # or the whole string if there is no - character. It uses this to
2700 # build a new regexp with two significant branches.
2701 #
2702 # * The first checks for the whole target package string, optionally
2703 # followed by a version number, and then :0.
2704 #
2705 # * The second checks for the first part of the target package
2706 # string, optionally followed by a version number, followed by the
2707 # aforementioned component, treating that as a SLOT.
2708 #
2709 local stripped_pkg=/$(sed -r 's/-?([^-]+)$/(\0(-[^:]+)?:0|(-[^:]+)?:\1)/' <<< "${target_pkg//./\\.}")\\b
2693 2710
2694 debug-print "Matching against: ${stripped_pkg}" 2711 debug-print "Matching against: ${stripped_pkg}"
2695 2712
2696 if [[ ${limit_to} != runtime && ! ( "${DEPEND}" =~ "$stripped_pkg" ) ]]; then 2713 if [[ ${limit_to} != runtime && ! ( "${DEPEND}" =~ $stripped_pkg ) ]]; then
2697 dev_error="The ebuild is attempting to use ${target_pkg} that is not" 2714 dev_error="The ebuild is attempting to use ${target_pkg}, which is not "
2698 dev_error="${dev_error} declared in DEPEND." 2715 dev_error+="declared with a SLOT in DEPEND."
2699 if is-java-strict; then 2716 if is-java-strict; then
2700 eerror "${dev_error}"
2701 die "${dev_error}" 2717 die "${dev_error}"
2702 elif [[ ${BASH_SUBSHELL} = 0 ]]; then 2718 else
2703 eerror "${dev_error}" 2719 eqawarn "${dev_error}"
2704 elog "Because you have this package installed the package will" 2720 # Uncomment this once we've dealt with more of these or
2705 elog "build without problems, but please report this to" 2721 # we'll get hit with a wave of bug reports. :(
2706 elog "http://bugs.gentoo.org" 2722# eerror "Because you have ${target_pkg} installed,"
2707 fi 2723# eerror "the package will build without problems, but please"
2724# eerror "report this to http://bugs.gentoo.org."
2708 fi 2725 fi
2709 2726 elif [[ ${limit_to} != build && ! ( "${RDEPEND}${PDEPEND}" =~ ${stripped_pkg} ) ]]; then
2710 if [[ ${limit_to} != build ]]; then
2711 if [[ ! ( ${RDEPEND} =~ "${stripped_pkg}" ) ]]; then
2712 if [[ ! ( ${PDEPEND} =~ "${stripped_pkg}" ) ]]; then
2713 dev_error="The ebuild is attempting to use ${target_pkg}," 2727 dev_error="The ebuild is attempting to use ${target_pkg}, which is not "
2714 dev_error="${dev_error} without specifying --build-only, that is not declared in RDEPEND" 2728 dev_error+="declared with a SLOT in [RP]DEPEND and --build-only wasn't given."
2715 dev_error="${dev_error} or PDEPEND."
2716 if is-java-strict; then 2729 if is-java-strict; then
2717 eerror "${dev_error}"
2718 die "${dev_error}" 2730 die "${dev_error}"
2719 elif [[ ${BASH_SUBSHELL} = 0 ]]; then 2731 else
2720 eerror "${dev_error}" 2732 eqawarn "${dev_error}"
2733 # Uncomment this once we've dealt with more of these or
2734 # we'll get hit with a wave of bug reports. :(
2721 elog "The package will build without problems, but may fail to run" 2735# eerror "The package will build without problems, but may fail to run"
2722 elog "if you don't have ${target_pkg} installed, so please report" 2736# eerror "if you don't have ${target_pkg} installed,"
2723 elog "this to http://bugs.gentoo.org" 2737# eerror "so please report this to http://bugs.gentoo.org."
2724 fi
2725 fi
2726 fi 2738 fi
2727 fi 2739 fi
2728} 2740}
2729 2741
2730java-pkg_check-phase() { 2742java-pkg_check-phase() {

Legend:
Removed from v.1.157  
changed lines
  Added in v.1.158

  ViewVC Help
Powered by ViewVC 1.1.20