summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Byrne <salah.coronya@gmail.com>2024-10-01 18:05:09 -0500
committerSam James <sam@gentoo.org>2024-10-02 02:21:58 +0100
commitb86b4f7d1520d21fbf77f71ded8eb01988419094 (patch)
treeb4f6072a9a56685402ed09a3ceb12dd9aad15a82 /app-crypt
parentmedia-sound/spotify: don't install changelog file that does not exist (diff)
downloadgentoo-b86b4f7d1520d21fbf77f71ded8eb01988419094.tar.gz
gentoo-b86b4f7d1520d21fbf77f71ded8eb01988419094.tar.bz2
gentoo-b86b4f7d1520d21fbf77f71ded8eb01988419094.zip
app-crypt/tpm2-tools: Remove requirement for 'which' in tests
Closes: https://bugs.gentoo.org/930088 Signed-off-by: Christopher Byrne <salah.coronya@gmail.com> Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'app-crypt')
-rw-r--r--app-crypt/tpm2-tools/files/tpm2-tools-5.7-tests-Eliminate-dependency-on-which.patch42
-rw-r--r--app-crypt/tpm2-tools/tpm2-tools-5.7.ebuild1
2 files changed, 43 insertions, 0 deletions
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 <salah.coronya@gmail.com>
+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 <salah.coronya@gmail.com>
+---
+ 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() {