Skip to contentSkip to conversation

configure: Replace which(1) with "has"

PATCH Applied Fam Zheng 4 participants 4 messages Dec 4, 2014 – Dec 10, 2014

lore
Share & tools
lore

Fam Zheng

author
#0 lore raw

PATCH 1/1 configure: Replace which(1) with "has"

Using "has" is more slick because which(1) is not always there.

---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configure +1 -1
index 47048f0..cae588c 100755
@@ -2727,7 +2727,7 @@ fi
 if test "$modules" = yes; then
     shacmd_probe="sha1sum sha1 shasum"
     for c in $shacmd_probe; do
-        if which $c >/dev/null 2>&1; then
+        if has $c; then
             shacmd="$c"
             break
         fi
Signature · 1 line
1.9.3
Reviewed-by on v1 1/1
#1 lore raw

Am 04.12.2014 um 07:18 schrieb Fam Zheng:

Quoted 12 lines

Using "has" is more slick because which(1) is not always there.

---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configure +0 -0
index 47048f0..cae588c 100755

configure fi · line 2733

Quoted 8 lines
configure +1 -1
@@ -2727,7 +2727,7 @@ fi
 if test "$modules" = yes; then
     shacmd_probe="sha1sum sha1 shasum"
     for c in $shacmd_probe; do
-        if which $c >/dev/null 2>&1; then
+        if has $c; then
             shacmd="$c"
             break
         fi
Reviewed-by on v1 1/1
#2 lore raw
In reply to Fam Zheng
Quoted 12 lines · Fam Zheng

Using "has" is more slick because which(1) is not always there.

---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configure +0 -0
index 47048f0..cae588c 100755

configure fi · line 2730

Quoted 5 lines
configure +1 -1
@@ -2727,7 +2727,7 @@ fi
 if test "$modules" = yes; then
     shacmd_probe="sha1sum sha1 shasum"
     for c in $shacmd_probe; do
-        if which $c >/dev/null 2>&1; then
+        if has $c; then

we use self defined has function to check command in all other place in configure. LGTM.

Quoted 6 lines
configure +0 -0
             shacmd="$c"
             break
         fi
Signature · 1 line
1.9.3
Signature · 1 line
			Amos.