public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Miroslav Šulc" <fordfrog@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-java/stringtemplate/files/, dev-java/stringtemplate/
Date: Fri, 26 Jul 2024 09:34:21 +0000 (UTC)	[thread overview]
Message-ID: <1721986427.8fc319802f811bfc774024d7cf46d3a6815aabde.fordfrog@gentoo> (raw)

commit:     8fc319802f811bfc774024d7cf46d3a6815aabde
Author:     Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 26 09:33:47 2024 +0000
Commit:     Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
CommitDate: Fri Jul 26 09:33:47 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8fc31980

dev-java/stringtemplate: fixed tests in java 21+ for 4.3.4 + simplified applying the patch

Closes: https://bugs.gentoo.org/936535
Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>

 ...rs.patch => stringtemplate-4.3.4-Java21+-TestRenderers.patch} | 8 ++++----
 dev-java/stringtemplate/stringtemplate-4.3.4.ebuild              | 9 ++++-----
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/dev-java/stringtemplate/files/stringtemplate-4.3.4-Java21-TestRenderers.patch b/dev-java/stringtemplate/files/stringtemplate-4.3.4-Java21+-TestRenderers.patch
similarity index 85%
rename from dev-java/stringtemplate/files/stringtemplate-4.3.4-Java21-TestRenderers.patch
rename to dev-java/stringtemplate/files/stringtemplate-4.3.4-Java21+-TestRenderers.patch
index 127f5e0a4b61..22b271671b8d 100644
--- a/dev-java/stringtemplate/files/stringtemplate-4.3.4-Java21-TestRenderers.patch
+++ b/dev-java/stringtemplate/files/stringtemplate-4.3.4-Java21+-TestRenderers.patch
@@ -6,7 +6,7 @@ there are different space characters used in java 21 (narrow space)
          String expecting = "datetime: 7/5/05, 12:00 AM";
          if ( javaVersion.startsWith("1.6") || javaVersion.startsWith("1.7") || javaVersion.startsWith("1.8") ) {
              expecting = "datetime: 7/5/05 12:00 AM";
-+        } else if ( javaVersion.startsWith("21") ) {
++        } else if ( Integer.valueOf(javaVersion.replaceAll("^(\\d+).*", "$1")) >= 21 ) {
 +            expecting = "datetime: 7/5/05, 12:00 AM";
          }
          String result = st.render();
@@ -15,7 +15,7 @@ there are different space characters used in java 21 (narrow space)
          String expecting = " datetime: 7/5/05, 12:00 AM ";
          if ( javaVersion.startsWith("1.6") || javaVersion.startsWith("1.7") || javaVersion.startsWith("1.8") ) {
              expecting = " datetime: 7/5/05 12:00 AM ";
-+        } else if ( javaVersion.startsWith("21") ) {
++        } else if ( Integer.valueOf(javaVersion.replaceAll("^(\\d+).*", "$1")) >= 21 ) {
 +            expecting = " datetime: 7/5/05, 12:00 AM ";
          }
          String result = st.render();
@@ -24,7 +24,7 @@ there are different space characters used in java 21 (narrow space)
              String expecting = " datetime: Tuesday, July 5, 2005 at 12:00:00 AM Pacific Daylight Time ";
              if ( javaVersion.startsWith("1.6") || javaVersion.startsWith("1.7") || javaVersion.startsWith("1.8") ) {
                  expecting = " datetime: Tuesday, July 5, 2005 12:00:00 AM PDT ";
-+            } else if ( javaVersion.startsWith("21") ) {
++            } else if ( Integer.valueOf(javaVersion.replaceAll("^(\\d+).*", "$1")) >= 21 ) {
 +                expecting = " datetime: Tuesday, July 5, 2005, 12:00:00 AM Pacific Daylight Time ";
              }
              String result = st.render();
@@ -33,7 +33,7 @@ there are different space characters used in java 21 (narrow space)
          ST st = group.getInstanceOf("dateThing");
          st.add("created", new GregorianCalendar(2005, 7 - 1, 5));
          String expecting = " time: 12:00:00 AM ";
-+        if ( javaVersion.startsWith("21") ) {
++        if ( Integer.valueOf(javaVersion.replaceAll("^(\\d+).*", "$1")) >= 21 ) {
 +            expecting = " time: 12:00:00 AM ";
 +        }
          String result = st.render();

diff --git a/dev-java/stringtemplate/stringtemplate-4.3.4.ebuild b/dev-java/stringtemplate/stringtemplate-4.3.4.ebuild
index dd01fef37fd3..0ed931834169 100644
--- a/dev-java/stringtemplate/stringtemplate-4.3.4.ebuild
+++ b/dev-java/stringtemplate/stringtemplate-4.3.4.ebuild
@@ -53,7 +53,10 @@ JAVA_TEST_SRC_DIR="${TARBALL_S}/test"
 JAVA_TEST_RESOURCE_DIRS=( "${TARBALL_S}/test/resources" )
 
 DOCS=( "${TARBALL_S}/"{CHANGES.txt,README.md} )
-PATCHES=( "${FILESDIR}/stringtemplate-4.3.4-BaseTest-javac-source-target.patch" )
+PATCHES=(
+	"${FILESDIR}/stringtemplate-4.3.4-BaseTest-javac-source-target.patch"
+	"${FILESDIR}/stringtemplate-4.3.4-Java21+-TestRenderers.patch"
+)
 
 src_prepare() {
 	default #780585
@@ -65,10 +68,6 @@ src_prepare() {
 }
 
 src_test() {
-	local vm_version="$(java-config -g PROVIDES_VERSION)"
-	if ver_test "${vm_version}" -ge 21; then
-		eapply "${FILESDIR}/stringtemplate-4.3.4-Java21-TestRenderers.patch"
-	fi
 	# Make sure no older versions of this slot are present in the classpath
 	# https://bugs.gentoo.org/834138#c4
 	local old_ver_cp="$(nonfatal java-pkg_getjars "${PN}-${SLOT}")"


             reply	other threads:[~2024-07-26  9:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-26  9:34 Miroslav Šulc [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-12-08 10:39 [gentoo-commits] repo/gentoo:master commit in: dev-java/stringtemplate/files/, dev-java/stringtemplate/ Miroslav Šulc
2022-03-17  8:56 Miroslav Šulc
2022-01-25  9:30 Miroslav Šulc
2021-05-29 15:58 Miroslav Šulc
2015-12-04 23:01 James Le Cuirot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1721986427.8fc319802f811bfc774024d7cf46d3a6815aabde.fordfrog@gentoo \
    --to=fordfrog@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox