diff --git a/0001-t-lib-gpg-quote-path-to-GNUPGHOME-trustlist.txt.patch b/0001-t-lib-gpg-quote-path-to-GNUPGHOME-trustlist.txt.patch new file mode 100644 index 0000000..7a39316 --- /dev/null +++ b/0001-t-lib-gpg-quote-path-to-GNUPGHOME-trustlist.txt.patch @@ -0,0 +1,39 @@ +From 32ca60bbf5bb3020bbf24036bc61003711ace611 Mon Sep 17 00:00:00 2001 +From: Todd Zullinger +Date: Fri, 1 Feb 2019 19:36:41 -0500 +Subject: [PATCH 1/2] t/lib-gpg: quote path to ${GNUPGHOME}/trustlist.txt + +When gpgsm is installed, lib-gpg.sh attempts to update trustlist.txt to +relax the checking of some root certificate requirements. The path to +"${GNUPGHOME}" contains spaces which cause an "ambiguous redirect" +warning when bash is used to run the tests: + + $ bash t7030-verify-tag.sh + /git/t/lib-gpg.sh: line 66: ${GNUPGHOME}/trustlist.txt: ambiguous redirect + ok 1 - create signed tags + ok 2 # skip create signed tags x509 (missing GPGSM) + ... + +No warning is issued when using bash called as /bin/sh, dash, or mksh. + +Quote the path to ensure the redirect works as intended and sets the +GPGSM prereq. While we're here, drop the space after ">>". + +Signed-off-by: Todd Zullinger +--- + t/lib-gpg.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/t/lib-gpg.sh b/t/lib-gpg.sh +index f1277bef4f..207009793b 100755 +--- a/t/lib-gpg.sh ++++ b/t/lib-gpg.sh +@@ -63,7 +63,7 @@ then + cut -d" " -f4 | + tr -d '\n' >"${GNUPGHOME}/trustlist.txt" && + +- echo " S relax" >> ${GNUPGHOME}/trustlist.txt && ++ echo " S relax" >>"${GNUPGHOME}/trustlist.txt" && + (gpgconf --kill gpg-agent >/dev/null 2>&1 || : ) && + echo hello | gpgsm --homedir "${GNUPGHOME}" >/dev/null \ + -u committer@example.com -o /dev/null --sign - 2>&1 && diff --git a/0002-t-lib-gpg-drop-redundant-killing-of-gpg-agent.patch b/0002-t-lib-gpg-drop-redundant-killing-of-gpg-agent.patch new file mode 100644 index 0000000..2c1f4d1 --- /dev/null +++ b/0002-t-lib-gpg-drop-redundant-killing-of-gpg-agent.patch @@ -0,0 +1,40 @@ +From 09436d6a5b6db6ab8e80ab449b3b841883b27d19 Mon Sep 17 00:00:00 2001 +From: Todd Zullinger +Date: Sat, 2 Feb 2019 02:31:52 -0500 +Subject: [PATCH 2/2] t/lib-gpg: drop redundant killing of gpg-agent + +In 53fc999306 ("gpg-interface t: extend the existing GPG tests with +GPGSM", 2018-07-20), the gpgconf call which kills gpg-agent was copied +from the existing gpg setup code. + +The reason for killing gpg-agent is given in 29ff1f8f74 ("t: lib-gpg: +flush gpg agent on startup", 2017-07-20): + + When running gpg-relevant tests, a gpg-daemon is spawned for each + GNUPGHOME used. This daemon may stay running after the test and cache + file descriptors for the trash directories, even after the trash + directory is removed. This leads to ENOENT errors when attempting to + create files if tests are run multiple times. + + Add a cleanup script to force flushing the gpg-agent for that GNUPGHOME + (if any) before setting up the GPG relevant-environment. + +Killing gpg-agent once per test is sufficient. + +Signed-off-by: Todd Zullinger +--- + t/lib-gpg.sh | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/t/lib-gpg.sh b/t/lib-gpg.sh +index 207009793b..8d28652b72 100755 +--- a/t/lib-gpg.sh ++++ b/t/lib-gpg.sh +@@ -64,7 +64,6 @@ then + tr -d '\n' >"${GNUPGHOME}/trustlist.txt" && + + echo " S relax" >>"${GNUPGHOME}/trustlist.txt" && +- (gpgconf --kill gpg-agent >/dev/null 2>&1 || : ) && + echo hello | gpgsm --homedir "${GNUPGHOME}" >/dev/null \ + -u committer@example.com -o /dev/null --sign - 2>&1 && + test_set_prereq GPGSM diff --git a/git.spec b/git.spec index 7e9395f..1533f23 100644 --- a/git.spec +++ b/git.spec @@ -119,6 +119,12 @@ Source99: print-failed-test-output # https://bugzilla.redhat.com/490602 Patch0: git-cvsimport-Ignore-cvsps-2.2b1-Branches-output.patch +# Fix "ambiguous redirect" in t/lib-gpg.sh; it causes gpgsm tests to be skipped +# https://public-inbox.org/git/20190208031746.22683-2-tmz@pobox.com/ +Patch2: 0001-t-lib-gpg-quote-path-to-GNUPGHOME-trustlist.txt.patch +# t/lib-gpg: drop redundant killing of gpg-agent +# https://public-inbox.org/git/20190208031746.22683-3-tmz@pobox.com/ +Patch3: 0002-t-lib-gpg-drop-redundant-killing-of-gpg-agent.patch %if %{with docs} # pod2man is needed to build Git.3pm @@ -186,6 +192,9 @@ BuildRequires: glibc-langpack-en BuildRequires: glibc-langpack-is %endif # use_glibc_langpacks BuildRequires: gnupg +%if 0%{?fedora} || 0%{?rhel} > 8 +BuildRequires: gnupg2-smime +%endif # fedora or el > 8 %if 0%{?fedora} || ( 0%{?rhel} && ( 0%{?rhel} == 6 || 0%{?rhel} >= 7 && %{_arch} != ppc64 )) BuildRequires: highlight %endif # fedora, el-6, or el7-ppc64 @@ -202,6 +211,7 @@ BuildRequires: perl(DBD::SQLite) BuildRequires: perl(Digest::MD5) BuildRequires: perl(HTTP::Date) BuildRequires: perl(IO::Pty) +BuildRequires: perl(JSON) BuildRequires: perl(Mail::Address) BuildRequires: perl(Memoize) BuildRequires: perl(Test::More) @@ -925,6 +935,7 @@ make -C contrib/credential/netrc/ testverbose - Remove extraneous pcre BuildRequires - Add additional BuildRequires for i18n locales used in tests - Replace gitweb home-link with inline sed +- Add gnupg2-smime and perl JSON BuildRequires for tests * Thu Jan 31 2019 Fedora Release Engineering - 2.20.1-1.1 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild