commit: b86b4f7d1520d21fbf77f71ded8eb01988419094 Author: Christopher Byrne <salah.coronya <AT> gmail <DOT> com> AuthorDate: Tue Oct 1 23:05:09 2024 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Wed Oct 2 01:21:58 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b86b4f7d
app-crypt/tpm2-tools: Remove requirement for 'which' in tests Closes: https://bugs.gentoo.org/930088 Signed-off-by: Christopher Byrne <salah.coronya <AT> gmail.com> Signed-off-by: Sam James <sam <AT> gentoo.org> ...s-5.7-tests-Eliminate-dependency-on-which.patch | 42 ++++++++++++++++++++++ app-crypt/tpm2-tools/tpm2-tools-5.7.ebuild | 1 + 2 files changed, 43 insertions(+) diff --git a/app-crypt/tpm2-tools/files/tpm2-tools-5.7-tests-Eliminate-dependency-on-which.patch b/app-crypt/tpm2-tools/files/tpm2-tools-5.7-tests-Eliminate-dependency-on-which.patch new file mode 100644 index 000000000000..1872d7d2389e --- /dev/null +++ b/app-crypt/tpm2-tools/files/tpm2-tools-5.7-tests-Eliminate-dependency-on-which.patch @@ -0,0 +1,42 @@ +From e9af1553f26ebad6e8db14b599dc74bab5663806 Mon Sep 17 00:00:00 2001 +From: Christopher Byrne <[email protected]> +Date: Tue, 16 Apr 2024 09:32:30 -0500 +Subject: [PATCH] tests: Eliminate dependency on 'which' + +See https://lwn.net/Articles/874049/ + +Signed-off-by: Christopher Byrne <[email protected]> +--- + test/integration/tests/pcrevent.sh | 2 +- + test/integration/tests/symlink.sh | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/test/integration/tests/pcrevent.sh b/test/integration/tests/pcrevent.sh +index 5484cfbe..d7166789 100644 +--- a/test/integration/tests/pcrevent.sh ++++ b/test/integration/tests/pcrevent.sh +@@ -44,7 +44,7 @@ yaml_verify $hash_out_file + while IFS='' read -r l || [[ -n "$l" ]]; do + + alg=`echo -n $l | cut -d\: -f 1-1` +- if ! which "$alg"sum >/dev/null 2>&1; then ++ if ! command -v "$alg"sum >/dev/null 2>&1; then + echo "Ignore checking $alg algorithm due to unavailable \"${alg}sum\" program" + continue + fi +diff --git a/test/integration/tests/symlink.sh b/test/integration/tests/symlink.sh +index 606e1a1a..f65a7567 100644 +--- a/test/integration/tests/symlink.sh ++++ b/test/integration/tests/symlink.sh +@@ -17,7 +17,7 @@ start_up + # Positive tests: + # + fail=0 +-TPM2_TOOL="$(which tpm2)" ++TPM2_TOOL="$(command -v tpm2)" + + if [ -z "$TPM2_TOOL" ]; then + echo "unable to locate tpm2 tool" +-- +2.45.2 + diff --git a/app-crypt/tpm2-tools/tpm2-tools-5.7.ebuild b/app-crypt/tpm2-tools/tpm2-tools-5.7.ebuild index 99c2a66f1a7f..aa2d0dcdcc58 100644 --- a/app-crypt/tpm2-tools/tpm2-tools-5.7.ebuild +++ b/app-crypt/tpm2-tools/tpm2-tools-5.7.ebuild @@ -38,6 +38,7 @@ BDEPEND="virtual/pkgconfig PATCHES=( "${FILESDIR}/${PN}-5.6-Makefile-am-Dont-require-pandoc-for-tests.patch" + "${FILESDIR}/${PN}-5.7-tests-Eliminate-dependency-on-which.patch" ) python_check_deps() {
