From 8b279f94d5a1e725cfc11157ea7522b7ac3615f4 Mon Sep 17 00:00:00 2001 From: Tomi Ollila Date: Wed, 18 Feb 2015 16:54:01 +0200 Subject: [PATCH] [PATCH] configure: consistent command -v usage --- a4/b9245b96a26d17d70a8a2066e82b1e8a36fa93 | 93 +++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 a4/b9245b96a26d17d70a8a2066e82b1e8a36fa93 diff --git a/a4/b9245b96a26d17d70a8a2066e82b1e8a36fa93 b/a4/b9245b96a26d17d70a8a2066e82b1e8a36fa93 new file mode 100644 index 000000000..6b5f62592 --- /dev/null +++ b/a4/b9245b96a26d17d70a8a2066e82b1e8a36fa93 @@ -0,0 +1,93 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id C0428429E35 + for ; Wed, 18 Feb 2015 07:06:57 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 2.438 +X-Spam-Level: ** +X-Spam-Status: No, score=2.438 tagged_above=-999 required=5 + tests=[DNS_FROM_AHBL_RHSBL=2.438] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 1tYZbIaWkffW for ; + Wed, 18 Feb 2015 07:06:52 -0800 (PST) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by olra.theworths.org (Postfix) with ESMTP id F000C429E32 + for ; Wed, 18 Feb 2015 07:06:51 -0800 (PST) +Received: by guru.guru-group.fi (Postfix, from userid 501) + id 78CD910009D; Wed, 18 Feb 2015 16:54:05 +0200 (EET) +From: Tomi Ollila +To: notmuch@notmuchmail.org +Subject: [PATCH] configure: consistent command -v usage +Date: Wed, 18 Feb 2015 16:54:01 +0200 +Message-Id: <1424271241-11885-1-git-send-email-tomi.ollila@iki.fi> +X-Mailer: git-send-email 2.0.0 +Cc: tomi.ollila@iki.fi +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Wed, 18 Feb 2015 15:06:58 -0000 + +When the shell builtin `command -v` operates normally, it either +prints the path of the arg given to it and returns zero -- or it +returns nonzero and prints nothing. +In abnormal situations something might be printed to stderr and +in that case we want to know about it; therefore the used +command -v stderr redirections to /dev/null have been removed. + +The `hash` (builtin) command in ksh returns zero even the arg +given to is is not found in path. For that and for consistency +the one appearance of it has been converted to `command -v`. +--- + +marked trivial + + configure | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/configure b/configure +index a6b49ae..4af7ba9 100755 +--- a/configure ++++ b/configure +@@ -378,7 +378,7 @@ printf "Checking for python... " + have_python=0 + + for name in python python2 python3; do +- if command -v $name > /dev/null 2>&1; then ++ if command -v $name > /dev/null; then + have_python=1 + python=$name + printf "Yes ($name).\n" +@@ -435,7 +435,7 @@ else + fi + + printf "Checking if doxygen is available... " +-if command -v doxygen > /dev/null 2>&1; then ++if command -v doxygen > /dev/null; then + printf "Yes.\n" + have_doxygen=1 + else +@@ -444,7 +444,7 @@ else + fi + + printf "Checking if sphinx is available and supports nroff output... " +-if hash sphinx-build > /dev/null 2>&1 && ${python} -m sphinx.writers.manpage > /dev/null 2>&1 ; then ++if command -v sphinx-build > /dev/null && ${python} -m sphinx.writers.manpage > /dev/null 2>&1 ; then + printf "Yes.\n" + have_sphinx=1 + else +-- +1.9.1 + -- 2.26.2