File: 2021-12-01.replace-usage-of-which.patch

package info (click to toggle)
jose 11-2%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,896 kB
  • sloc: ansic: 9,976; javascript: 987; sh: 579; makefile: 9
file content (25 lines) | stat: -rw-r--r-- 694 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Subject: Replace usage of which(1)
Author: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
Date: 2021-12-01
Forwarded: https://github.com/latchset/jose/issues/108

--- a/tests/jose-jwe-enc
+++ b/tests/jose-jwe-enc
@@ -15,7 +15,7 @@
 jwe=$tmpdir/jwe
 
 jqopt() {
-    if ! which jq >/dev/null 2>&1; then
+    if ! command -v jq >/dev/null 2>&1; then
         echo "$3"
     else
         jq -r "if $2 | type | . = \"string\" then $2 else error(\"\") end" < $1
@@ -23,7 +23,7 @@
 }
 
 jqbopt() {
-    if ! which jq >/dev/null 2>&1; then
+    if ! command -v jq >/dev/null 2>&1; then
         echo "$4"
     else
         jq -r "if $2 | type | . = \"string\" then $2 else error(\"\") end" < $1 \