chewi       15/04/14 14:08:34

  Modified:             ChangeLog java-utils-2.eclass
  Log:
  Consider SLOTs when checking Java dependencies. Comment out the longer
  error message for now to avoid spamming both users and ourselves
  because this issue is currently widespread.

Revision  Changes    Path
1.1587               eclass/ChangeLog

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1587&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1587&content-type=text/plain
diff : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.1586&r2=1.1587

Index: ChangeLog
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v
retrieving revision 1.1586
retrieving revision 1.1587
diff -u -r1.1586 -r1.1587
--- ChangeLog   11 Apr 2015 17:11:22 -0000      1.1586
+++ ChangeLog   14 Apr 2015 14:08:34 -0000      1.1587
@@ -1,6 +1,11 @@
 # ChangeLog for eclass directory
 # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1586 2015/04/11 
17:11:22 kensington Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1587 2015/04/14 
14:08:34 chewi Exp $
+
+  14 Apr 2015; James Le Cuirot <[email protected]> java-utils-2.eclass:
+  Consider SLOTs when checking Java dependencies. Comment out the longer error
+  message for now to avoid spamming both users and ourselves because this issue
+  is currently widespread.
 
   11 Apr 2015; Michael Palimaka <[email protected]> kde5-functions.eclass,
   kde5.eclass:



1.158                eclass/java-utils-2.eclass

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/java-utils-2.eclass?rev=1.158&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/java-utils-2.eclass?rev=1.158&content-type=text/plain
diff : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/java-utils-2.eclass?r1=1.157&r2=1.158

Index: java-utils-2.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v
retrieving revision 1.157
retrieving revision 1.158
diff -u -r1.157 -r1.158
--- java-utils-2.eclass 4 Apr 2015 21:04:49 -0000       1.157
+++ java-utils-2.eclass 14 Apr 2015 14:08:34 -0000      1.158
@@ -2,11 +2,11 @@
 #
 # Copyright (c) 2004-2005, Thomas Matthijs <[email protected]>
 # Copyright (c) 2004, Karl Trygve Kalleberg <[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-utils-2.eclass,v 1.157 
2015/04/04 21:04:49 chewi Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.158 
2015/04/14 14:08:34 chewi Exp $
 
 # @ECLASS: java-utils-2.eclass
 # @MAINTAINER:
@@ -2687,42 +2687,54 @@
        local target_pkg="${2}"
        local dev_error=""
 
-       # remove the version specification, which may include globbing (* and 
[123])
-       local stripped_pkg=$(echo "${target_pkg}" | sed \
-               
's/-\([0-9*]*\(\[[0-9]*\]\)*\)*\(\.\([0-9*]*\(\[[0-9]*\]\)*\)*\)*$//')
+       # Transform into a regular expression to look for a matching package
+       # and SLOT. SLOTs don't have to be numeric so foo-bar could either
+       # mean foo-bar:0 or foo:bar. So you want to get your head around the
+       # line below?
+       #
+       # * 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.
+       #
+       # * The first checks for the whole target package string, optionally
+       #   followed by a version number, and then :0.
+       #
+       # * The second checks for the first part of the target package
+       #   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
 
        debug-print "Matching against: ${stripped_pkg}"
 
-       if [[ ${limit_to} != runtime && ! ( "${DEPEND}" =~ "$stripped_pkg" ) 
]]; then
-               dev_error="The ebuild is attempting to use ${target_pkg} that 
is not"
-               dev_error="${dev_error} declared in DEPEND."
+       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
-                       eerror "${dev_error}"
                        die "${dev_error}"
-               elif [[ ${BASH_SUBSHELL} = 0 ]]; then
-                       eerror "${dev_error}"
-                       elog "Because you have this package installed the 
package will"
-                       elog "build without problems, but please report this to"
-                       elog "http://bugs.gentoo.org";
-               fi
-       fi
-
-       if [[ ${limit_to} != build ]]; then
-               if [[ ! ( ${RDEPEND} =~ "${stripped_pkg}" ) ]]; then
-                       if [[ ! ( ${PDEPEND} =~ "${stripped_pkg}" ) ]]; then
-                               dev_error="The ebuild is attempting to use 
${target_pkg},"
-                               dev_error="${dev_error} without specifying 
--build-only, that is not declared in RDEPEND"
-                               dev_error="${dev_error} or PDEPEND."
-                               if is-java-strict; then
-                                       eerror "${dev_error}"
-                                       die "${dev_error}"
-                               elif [[ ${BASH_SUBSHELL} = 0 ]]; then
-                                       eerror "${dev_error}"
-                                       elog "The package will build without 
problems, but may fail to run"
-                                       elog "if you don't have ${target_pkg} 
installed, so please report"
-                                       elog "this to http://bugs.gentoo.org";
-                               fi
-                       fi
+               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. :(
+#                      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
+       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. :(
+#                      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
 }




Reply via email to