From ed91eda3a8bac024e4673cdffea3e7baf71de922 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 1 Aug 2023 08:10:26 +0200 Subject: [PATCH] Resolves: rhbz#2225976 Adapt test code to cURL 8.2.0 --- 0001-Adapt-test-code-to-cURL-8.2.0.patch | 83 ++++++++++++++++++++++++ libreoffice.spec | 1 + 2 files changed, 84 insertions(+) create mode 100644 0001-Adapt-test-code-to-cURL-8.2.0.patch diff --git a/0001-Adapt-test-code-to-cURL-8.2.0.patch b/0001-Adapt-test-code-to-cURL-8.2.0.patch new file mode 100644 index 0000000..bfe94fc --- /dev/null +++ b/0001-Adapt-test-code-to-cURL-8.2.0.patch @@ -0,0 +1,83 @@ +From 2a68dc02bd19a717d3c86873206fabed1098f228 Mon Sep 17 00:00:00 2001 +From: Stephan Bergmann +Date: Mon, 31 Jul 2023 17:09:32 +0200 +Subject: [PATCH] Adapt test code to cURL 8.2.0 + +...for which CppunitTest_ucb_webdav_core would fail with + +> ucb/qa/cppunit/webdav/webdav_local_neon.cxx:60:(anonymous namespace)::webdav_local_test::WebdavUriTest +> equality assertion failed +> - Expected: ?query#fragment +> - Actual : /?query#fragment + +and + +> ucb/qa/cppunit/webdav/webdav_local_neon.cxx:89:(anonymous namespace)::webdav_local_test::WebdavUriTest2 +> equality assertion failed +> - Expected: ?query +> - Actual : /?query + +because of + +"urlapi: have *set(PATH) prepend a slash if one is missing". + +All that test code had been added with b03e070420606d407df2ec5e9dfa7043ecc46177 +"ucb: webdav-curl: fix CurlUri::CloneWithRelativeRefPathAbsolute()", and it +looks harmless for our use cases that cURL started to behave differently there +now. So instead of accepting either of the outcomes depending on what cURL +version is being used, just change the test code to not leave out the +path-absolute in the calls to CloneWithRelativeRefPathAbsolute (which is +documented in ucb/source/ucp/webdav-curl/CurlUri.hxx to take + +> /// @param matches: relative-ref = path-absolute [ "?" query ] [ "#" fragment ] + +and path-absolute cannot be empty as per RFC 3986 "Uniform Resource Identifier +(URI): Generic Syntax"). + +Change-Id: If07a28598dfa047ebe89d8bcda19e8fcaa36aed0 +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155099 +Reviewed-by: Michael Stahl +Tested-by: Jenkins +Reviewed-by: Stephan Bergmann +--- + ucb/qa/cppunit/webdav/webdav_local_neon.cxx | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/ucb/qa/cppunit/webdav/webdav_local_neon.cxx b/ucb/qa/cppunit/webdav/webdav_local_neon.cxx +index bde7652b9ffa..a457bc6d2b28 100644 +--- a/ucb/qa/cppunit/webdav/webdav_local_neon.cxx ++++ b/ucb/qa/cppunit/webdav/webdav_local_neon.cxx +@@ -52,12 +52,12 @@ namespace + CPPUNIT_ASSERT_EQUAL( OUString("/foo/bar"), uri2.GetRelativeReference() ); + CPPUNIT_ASSERT_EQUAL( OUString("http://user%40anothername@server.biz:8040/foo/bar"), uri2.GetURI() ); + +- CurlUri uri3(aURI.CloneWithRelativeRefPathAbsolute(u"?query#fragment")); ++ CurlUri uri3(aURI.CloneWithRelativeRefPathAbsolute(u"/?query#fragment")); + CPPUNIT_ASSERT_EQUAL( OUString("http"), uri3.GetScheme() ); + CPPUNIT_ASSERT_EQUAL( OUString("server.biz"), uri3.GetHost() ); + CPPUNIT_ASSERT_EQUAL( OUString("user%40anothername"), uri3.GetUser() ); + CPPUNIT_ASSERT_EQUAL( sal_uInt16(8040), uri3.GetPort() ); +- CPPUNIT_ASSERT_EQUAL( OUString("?query#fragment"), uri3.GetRelativeReference() ); ++ CPPUNIT_ASSERT_EQUAL( OUString("/?query#fragment"), uri3.GetRelativeReference() ); + CPPUNIT_ASSERT_EQUAL( OUString("http://user%40anothername@server.biz:8040/?query#fragment"), uri3.GetURI() ); + } + +@@ -80,13 +80,13 @@ namespace + CPPUNIT_ASSERT_EQUAL( OUString("/foo/bar"), uri2.GetRelativeReference() ); + CPPUNIT_ASSERT_EQUAL( OUString("https://foo:bar@server.biz:8040/foo/bar"), uri2.GetURI() ); + +- CurlUri uri3(aURI.CloneWithRelativeRefPathAbsolute(u"?query")); ++ CurlUri uri3(aURI.CloneWithRelativeRefPathAbsolute(u"/?query")); + CPPUNIT_ASSERT_EQUAL( OUString("https"), uri3.GetScheme() ); + CPPUNIT_ASSERT_EQUAL( OUString("server.biz"), uri3.GetHost() ); + CPPUNIT_ASSERT_EQUAL( OUString("foo"), uri3.GetUser() ); + CPPUNIT_ASSERT_EQUAL( OUString("bar"), uri3.GetPassword() ); + CPPUNIT_ASSERT_EQUAL( sal_uInt16(8040), uri3.GetPort() ); +- CPPUNIT_ASSERT_EQUAL( OUString("?query"), uri3.GetRelativeReference() ); ++ CPPUNIT_ASSERT_EQUAL( OUString("/?query"), uri3.GetRelativeReference() ); + CPPUNIT_ASSERT_EQUAL( OUString("https://foo:bar@server.biz:8040/?query"), uri3.GetURI() ); + } + +-- +2.41.0 + diff --git a/libreoffice.spec b/libreoffice.spec index cf04047..ba6beb2 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -274,6 +274,7 @@ Patch6: 0001-include-filename-if-the-test-fails.patch # backported Patch7: 0001-fix-testSignDocument_PEM_PDF.patch Patch8: 0001-Only-pass-I.-arguments-to-g-ir-scanner-by-using-pkg-.patch +Patch9: 0001-Adapt-test-code-to-cURL-8.2.0.patch # not upstreamed Patch500: 0001-disable-libe-book-support.patch