From 026476f82458a49172c4a2ebcaa5c2d83fdde2ae8711755e6dab5d65d2b6a8fb Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Sat, 15 May 2021 17:33:47 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/Java:packages/snakeyaml?expand=0&rev=9 --- ...ed-base64coder-with-java.util.Base64.patch | 26 ++++---- 0003-fix-broken-test.patch | 61 ------------------- snakeyaml-1.25.tar.bz2 | 3 - snakeyaml-1.28.tar.bz2 | 3 + snakeyaml-build.xml | 7 ++- snakeyaml.spec | 13 +--- 6 files changed, 23 insertions(+), 90 deletions(-) delete mode 100644 0003-fix-broken-test.patch delete mode 100644 snakeyaml-1.25.tar.bz2 create mode 100644 snakeyaml-1.28.tar.bz2 diff --git a/0001-replace-bundled-base64coder-with-java.util.Base64.patch b/0001-replace-bundled-base64coder-with-java.util.Base64.patch index cecfa40..fdd1ce5 100644 --- a/0001-replace-bundled-base64coder-with-java.util.Base64.patch +++ b/0001-replace-bundled-base64coder-with-java.util.Base64.patch @@ -27,13 +27,13 @@ index 8112370..ae308c7 100644 + 8 + 8 false - 3.2.17.RELEASE 3.5.0 + 3.0.2 diff --git a/src/main/java/org/yaml/snakeyaml/constructor/SafeConstructor.java b/src/main/java/org/yaml/snakeyaml/constructor/SafeConstructor.java index bd022cc..217835d 100644 --- a/src/main/java/org/yaml/snakeyaml/constructor/SafeConstructor.java +++ b/src/main/java/org/yaml/snakeyaml/constructor/SafeConstructor.java -@@ -17,6 +17,7 @@ package org.yaml.snakeyaml.constructor; +@@ -17,6 +17,7 @@ import java.math.BigInteger; import java.util.ArrayList; @@ -41,15 +41,15 @@ index bd022cc..217835d 100644 import java.util.Calendar; import java.util.HashMap; import java.util.Iterator; -@@ -30,7 +31,6 @@ import java.util.regex.Matcher; - import java.util.regex.Pattern; +@@ -31,7 +32,6 @@ + import org.yaml.snakeyaml.LoaderOptions; import org.yaml.snakeyaml.error.YAMLException; -import org.yaml.snakeyaml.external.biz.base64Coder.Base64Coder; import org.yaml.snakeyaml.nodes.MappingNode; import org.yaml.snakeyaml.nodes.Node; import org.yaml.snakeyaml.nodes.NodeId; -@@ -313,7 +313,7 @@ public class SafeConstructor extends BaseConstructor { +@@ -348,7 +348,7 @@ // Ignore white spaces for base64 encoded scalar String noWhiteSpaces = constructScalar((ScalarNode) node).toString().replaceAll("\\s", ""); @@ -373,7 +373,7 @@ diff --git a/src/main/java/org/yaml/snakeyaml/representer/SafeRepresenter.java b index 2cc15d9..e5ac480 100644 --- a/src/main/java/org/yaml/snakeyaml/representer/SafeRepresenter.java +++ b/src/main/java/org/yaml/snakeyaml/representer/SafeRepresenter.java -@@ -19,6 +19,7 @@ import java.io.UnsupportedEncodingException; +@@ -19,6 +19,7 @@ import java.math.BigInteger; import java.util.ArrayList; import java.util.Arrays; @@ -381,7 +381,7 @@ index 2cc15d9..e5ac480 100644 import java.util.Calendar; import java.util.Date; import java.util.HashMap; -@@ -33,7 +34,6 @@ import java.util.regex.Pattern; +@@ -33,7 +34,6 @@ import org.yaml.snakeyaml.DumperOptions; import org.yaml.snakeyaml.error.YAMLException; @@ -389,7 +389,7 @@ index 2cc15d9..e5ac480 100644 import org.yaml.snakeyaml.nodes.Node; import org.yaml.snakeyaml.nodes.Tag; import org.yaml.snakeyaml.reader.StreamReader; -@@ -131,7 +131,7 @@ class SafeRepresenter extends BaseRepresenter { +@@ -131,7 +131,7 @@ if (!checkValue.equals(value)) { throw new YAMLException("invalid string value has occurred"); } @@ -398,7 +398,7 @@ index 2cc15d9..e5ac480 100644 } catch (UnsupportedEncodingException e) { throw new YAMLException(e); } -@@ -433,7 +433,7 @@ class SafeRepresenter extends BaseRepresenter { +@@ -433,7 +433,7 @@ protected class RepresentByteArray implements Represent { public Node representData(Object data) { @@ -490,7 +490,7 @@ diff --git a/src/test/java/org/yaml/snakeyaml/issues/issue99/YamlBase64Test.java index e425f25..a0c4f6a 100644 --- a/src/test/java/org/yaml/snakeyaml/issues/issue99/YamlBase64Test.java +++ b/src/test/java/org/yaml/snakeyaml/issues/issue99/YamlBase64Test.java -@@ -18,6 +18,7 @@ package org.yaml.snakeyaml.issues.issue99; +@@ -18,6 +18,7 @@ import java.io.BufferedInputStream; import java.io.IOException; import java.io.InputStream; @@ -498,7 +498,7 @@ index e425f25..a0c4f6a 100644 import java.util.Map; import junit.framework.TestCase; -@@ -27,7 +28,6 @@ import org.yaml.snakeyaml.Yaml; +@@ -27,7 +28,6 @@ import org.yaml.snakeyaml.YamlDocument; import org.yaml.snakeyaml.constructor.AbstractConstruct; import org.yaml.snakeyaml.constructor.Constructor; @@ -506,7 +506,7 @@ index e425f25..a0c4f6a 100644 import org.yaml.snakeyaml.nodes.Node; import org.yaml.snakeyaml.nodes.ScalarNode; import org.yaml.snakeyaml.nodes.Tag; -@@ -50,7 +50,7 @@ public class YamlBase64Test extends TestCase { +@@ -50,7 +50,7 @@ all = all + lines[i].trim(); } // System.out.println(all); @@ -515,7 +515,7 @@ index e425f25..a0c4f6a 100644 assertEquals(3737, decoded.length); checkBytes(decoded); } -@@ -122,7 +122,7 @@ public class YamlBase64Test extends TestCase { +@@ -122,7 +122,7 @@ public Object construct(Node node) { String contentWithNewLines = constructScalar((ScalarNode) node).toString(); String noNewLines = contentWithNewLines.replaceAll("\\s", ""); diff --git a/0003-fix-broken-test.patch b/0003-fix-broken-test.patch deleted file mode 100644 index 31245b8..0000000 --- a/0003-fix-broken-test.patch +++ /dev/null @@ -1,61 +0,0 @@ -diff --git a/src/test/java/org/yaml/snakeyaml/error/WrappedExceptionsTest.java b/src/test/java/org/yaml/snakeyaml/error/WrappedExceptionsTest.java -index f8b72a1..7ed8328 100644 ---- a/src/test/java/org/yaml/snakeyaml/error/WrappedExceptionsTest.java -+++ b/src/test/java/org/yaml/snakeyaml/error/WrappedExceptionsTest.java -@@ -15,43 +15,32 @@ - */ - package org.yaml.snakeyaml.error; - --import org.hamcrest.CoreMatchers; --import org.junit.Before; --import org.junit.Rule; - import org.junit.Test; --import org.junit.rules.ExpectedException; - import org.yaml.snakeyaml.LoaderOptions; - import org.yaml.snakeyaml.Yaml; - -+import static org.junit.Assert.assertEquals; -+import static org.junit.Assert.fail; -+ - public class WrappedExceptionsTest { - - private static final String INVALID_YAML = "!!seq abc"; - -- @Rule -- public final ExpectedException expectedException = ExpectedException.none(); -- -- @Before -- public void configureExpectedExceptions() { -- expectedException.expectMessage("org.yaml.snakeyaml.nodes.ScalarNode"); -- expectedException.expectMessage("org.yaml.snakeyaml.nodes.SequenceNode"); -- } -- - @Test - public void testWrapped() { -- expectedException.expect(YAMLException.class); -- expectedException -- .expectCause(CoreMatchers. instanceOf(ClassCastException.class)); -- -- LoaderOptions options = new LoaderOptions(); -- options.setWrappedToRootException(true); -- Yaml yaml = new Yaml(options); -- yaml.load(INVALID_YAML); -+ try { -+ LoaderOptions options = new LoaderOptions(); -+ options.setWrappedToRootException(true); -+ Yaml yaml = new Yaml(options); -+ yaml.load(INVALID_YAML); -+ fail(); -+ } catch (YAMLException e) { -+ assertEquals(ClassCastException.class, e.getCause().getClass()); -+ } - } - -- @Test -+ @Test(expected = ClassCastException.class) - public void testUnWrapped() { -- expectedException.expect(ClassCastException.class); -- - LoaderOptions options = new LoaderOptions(); - options.setWrappedToRootException(false); - Yaml yaml = new Yaml(options); diff --git a/snakeyaml-1.25.tar.bz2 b/snakeyaml-1.25.tar.bz2 deleted file mode 100644 index d612279..0000000 --- a/snakeyaml-1.25.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5ca1b968b939eab9bd338183fded8d0d540e94b211fa9cf759c6312f195303ba -size 332303 diff --git a/snakeyaml-1.28.tar.bz2 b/snakeyaml-1.28.tar.bz2 new file mode 100644 index 0000000..35bd018 --- /dev/null +++ b/snakeyaml-1.28.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6a8c452c7274223d284ec28d3a16715c4741a7efed2a888cce080ef9b7ee6df8 +size 300779 diff --git a/snakeyaml-build.xml b/snakeyaml-build.xml index 353ea17..e357a7e 100644 --- a/snakeyaml-build.xml +++ b/snakeyaml-build.xml @@ -12,10 +12,10 @@ - + - + @@ -186,6 +186,7 @@ packagenames="*" destdir="${reporting.outputDirectory}/apidocs" access="protected" + encoding="UTF-8" source="${compiler.source}" verbose="false" version="true" @@ -199,7 +200,7 @@ nohelp="false" nonavbar="false" serialwarn="false" - charset="ISO-8859-1" + charset="UTF-8" linksource="false" breakiterator="false"> diff --git a/snakeyaml.spec b/snakeyaml.spec index a9e726e..8af382e 100644 --- a/snakeyaml.spec +++ b/snakeyaml.spec @@ -1,7 +1,7 @@ # # spec file for package snakeyaml # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,10 +16,10 @@ # -%global vertag 8450addf3473 +%global vertag b28f0b4d87c6 %bcond_with tests Name: snakeyaml -Version: 1.25 +Version: 1.28 Release: 0 Summary: YAML parser and emitter for the Java programming language License: Apache-2.0 @@ -36,9 +36,6 @@ Source1: %{name}-build.xml Patch0: 0001-replace-bundled-base64coder-with-java.util.Base64.patch # We don't have gdata-java, use commons-codec instead Patch1: 0002-Replace-bundled-gdata-java-client-classes-with-commo.patch -# Fix a broken test, change backported from upstream: -# https://bitbucket.org/asomov/snakeyaml/commits/345408c -Patch2: 0003-fix-broken-test.patch BuildRequires: ant BuildRequires: apache-commons-codec BuildRequires: base64coder @@ -84,7 +81,6 @@ This package contains %{summary}. cp %{SOURCE1} build.xml %patch0 -p1 %patch1 -p1 -%patch2 -p1 %pom_remove_plugin :cobertura-maven-plugin %pom_remove_plugin :maven-changes-plugin @@ -108,9 +104,6 @@ rm src/test/java/org/yaml/snakeyaml/issues/issue318/ContextClassLoaderTest.java # convert CR+LF to LF sed -i 's/\r//g' LICENSE.txt -%pom_remove_dep org.springframework -rm -r src/test/java/org/yaml/snakeyaml/issues/issue9 - %build mkdir -p lib build-jar-repository -s lib base64coder commons-codec