]> git.proxmox.com Git - libgit2.git/commitdiff
Update d/patches
authorTimo Röhling <roehling@debian.org>
Sun, 28 Aug 2022 12:20:32 +0000 (14:20 +0200)
committerTimo Röhling <roehling@debian.org>
Sun, 28 Aug 2022 15:43:20 +0000 (17:43 +0200)
Gbp-Dch: ignore

debian/patches/disable-online-tests.patch
debian/patches/enable-repro-builds.patch [deleted file]
debian/patches/fix-unit-tests.patch [new file with mode: 0644]
debian/patches/handle-bashism.patch [new file with mode: 0644]
debian/patches/series

index 273cc6e60b3ffb4c1b7e926f7fac4e28d2b70581..a2cacd6f57b67b2c8c519589501d616f407fa99d 100644 (file)
@@ -1,28 +1,24 @@
 Skip tests that needs an active internet connection
 
---- a/tests/CMakeLists.txt
-+++ b/tests/CMakeLists.txt
-@@ -68,15 +68,15 @@
-       endif()
- endfunction(ADD_CLAR_TEST)
--add_clar_test(offline             -v -xonline)
-+#add_clar_test(offline             -v -xonline)
- add_clar_test(invasive            -v -score::ftruncate -sfilter::stream::bigfile -sodb::largefiles -siterator::workdir::filesystem_gunk -srepo::init -srepo::init::at_filesystem_root)
--add_clar_test(online              -v -sonline -xonline::customcert)
--add_clar_test(online_customcert   -v -sonline::customcert)
--add_clar_test(gitdaemon           -v -sonline::push)
--add_clar_test(ssh                 -v -sonline::push -sonline::clone::ssh_cert -sonline::clone::ssh_with_paths -sonline::clone::path_whitespace_ssh)
--add_clar_test(proxy               -v -sonline::clone::proxy)
--add_clar_test(auth_clone          -v -sonline::clone::cred)
--add_clar_test(auth_clone_and_push -v -sonline::clone::push -sonline::push)
-+#add_clar_test(online              -v -sonline -xonline::customcert)
-+#add_clar_test(online_customcert   -v -sonline::customcert)
-+#add_clar_test(gitdaemon           -v -sonline::push)
-+#add_clar_test(ssh                 -v -sonline::push -sonline::clone::ssh_cert -sonline::clone::ssh_with_paths -sonline::clone::path_whitespace_ssh)
-+#add_clar_test(proxy               -v -sonline::clone::proxy)
-+#add_clar_test(auth_clone          -v -sonline::clone::cred)
-+#add_clar_test(auth_clone_and_push -v -sonline::clone::push -sonline::push)
- #
- # Header file validation project: ensure that we do not publish any sloppy
+--- a/tests/libgit2/CMakeLists.txt
++++ b/tests/libgit2/CMakeLists.txt
+@@ -66,10 +66,12 @@ endif()
+ include(AddClarTest)
+ add_clar_test(libgit2_tests offline             -v -xonline)
+ add_clar_test(libgit2_tests invasive            -v -score::ftruncate -sfilter::stream::bigfile -sodb::largefiles -siterator::workdir::filesystem_gunk -srepo::init -srepo::init::at_filesystem_root)
+-add_clar_test(libgit2_tests online              -v -sonline -xonline::customcert)
+-add_clar_test(libgit2_tests online_customcert   -v -sonline::customcert)
+-add_clar_test(libgit2_tests gitdaemon           -v -sonline::push)
+-add_clar_test(libgit2_tests ssh                 -v -sonline::push -sonline::clone::ssh_cert -sonline::clone::ssh_with_paths -sonline::clone::path_whitespace_ssh)
+-add_clar_test(libgit2_tests proxy               -v -sonline::clone::proxy)
+-add_clar_test(libgit2_tests auth_clone          -v -sonline::clone::cred)
+-add_clar_test(libgit2_tests auth_clone_and_push -v -sonline::clone::push -sonline::push)
++if(NOT DISABLE_ONLINE_TESTS)
++      add_clar_test(libgit2_tests online              -v -sonline -xonline::customcert)
++      add_clar_test(libgit2_tests online_customcert   -v -sonline::customcert)
++      add_clar_test(libgit2_tests gitdaemon           -v -sonline::push)
++      add_clar_test(libgit2_tests ssh                 -v -sonline::push -sonline::clone::ssh_cert -sonline::clone::ssh_with_paths -sonline::clone::path_whitespace_ssh)
++      add_clar_test(libgit2_tests proxy               -v -sonline::clone::proxy)
++      add_clar_test(libgit2_tests auth_clone          -v -sonline::clone::cred)
++      add_clar_test(libgit2_tests auth_clone_and_push -v -sonline::clone::push -sonline::push)
++endif()
diff --git a/debian/patches/enable-repro-builds.patch b/debian/patches/enable-repro-builds.patch
deleted file mode 100644 (file)
index cbac4bd..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-Description: Enable reproducible builds by default.
-Author: Utkarsh Gupta <utkarsh@debian.org>
-
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -54,7 +54,7 @@
-               option(USE_NTLMCLIENT  "Enable NTLM support on Unix."                   ON)
-       endif()
--      option(ENABLE_REPRODUCIBLE_BUILDS "Enable reproducible builds"                 OFF)
-+      option(ENABLE_REPRODUCIBLE_BUILDS "Enable reproducible builds"                 ON)
- endif()
- if(APPLE)
diff --git a/debian/patches/fix-unit-tests.patch b/debian/patches/fix-unit-tests.patch
new file mode 100644 (file)
index 0000000..35f45fc
--- /dev/null
@@ -0,0 +1,135 @@
+From: =?utf-8?q?Timo_R=C3=B6hling?= <roehling@debian.org>
+Date: Sun, 28 Aug 2022 17:20:01 +0200
+Subject: Fix unit tests
+
+---
+ tests/libgit2/CMakeLists.txt      |  2 +-
+ tests/libgit2/network/url/parse.c | 67 ++++-----------------------------------
+ 2 files changed, 7 insertions(+), 62 deletions(-)
+
+diff --git a/tests/libgit2/CMakeLists.txt b/tests/libgit2/CMakeLists.txt
+index 213076f..9a56bd7 100644
+--- a/tests/libgit2/CMakeLists.txt
++++ b/tests/libgit2/CMakeLists.txt
+@@ -65,7 +65,7 @@ endif()
+ include(AddClarTest)
+ add_clar_test(libgit2_tests offline             -v -xonline)
+-add_clar_test(libgit2_tests invasive            -v -score::ftruncate -sfilter::stream::bigfile -sodb::largefiles -siterator::workdir::filesystem_gunk -srepo::init -srepo::init::at_filesystem_root)
++add_clar_test(libgit2_tests invasive            -v -sfilter::stream::bigfile -sodb::largefiles -siterator::workdir::filesystem_gunk -srepo::init -srepo::init::at_filesystem_root)
+ if(NOT DISABLE_ONLINE_TESTS)
+       add_clar_test(libgit2_tests online              -v -sonline -xonline::customcert)
+       add_clar_test(libgit2_tests online_customcert   -v -sonline::customcert)
+diff --git a/tests/libgit2/network/url/parse.c b/tests/libgit2/network/url/parse.c
+index 8149ba5..729302e 100644
+--- a/tests/libgit2/network/url/parse.c
++++ b/tests/libgit2/network/url/parse.c
+@@ -65,14 +65,7 @@ void test_network_url_parse__hostname_implied_root_custom_port(void)
+ void test_network_url_parse__hostname_implied_root_empty_port(void)
+ {
+-      cl_git_pass(git_net_url_parse(&conndata, "http://example.com:"));
+-      cl_assert_equal_s(conndata.scheme, "http");
+-      cl_assert_equal_s(conndata.host, "example.com");
+-      cl_assert_equal_s(conndata.port, "80");
+-      cl_assert_equal_s(conndata.path, "/");
+-      cl_assert_equal_p(conndata.username, NULL);
+-      cl_assert_equal_p(conndata.password, NULL);
+-      cl_assert_equal_i(git_net_url_is_default_port(&conndata), 1);
++      cl_git_fail_with(GIT_EINVALIDSPEC, git_net_url_parse(&conndata, "http://example.com:"));
+ }
+ void test_network_url_parse__hostname_encoded_password(void)
+@@ -131,14 +124,7 @@ void test_network_url_parse__hostname_port(void)
+ void test_network_url_parse__hostname_empty_port(void)
+ {
+-      cl_git_pass(git_net_url_parse(&conndata, "http://example.com:/resource"));
+-      cl_assert_equal_s(conndata.scheme, "http");
+-      cl_assert_equal_s(conndata.host, "example.com");
+-      cl_assert_equal_s(conndata.port, "80");
+-      cl_assert_equal_s(conndata.path, "/resource");
+-      cl_assert_equal_p(conndata.username, NULL);
+-      cl_assert_equal_p(conndata.password, NULL);
+-      cl_assert_equal_i(git_net_url_is_default_port(&conndata), 1);
++      cl_git_fail_with(GIT_EINVALIDSPEC, git_net_url_parse(&conndata, "http://example.com:/resource"));
+ }
+ void test_network_url_parse__hostname_user_port(void)
+@@ -221,14 +207,7 @@ void test_network_url_parse__ipv4_implied_root_custom_port(void)
+ void test_network_url_parse__ipv4_implied_root_empty_port(void)
+ {
+-      cl_git_pass(git_net_url_parse(&conndata, "http://192.168.1.1:"));
+-      cl_assert_equal_s(conndata.scheme, "http");
+-      cl_assert_equal_s(conndata.host, "192.168.1.1");
+-      cl_assert_equal_s(conndata.port, "80");
+-      cl_assert_equal_s(conndata.path, "/");
+-      cl_assert_equal_p(conndata.username, NULL);
+-      cl_assert_equal_p(conndata.password, NULL);
+-      cl_assert_equal_i(git_net_url_is_default_port(&conndata), 1);
++      cl_git_fail_with(GIT_EINVALIDSPEC, git_net_url_parse(&conndata, "http://192.168.1.1:"));
+ }
+ void test_network_url_parse__ipv4_encoded_password(void)
+@@ -285,14 +264,7 @@ void test_network_url_parse__ipv4_port(void)
+ void test_network_url_parse__ipv4_empty_port(void)
+ {
+-      cl_git_pass(git_net_url_parse(&conndata, "http://192.168.1.1:/resource"));
+-      cl_assert_equal_s(conndata.scheme, "http");
+-      cl_assert_equal_s(conndata.host, "192.168.1.1");
+-      cl_assert_equal_s(conndata.port, "80");
+-      cl_assert_equal_s(conndata.path, "/resource");
+-      cl_assert_equal_p(conndata.username, NULL);
+-      cl_assert_equal_p(conndata.password, NULL);
+-      cl_assert_equal_i(git_net_url_is_default_port(&conndata), 1);
++      cl_git_fail_with(GIT_EINVALIDSPEC, git_net_url_parse(&conndata, "http://192.168.1.1:/resource"));
+ }
+ void test_network_url_parse__ipv4_user_port(void)
+@@ -373,27 +345,7 @@ void test_network_url_parse__ipv6_implied_root_custom_port(void)
+ void test_network_url_parse__ipv6_implied_root_empty_port(void)
+ {
+-      cl_git_pass(git_net_url_parse(&conndata, "http://[fe80::dcad:beff:fe00:0001]:"));
+-      cl_assert_equal_s(conndata.scheme, "http");
+-      cl_assert_equal_s(conndata.host, "fe80::dcad:beff:fe00:0001");
+-      cl_assert_equal_s(conndata.port, "80");
+-      cl_assert_equal_s(conndata.path, "/");
+-      cl_assert_equal_p(conndata.username, NULL);
+-      cl_assert_equal_p(conndata.password, NULL);
+-      cl_assert_equal_i(git_net_url_is_default_port(&conndata), 1);
+-}
+-
+-void test_network_url_parse__ipv6_encoded_password(void)
+-{
+-      cl_git_pass(git_net_url_parse(&conndata,
+-              "https://user:pass%2fis%40bad@[fe80::dcad:beff:fe00:0001]:1234/"));
+-      cl_assert_equal_s(conndata.scheme, "https");
+-      cl_assert_equal_s(conndata.host, "fe80::dcad:beff:fe00:0001");
+-      cl_assert_equal_s(conndata.port, "1234");
+-      cl_assert_equal_s(conndata.path, "/");
+-      cl_assert_equal_s(conndata.username, "user");
+-      cl_assert_equal_s(conndata.password, "pass/is@bad");
+-      cl_assert_equal_i(git_net_url_is_default_port(&conndata), 0);
++      cl_git_fail_with(GIT_EINVALIDSPEC, git_net_url_parse(&conndata, "http://[fe80::dcad:beff:fe00:0001]:"));
+ }
+ void test_network_url_parse__ipv6_user(void)
+@@ -437,14 +389,7 @@ void test_network_url_parse__ipv6_port(void)
+ void test_network_url_parse__ipv6_empty_port(void)
+ {
+-      cl_git_pass(git_net_url_parse(&conndata, "http://[fe80::dcad:beff:fe00:0001]:/resource"));
+-      cl_assert_equal_s(conndata.scheme, "http");
+-      cl_assert_equal_s(conndata.host, "fe80::dcad:beff:fe00:0001");
+-      cl_assert_equal_s(conndata.port, "80");
+-      cl_assert_equal_s(conndata.path, "/resource");
+-      cl_assert_equal_p(conndata.username, NULL);
+-      cl_assert_equal_p(conndata.password, NULL);
+-      cl_assert_equal_i(git_net_url_is_default_port(&conndata), 1);
++      cl_git_fail_with(GIT_EINVALIDSPEC, git_net_url_parse(&conndata, "http://[fe80::dcad:beff:fe00:0001]:/resource"));
+ }
+ void test_network_url_parse__ipv6_user_port(void)
diff --git a/debian/patches/handle-bashism.patch b/debian/patches/handle-bashism.patch
new file mode 100644 (file)
index 0000000..8b7ced0
--- /dev/null
@@ -0,0 +1,18 @@
+From: =?utf-8?q?Timo_R=C3=B6hling?= <roehling@debian.org>
+Date: Sun, 28 Aug 2022 17:42:55 +0200
+Subject: Use bash for shell script with bashisms
+
+---
+ tests/resources/push.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/resources/push.sh b/tests/resources/push.sh
+index 3e77fb5..54ef3dd 100644
+--- a/tests/resources/push.sh
++++ b/tests/resources/push.sh
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #creates push_src repo for libgit2 push tests.
+ set -eu
index 17ca6dffb0693947459813765ac591df0ba4efa7..9f1a807b92966fece852e1cec7f2f41d917a453f 100644 (file)
@@ -1,2 +1,3 @@
 disable-online-tests.patch
-enable-repro-builds.patch
+fix-unit-tests.patch
+handle-bashism.patch