Accepting request 747255 from Java:packages
upgrade to 1.25 OBS-URL: https://build.opensuse.org/request/show/747255 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/snakeyaml?expand=0&rev=2
This commit is contained in:
commit
50270efc78
@ -1,31 +1,47 @@
|
||||
From 7eb4cceb36eff9d863abe45bafa6d94c6e7e9270 Mon Sep 17 00:00:00 2001
|
||||
From: Michal Srb <msrb@redhat.com>
|
||||
Date: Wed, 24 Apr 2013 11:25:52 +0200
|
||||
Subject: [PATCH 1/2] Replace bundled base64 implementation
|
||||
From 82e728f896dffcd88c7cb86e8d9cbebd1a04d29e Mon Sep 17 00:00:00 2001
|
||||
From: Fabio Valentini <decathorpe@gmail.com>
|
||||
Date: Tue, 10 Sep 2019 13:38:15 +0200
|
||||
Subject: [PATCH] replace bundled base64coder with java.util.Base64
|
||||
|
||||
---
|
||||
.../snakeyaml/constructor/SafeConstructor.java | 2 +-
|
||||
.../external/biz/base64Coder/Base64Coder.java | 305 ---------------------
|
||||
.../snakeyaml/representer/SafeRepresenter.java | 2 +-
|
||||
.../source_code/base64Coder/Base64CoderTest.java | 73 -----
|
||||
.../snakeyaml/issues/issue99/YamlBase64Test.java | 2 +-
|
||||
5 files changed, 3 insertions(+), 381 deletions(-)
|
||||
pom.xml | 4 +-
|
||||
.../constructor/SafeConstructor.java | 4 +-
|
||||
.../external/biz/base64Coder/Base64Coder.java | 305 ------------------
|
||||
.../representer/SafeRepresenter.java | 6 +-
|
||||
.../base64Coder/Base64CoderTest.java | 73 -----
|
||||
.../issues/issue99/YamlBase64Test.java | 6 +-
|
||||
6 files changed, 10 insertions(+), 388 deletions(-)
|
||||
delete mode 100644 src/main/java/org/yaml/snakeyaml/external/biz/base64Coder/Base64Coder.java
|
||||
delete mode 100644 src/test/java/biz/source_code/base64Coder/Base64CoderTest.java
|
||||
|
||||
diff --git a/pom.xml b/pom.xml
|
||||
index 8112370..ae308c7 100644
|
||||
--- a/pom.xml
|
||||
+++ b/pom.xml
|
||||
@@ -10,8 +10,8 @@
|
||||
<project.scm.id>bitbucket</project.scm.id>
|
||||
<release.repo.url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</release.repo.url>
|
||||
<snapshot.repo.url>https://oss.sonatype.org/content/repositories/snapshots/</snapshot.repo.url>
|
||||
- <maven.compiler.source>7</maven.compiler.source>
|
||||
- <maven.compiler.target>7</maven.compiler.target>
|
||||
+ <maven.compiler.source>8</maven.compiler.source>
|
||||
+ <maven.compiler.target>8</maven.compiler.target>
|
||||
<maven.javadoc.failOnError>false</maven.javadoc.failOnError>
|
||||
<spring.version>3.2.17.RELEASE</spring.version>
|
||||
<maven-bundle-plugin.version>3.5.0</maven-bundle-plugin.version>
|
||||
diff --git a/src/main/java/org/yaml/snakeyaml/constructor/SafeConstructor.java b/src/main/java/org/yaml/snakeyaml/constructor/SafeConstructor.java
|
||||
index b5572ea..190384e 100644
|
||||
index bd022cc..217835d 100644
|
||||
--- a/src/main/java/org/yaml/snakeyaml/constructor/SafeConstructor.java
|
||||
+++ b/src/main/java/org/yaml/snakeyaml/constructor/SafeConstructor.java
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package org.yaml.snakeyaml.constructor;
|
||||
@@ -17,6 +17,7 @@ package org.yaml.snakeyaml.constructor;
|
||||
|
||||
+import biz.source_code.base64Coder.Base64Coder;
|
||||
import java.math.BigInteger;
|
||||
import java.text.NumberFormat;
|
||||
import java.text.ParseException;
|
||||
@@ -32,7 +33,6 @@ import java.util.regex.Matcher;
|
||||
import java.util.ArrayList;
|
||||
+import java.util.Base64;
|
||||
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;
|
||||
|
||||
import org.yaml.snakeyaml.error.YAMLException;
|
||||
@ -33,6 +49,15 @@ index b5572ea..190384e 100644
|
||||
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 {
|
||||
// Ignore white spaces for base64 encoded scalar
|
||||
String noWhiteSpaces = constructScalar((ScalarNode) node).toString().replaceAll("\\s",
|
||||
"");
|
||||
- byte[] decoded = Base64Coder.decode(noWhiteSpaces.toCharArray());
|
||||
+ byte[] decoded = Base64.getDecoder().decode(noWhiteSpaces);
|
||||
return decoded;
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/yaml/snakeyaml/external/biz/base64Coder/Base64Coder.java b/src/main/java/org/yaml/snakeyaml/external/biz/base64Coder/Base64Coder.java
|
||||
deleted file mode 100644
|
||||
index 65923b6..0000000
|
||||
@ -345,25 +370,43 @@ index 65923b6..0000000
|
||||
-
|
||||
-} // end class Base64Coder
|
||||
diff --git a/src/main/java/org/yaml/snakeyaml/representer/SafeRepresenter.java b/src/main/java/org/yaml/snakeyaml/representer/SafeRepresenter.java
|
||||
index 147e3af..b8dd4e0 100644
|
||||
index 2cc15d9..e5ac480 100644
|
||||
--- a/src/main/java/org/yaml/snakeyaml/representer/SafeRepresenter.java
|
||||
+++ b/src/main/java/org/yaml/snakeyaml/representer/SafeRepresenter.java
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package org.yaml.snakeyaml.representer;
|
||||
|
||||
+import biz.source_code.base64Coder.Base64Coder;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
@@ -19,6 +19,7 @@ import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.util.ArrayList;
|
||||
@@ -32,7 +33,6 @@ import java.util.UUID;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.Arrays;
|
||||
+import java.util.Base64;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
@@ -33,7 +34,6 @@ import java.util.regex.Pattern;
|
||||
|
||||
import org.yaml.snakeyaml.DumperOptions;
|
||||
import org.yaml.snakeyaml.error.YAMLException;
|
||||
-import org.yaml.snakeyaml.external.biz.base64Coder.Base64Coder;
|
||||
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 {
|
||||
if (!checkValue.equals(value)) {
|
||||
throw new YAMLException("invalid string value has occurred");
|
||||
}
|
||||
- binary = Base64Coder.encode(bytes);
|
||||
+ binary = Base64.getEncoder().encodeToString(bytes).toCharArray();
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
throw new YAMLException(e);
|
||||
}
|
||||
@@ -433,7 +433,7 @@ class SafeRepresenter extends BaseRepresenter {
|
||||
|
||||
protected class RepresentByteArray implements Represent {
|
||||
public Node representData(Object data) {
|
||||
- char[] binary = Base64Coder.encode((byte[]) data);
|
||||
+ char[] binary = Base64.getEncoder().encodeToString((byte[]) data).toCharArray();
|
||||
return representScalar(Tag.BINARY, String.valueOf(binary), DumperOptions.ScalarStyle.LITERAL);
|
||||
}
|
||||
}
|
||||
diff --git a/src/test/java/biz/source_code/base64Coder/Base64CoderTest.java b/src/test/java/biz/source_code/base64Coder/Base64CoderTest.java
|
||||
deleted file mode 100644
|
||||
index 60f6d84..0000000
|
||||
@ -444,17 +487,17 @@ index 60f6d84..0000000
|
||||
- }
|
||||
-}
|
||||
diff --git a/src/test/java/org/yaml/snakeyaml/issues/issue99/YamlBase64Test.java b/src/test/java/org/yaml/snakeyaml/issues/issue99/YamlBase64Test.java
|
||||
index 32e7eef..3275c7e 100644
|
||||
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
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package org.yaml.snakeyaml.issues.issue99;
|
||||
|
||||
+import biz.source_code.base64Coder.Base64Coder;
|
||||
@@ -18,6 +18,7 @@ package org.yaml.snakeyaml.issues.issue99;
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
+import java.util.Base64;
|
||||
import java.util.Map;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
@@ -27,7 +28,6 @@ import org.yaml.snakeyaml.Yaml;
|
||||
import org.yaml.snakeyaml.YamlDocument;
|
||||
import org.yaml.snakeyaml.constructor.AbstractConstruct;
|
||||
@ -463,6 +506,24 @@ index 32e7eef..3275c7e 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 {
|
||||
all = all + lines[i].trim();
|
||||
}
|
||||
// System.out.println(all);
|
||||
- byte[] decoded = Base64Coder.decode(all.toCharArray());
|
||||
+ byte[] decoded = Base64.getDecoder().decode(all);
|
||||
assertEquals(3737, decoded.length);
|
||||
checkBytes(decoded);
|
||||
}
|
||||
@@ -122,7 +122,7 @@ public class YamlBase64Test extends TestCase {
|
||||
public Object construct(Node node) {
|
||||
String contentWithNewLines = constructScalar((ScalarNode) node).toString();
|
||||
String noNewLines = contentWithNewLines.replaceAll("\\s", "");
|
||||
- byte[] decoded = Base64Coder.decode(noNewLines.toCharArray());
|
||||
+ byte[] decoded = Base64.getDecoder().decode(noNewLines);
|
||||
return decoded;
|
||||
}
|
||||
}
|
||||
--
|
||||
2.7.4
|
||||
2.21.0
|
||||
|
@ -5,11 +5,11 @@ Subject: [PATCH 2/2] Replace bundled gdata-java-client classes with
|
||||
commons-codec
|
||||
|
||||
---
|
||||
.../com/google/gdata/util/common/base/Escaper.java | 97 ----
|
||||
.../gdata/util/common/base/PercentEscaper.java | 281 ------------
|
||||
.../gdata/util/common/base/UnicodeEscaper.java | 506 ---------------------
|
||||
.../java/org/yaml/snakeyaml/util/UriEncoder.java | 37 +-
|
||||
4 files changed, 29 insertions(+), 892 deletions(-)
|
||||
.../gdata/util/common/base/Escaper.java | 97 ----
|
||||
.../util/common/base/PercentEscaper.java | 281 ----------
|
||||
.../util/common/base/UnicodeEscaper.java | 506 ------------------
|
||||
.../org/yaml/snakeyaml/util/UriEncoder.java | 37 +-
|
||||
4 files changed, 28 insertions(+), 893 deletions(-)
|
||||
delete mode 100644 src/main/java/org/yaml/snakeyaml/external/com/google/gdata/util/common/base/Escaper.java
|
||||
delete mode 100644 src/main/java/org/yaml/snakeyaml/external/com/google/gdata/util/common/base/PercentEscaper.java
|
||||
delete mode 100644 src/main/java/org/yaml/snakeyaml/external/com/google/gdata/util/common/base/UnicodeEscaper.java
|
||||
@ -917,20 +917,20 @@ index 5403185..0000000
|
||||
- };
|
||||
-}
|
||||
diff --git a/src/main/java/org/yaml/snakeyaml/util/UriEncoder.java b/src/main/java/org/yaml/snakeyaml/util/UriEncoder.java
|
||||
index e23904f..f266387 100644
|
||||
index 4cc18b4..b6a1992 100644
|
||||
--- a/src/main/java/org/yaml/snakeyaml/util/UriEncoder.java
|
||||
+++ b/src/main/java/org/yaml/snakeyaml/util/UriEncoder.java
|
||||
@@ -23,25 +23,46 @@ import java.nio.charset.CharacterCodingException;
|
||||
@@ -23,27 +23,46 @@ import java.nio.charset.CharacterCodingException;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
import java.nio.charset.CodingErrorAction;
|
||||
-
|
||||
+import java.util.BitSet;
|
||||
|
||||
+
|
||||
+import org.apache.commons.codec.net.URLCodec;
|
||||
import org.yaml.snakeyaml.error.YAMLException;
|
||||
-import org.yaml.snakeyaml.external.com.google.gdata.util.common.base.Escaper;
|
||||
-import org.yaml.snakeyaml.external.com.google.gdata.util.common.base.PercentEscaper;
|
||||
+
|
||||
|
||||
public abstract class UriEncoder {
|
||||
private static final CharsetDecoder UTF8Decoder = Charset.forName("UTF-8").newDecoder()
|
||||
@ -940,8 +940,8 @@ index e23904f..f266387 100644
|
||||
- // http://yaml.org/spec/1.1/#escaping%20in%20URI/
|
||||
- private static final String SAFE_CHARS = PercentEscaper.SAFEPATHCHARS_URLENCODER + "[]/";
|
||||
- private static final Escaper escaper = new PercentEscaper(SAFE_CHARS, false);
|
||||
+
|
||||
+ // default safe characters which can appear within URI and shouldn't be escaped
|
||||
|
||||
+ // default safe characters which can appear within URI and shouldn't be escaped
|
||||
+ private static final BitSet allowedCharacters = new BitSet(256);
|
||||
+
|
||||
+ static {
|
||||
@ -959,9 +959,10 @@ index e23904f..f266387 100644
|
||||
+ allowedCharacters.set(c);
|
||||
+ }
|
||||
+ }
|
||||
|
||||
/**
|
||||
* Escape special characters with '%'
|
||||
* @param uri URI to be escaped
|
||||
* @return encoded URI
|
||||
*/
|
||||
public static String encode(String uri) {
|
||||
- return escaper.escape(uri);
|
||||
@ -976,5 +977,5 @@ index e23904f..f266387 100644
|
||||
|
||||
/**
|
||||
--
|
||||
2.7.4
|
||||
2.20.1
|
||||
|
||||
|
61
0003-fix-broken-test.patch
Normal file
61
0003-fix-broken-test.patch
Normal file
@ -0,0 +1,61 @@
|
||||
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.<Throwable> 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);
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:816c2056d3a734c39a09815e38b33c08c3e9ecbb95e5dcf5464b83c01fe4ecc5
|
||||
size 291351
|
3
snakeyaml-1.25.tar.bz2
Normal file
3
snakeyaml-1.25.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5ca1b968b939eab9bd338183fded8d0d540e94b211fa9cf759c6312f195303ba
|
||||
size 332303
|
@ -12,7 +12,7 @@
|
||||
<property name="project.description" value="YAML 1.1 parser and emitter for Java"/>
|
||||
<property name="project.groupId" value="org.yaml"/>
|
||||
<property name="project.artifactId" value="snakeyaml"/>
|
||||
<property name="project.version" value="1.17"/>
|
||||
<property name="project.version" value="1.25"/>
|
||||
<property name="bundle.version" value="${project.version}.0"/>
|
||||
|
||||
<property name="compiler.source" value="1.6"/>
|
||||
|
@ -1,3 +1,19 @@
|
||||
-------------------------------------------------------------------
|
||||
Sun Nov 10 05:55:34 UTC 2019 - Fridrich Strba <fstrba@suse.com>
|
||||
|
||||
- Upgrade to upstream release 1.25
|
||||
- Removed patch:
|
||||
* 0001-Replace-bundled-base64-implementation.patch
|
||||
+ replaced by other implementation
|
||||
- Modified patch:
|
||||
* 0002-Replace-bundled-gdata-java-client-classes-with-commo.patch
|
||||
+ Rediff to changed context
|
||||
- Added patches:
|
||||
* 0001-replace-bundled-base64coder-with-java.util.Base64.patch
|
||||
+ Replace with internal jdk8+ implementation
|
||||
* 0003-fix-broken-test.patch
|
||||
+ fix a broken test
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Mar 1 06:32:02 UTC 2019 - Fridrich Strba <fstrba@suse.com>
|
||||
|
||||
|
@ -16,26 +16,29 @@
|
||||
#
|
||||
|
||||
|
||||
%global vertag 70abb5efa4c0
|
||||
%global vertag 8450addf3473
|
||||
%bcond_with tests
|
||||
Name: snakeyaml
|
||||
Version: 1.17
|
||||
Version: 1.25
|
||||
Release: 0
|
||||
Summary: YAML parser and emitter for the Java programming language
|
||||
License: Apache-2.0
|
||||
Group: Development/Libraries/Java
|
||||
URL: https://bitbucket.org/asomov/snakeyaml/
|
||||
Source0: https://bitbucket.org/asomov/snakeyaml/get/v%{version}.tar.bz2#/%{name}-%{version}.tar.bz2
|
||||
Source0: https://bitbucket.org/asomov/snakeyaml/get/%{name}-%{version}.tar.bz2
|
||||
Source1: %{name}-build.xml
|
||||
# Upstream has forked gdata-java and base64 and refuses [1] to
|
||||
# consider replacing them by external dependencies. Bundled libraries
|
||||
# need to be removed and their use replaced by system libraries.
|
||||
# See rhbz#875777 and http://code.google.com/p/snakeyaml/issues/detail?id=175
|
||||
#
|
||||
# Remove use of bundled Base64 implementation
|
||||
Patch0: 0001-Replace-bundled-base64-implementation.patch
|
||||
# We don't have gdata-java in Fedora any longer, use commons-codec instead
|
||||
# Replace use of bundled Base64 implementation with java.util.Base64
|
||||
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
|
||||
@ -81,6 +84,7 @@ 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
|
||||
|
Loading…
x
Reference in New Issue
Block a user