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 1276113989E for ; Tue, 25 Aug 2015 23:22:31 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8165AE0858; Tue, 25 Aug 2015 23:22:30 +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 0CE45E0858 for ; Tue, 25 Aug 2015 23:22:30 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 07FA13408D4 for ; Tue, 25 Aug 2015 23:22:29 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id ECA23169 for ; Tue, 25 Aug 2015 23:22:22 +0000 (UTC) From: "James Le Cuirot" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "James Le Cuirot" Message-ID: <1440544932.586d3c9272612840f57fba6196d2ac11a8a5a9dd.chewi@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: www-servers/tomcat/files/, www-servers/tomcat/ X-VCS-Repository: repo/gentoo X-VCS-Files: www-servers/tomcat/files/tomcat-6-sysprop.patch www-servers/tomcat/files/tomcat-6.0.44-build.xml.patch www-servers/tomcat/files/tomcat-r1.init www-servers/tomcat/tomcat-6.0.44-r1.ebuild www-servers/tomcat/tomcat-6.0.44-r2.ebuild X-VCS-Directories: www-servers/tomcat/ www-servers/tomcat/files/ X-VCS-Committer: chewi X-VCS-Committer-Name: James Le Cuirot X-VCS-Revision: 586d3c9272612840f57fba6196d2ac11a8a5a9dd X-VCS-Branch: master Date: Tue, 25 Aug 2015 23:22:22 +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: f7de12e3-0072-4332-b24c-c824e859cf27 X-Archives-Hash: f8118d7e7e849dd0e1395ddd0ecd874b commit: 586d3c9272612840f57fba6196d2ac11a8a5a9dd Author: James Le Cuirot gentoo org> AuthorDate: Tue Aug 25 23:20:50 2015 +0000 Commit: James Le Cuirot gentoo org> CommitDate: Tue Aug 25 23:22:12 2015 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=586d3c92 www-servers/tomcat: Second stab at bug #453212 for version 6 The previous attempt didn't work because 6 doesn't resolve system properties in the catalina.properties file. I have backported the change from 7 to make it work. I have also unbundled el-api.jar in line with the later versions as per bug #558728. Package-Manager: portage-2.2.20.1 www-servers/tomcat/files/tomcat-6-sysprop.patch | 109 +++++++++++++++++++++ .../tomcat/files/tomcat-6.0.44-build.xml.patch | 15 ++- www-servers/tomcat/files/tomcat-r1.init | 1 - ...at-6.0.44-r1.ebuild => tomcat-6.0.44-r2.ebuild} | 8 +- 4 files changed, 125 insertions(+), 8 deletions(-) diff --git a/www-servers/tomcat/files/tomcat-6-sysprop.patch b/www-servers/tomcat/files/tomcat-6-sysprop.patch new file mode 100644 index 0000000..033bbc8 --- /dev/null +++ b/www-servers/tomcat/files/tomcat-6-sysprop.patch @@ -0,0 +1,109 @@ +diff -Naur apache-tomcat-6.0.44-src.orig/java/org/apache/catalina/startup/Bootstrap.java apache-tomcat-6.0.44-src/java/org/apache/catalina/startup/Bootstrap.java +--- apache-tomcat-6.0.44-src.orig/java/org/apache/catalina/startup/Bootstrap.java 2015-05-08 13:22:05.000000000 +0100 ++++ apache-tomcat-6.0.44-src/java/org/apache/catalina/startup/Bootstrap.java 2015-08-25 21:34:29.774917427 +0100 +@@ -109,40 +109,18 @@ + String value = CatalinaProperties.getProperty(name + ".loader"); + if ((value == null) || (value.equals(""))) + return parent; ++ ++ value = replace(value); + + ArrayList repositoryLocations = new ArrayList(); + ArrayList repositoryTypes = new ArrayList(); +- int i; + + StringTokenizer tokenizer = new StringTokenizer(value, ","); + while (tokenizer.hasMoreElements()) { +- String repository = tokenizer.nextToken(); +- +- // Local repository +- boolean replace = false; +- String before = repository; +- while ((i=repository.indexOf(CATALINA_HOME_TOKEN))>=0) { +- replace=true; +- if (i>0) { +- repository = repository.substring(0,i) + getCatalinaHome() +- + repository.substring(i+CATALINA_HOME_TOKEN.length()); +- } else { +- repository = getCatalinaHome() +- + repository.substring(CATALINA_HOME_TOKEN.length()); +- } +- } +- while ((i=repository.indexOf(CATALINA_BASE_TOKEN))>=0) { +- replace=true; +- if (i>0) { +- repository = repository.substring(0,i) + getCatalinaBase() +- + repository.substring(i+CATALINA_BASE_TOKEN.length()); +- } else { +- repository = getCatalinaBase() +- + repository.substring(CATALINA_BASE_TOKEN.length()); +- } ++ String repository = tokenizer.nextToken().trim(); ++ if (repository.length() == 0) { ++ continue; + } +- if (replace && log.isDebugEnabled()) +- log.debug("Expanded " + before + " to " + repository); + + // Check for a JAR URL repository + try { +@@ -154,6 +132,7 @@ + // Ignore + } + ++ // Local repository + if (repository.endsWith("*.jar")) { + repository = repository.substring + (0, repository.length() - "*.jar".length()); +@@ -192,6 +171,51 @@ + + } + ++ /** ++ * System property replacement in the given string. ++ * ++ * @param str The original string ++ * @return the modified string ++ */ ++ protected String replace(String str) { ++ // Implementation is copied from ClassLoaderLogManager.replace(), ++ // but added special processing for catalina.home and catalina.base. ++ String result = str; ++ int pos_start = str.indexOf("${"); ++ if (pos_start >= 0) { ++ StringBuilder builder = new StringBuilder(); ++ int pos_end = -1; ++ while (pos_start >= 0) { ++ builder.append(str, pos_end + 1, pos_start); ++ pos_end = str.indexOf('}', pos_start + 2); ++ if (pos_end < 0) { ++ pos_end = pos_start - 1; ++ break; ++ } ++ String propName = str.substring(pos_start + 2, pos_end); ++ String replacement; ++ if (propName.length() == 0) { ++ replacement = null; ++ } else if (CATALINA_HOME_TOKEN.equals(propName)) { ++ replacement = getCatalinaHome(); ++ } else if (CATALINA_BASE_TOKEN.equals(propName)) { ++ replacement = getCatalinaBase(); ++ } else { ++ replacement = System.getProperty(propName); ++ } ++ if (replacement != null) { ++ builder.append(replacement); ++ } else { ++ builder.append(str, pos_start, pos_end + 1); ++ } ++ pos_start = str.indexOf("${", pos_end + 1); ++ } ++ builder.append(str, pos_end + 1, str.length()); ++ result = builder.toString(); ++ } ++ return result; ++ } ++ + + /** + * Initialize daemon. diff --git a/www-servers/tomcat/files/tomcat-6.0.44-build.xml.patch b/www-servers/tomcat/files/tomcat-6.0.44-build.xml.patch index eaa1963..7430651 100644 --- a/www-servers/tomcat/files/tomcat-6.0.44-build.xml.patch +++ b/www-servers/tomcat/files/tomcat-6.0.44-build.xml.patch @@ -1,6 +1,6 @@ diff -Naur apache-tomcat-6.0.44-src.orig/build.xml apache-tomcat-6.0.44-src/build.xml --- apache-tomcat-6.0.44-src.orig/build.xml 2015-05-08 13:22:05.000000000 +0100 -+++ apache-tomcat-6.0.44-src/build.xml 2015-08-16 14:10:03.609366396 +0100 ++++ apache-tomcat-6.0.44-src/build.xml 2015-08-25 23:38:46.147332131 +0100 @@ -159,12 +159,14 @@ @@ -16,7 +16,7 @@ diff -Naur apache-tomcat-6.0.44-src.orig/build.xml apache-tomcat-6.0.44-src/buil -@@ -307,14 +309,18 @@ +@@ -307,19 +309,25 @@ manifest="${tomcat.manifests}/annotations-api.jar.manifest" /> @@ -35,7 +35,14 @@ diff -Naur apache-tomcat-6.0.44-src.orig/build.xml apache-tomcat-6.0.44-src/buil -@@ -492,12 +498,14 @@ ++ + + + @@ -50,7 +57,7 @@ diff -Naur apache-tomcat-6.0.44-src.orig/build.xml apache-tomcat-6.0.44-src/buil -@@ -649,9 +657,11 @@ +@@ -649,9 +659,11 @@ diff --git a/www-servers/tomcat/files/tomcat-r1.init b/www-servers/tomcat/files/tomcat-r1.init index 3a69a9d..531baa1 100644 --- a/www-servers/tomcat/files/tomcat-r1.init +++ b/www-servers/tomcat/files/tomcat-r1.init @@ -20,7 +20,6 @@ PIDFILE=/@GENTOO_PORTAGE_EPREFIX@var/run/${RC_SVCNAME}.pid export JAVA_HOME=`java-config ${TOMCAT_JVM:+--select-vm ${TOMCAT_JVM}} --jre-home` export CLASSPATH="${CATALINA_HOME}/bin/bootstrap.jar:${CATALINA_HOME}/bin/tomcat-juli.jar" -[[ @SLOT@ = 6 ]] && CLASSPATH+=":/@GENTOO_PORTAGE_EPREFIX@usr/share/tomcat-servlet-api-2.5/lib/jsp-api.jar:/@GENTOO_PORTAGE_EPREFIX@usr/share/tomcat-servlet-api-2.5/lib/servlet-api.jar" depend() { use dns logger net diff --git a/www-servers/tomcat/tomcat-6.0.44-r1.ebuild b/www-servers/tomcat/tomcat-6.0.44-r2.ebuild similarity index 95% rename from www-servers/tomcat/tomcat-6.0.44-r1.ebuild rename to www-servers/tomcat/tomcat-6.0.44-r2.ebuild index e2d1b32..d3f72ba 100644 --- a/www-servers/tomcat/tomcat-6.0.44-r1.ebuild +++ b/www-servers/tomcat/tomcat-6.0.44-r2.ebuild @@ -24,7 +24,7 @@ SAPI_SLOT="2.5" COMMON_DEP="dev-java/eclipse-ecj:${ECJ_SLOT} dev-java/oracle-javamail:0 - dev-java/tomcat-servlet-api:${SAPI_SLOT}" + >=dev-java/tomcat-servlet-api-6.0.44-r1:${SAPI_SLOT}" RDEPEND="${COMMON_DEP} >=virtual/jre-1.6 !