Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1998308pxb; Mon, 20 Sep 2021 09:50:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXHxqgfwxN/QcDCeLrJ/Gc6MOzBf1bZqjBc7I+NK/BmshAO6s2rtg6eJuYP0FY+PQJDRhI X-Received: by 2002:a92:6b01:: with SMTP id g1mr17918102ilc.251.1632156601306; Mon, 20 Sep 2021 09:50:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632156601; cv=none; d=google.com; s=arc-20160816; b=adXhlDFw+cI8mVk70QD3U05RpyKE718tlPif2Zk9NFtYQ4qb6srXfLlcXt15lWrl2d sI6kczLnC5nZWFz+ehxmMXwuf8PQ+iN80QYMLaS0ZDqXj2sGo/FaMYWIqgHH6+EJ+YUm lYxhsjDT6aZ9jdAsj4pYVR77x+mK0+inx/qaY1I0CXapzTwE8QnOzsViV/KfJLioLR9H jwZN9zqVh9MRKWxBXFuqy5eWVc73fzC4DgtvB969aGeE306ug5zR8SgRgA1JYkksRjGc E+9bk+g9chnImTvtHiXSPJzkCa/Zn/F7M5STvb4SwCdl3ShDC85sW9sdQhy4sRgQgcdz TpnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature; bh=+t1tctzQR47NQ9v0ltgV78hzmtN6kDQ5K09vPk4yyeI=; b=WySLOhZcNVjHFJpCZLzczduBKkHsDjYrtnCR8CCSzF8Ubs4GvWL2naZTZfo9iMhIqY dgeAJrCjCs82v1AwX9OfghqKk82eLGwJZ+MmLybXQe5so62Yo80OuwBskG8il/ATvxK2 tEhZy945gH5lA44bc8JlzbrR7/e1mGfY3JctvLNUMACu4YV2Yp+BbwhgB1NW15opOUMY bZTKvZayjFI/uPKKu0EhMlzPWhT9F0YgCejmSZa05oZRHWd1zlt1qXYdytiFzsebJoJw pSa6yvmsPo82JN6YkwF3Z2AsCu7RUcvSllz96OwvMEye4hwFznLqmxklFSIWIjCQumud MHPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=Kf0Wf+Ha; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e15si811931ils.161.2021.09.20.09.49.29; Mon, 20 Sep 2021 09:50:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=Kf0Wf+Ha; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235143AbhITP0q (ORCPT + 99 others); Mon, 20 Sep 2021 11:26:46 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:44582 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232422AbhITP0q (ORCPT ); Mon, 20 Sep 2021 11:26:46 -0400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 0D15122015; Mon, 20 Sep 2021 15:25:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1632151519; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=+t1tctzQR47NQ9v0ltgV78hzmtN6kDQ5K09vPk4yyeI=; b=Kf0Wf+HaTkkVpmaSoXHu2gpMLIyQaQkvv9hoczKU1Hl9o/YKZq2cyk2VNnc9qP66udkUys YAG7+QLT7tVF8xJXhlAHLt0pR3rGK+OL6xfGTb/8+v2TVOgh2Cso5Poaq0CGrLOsdPuXkX BxXe90KHNxfq2vzHp63ONPl7bzw1pgE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1632151519; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=+t1tctzQR47NQ9v0ltgV78hzmtN6kDQ5K09vPk4yyeI=; b=dhbOQTXbhgqrjCkuhz64OYwJR3JXTOShE/+/X7PMEkT+00F7boHXhFfdIYQUOJaRMSkxHL PBjT7SYybqdnRQCg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id C705913AED; Mon, 20 Sep 2021 15:25:18 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 6rPlLd6nSGGrIgAAMHmgww (envelope-from ); Mon, 20 Sep 2021 15:25:18 +0000 From: Petr Vorel To: linux-nfs@vger.kernel.org Cc: Petr Vorel , Steve Dickson , Jianhong Yin Subject: [PATCH 1/1] install-dep: Use command -v instead of which Date: Mon, 20 Sep 2021 17:25:05 +0200 Message-Id: <20210920152505.9423-1-pvorel@suse.cz> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org `command -v' is shell builtin required by POSIX [1] and supported on all common shells (bash, zsh, dash, busybox sh, mksh). `which' utility is not presented on some containers (e.g. Fedora, openSUSE), also going to be removed from future Debian versions. Also remove stderr redirection to /dev/null as it's unnecessary when using 'command': POSIX says "no output shall be written" if the command isn't found. [1] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/command.html [2] https://salsa.debian.org/debian/debianutils/-/commit/3a8dd10b4502f7bae8fc6973c13ce23fc9da7efb Signed-off-by: Petr Vorel --- install-dep | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install-dep b/install-dep index 621618fe..4698d44a 100755 --- a/install-dep +++ b/install-dep @@ -2,20 +2,20 @@ #install dependencies for compiling from source code #RHEL/Fedora/CentOS-Stream/Rocky -which dnf &>/dev/null || which yum &>/dev/null && { +command -v dnf >/dev/null || command -v yum >/dev/null && { yum install -y automake libtool make gcc rpcgen libtirpc-devel libevent-devel sqlite-devel device-mapper-devel \ libblkid-devel krb5-devel libuuid-devel } #Debian/ubuntu -which apt &>/dev/null && { +command -v apt >/dev/null && { apt install -o APT::Install-Suggests=0 -o APT::Install-Recommends=0 --ignore-missing -y \ autotools-dev automake make libtool pkg-config libtirpc-dev libevent-dev libsqlite3-dev \ libdevmapper-dev libblkid-dev libkrb5-dev libkeyutils-dev uuid-dev } #openSUSE Leap -which zypper &>/dev/null && { +command -v zypper >/dev/null && { zypper in --no-recommends -y automake libtool make gcc rpcgen libtirpc-devel libevent-devel sqlite-devel \ device-mapper-devel libblkid-devel krb5-devel libuuid-devel } -- 2.33.0