Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1998522pxb; Mon, 20 Sep 2021 09:50:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0xCkeKsI0ykZCV6LC8YHlqHXFFhSMAt0G5meqgJpczfQq9p3HfiJqAl5Y8592d7+2Hu0+ X-Received: by 2002:a6b:c308:: with SMTP id t8mr19340104iof.2.1632156617908; Mon, 20 Sep 2021 09:50:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632156617; cv=none; d=google.com; s=arc-20160816; b=tWIBvy6eEybYufh8X+49PWsiGAFhcsrEPW4NVYK/oM0KA41VuzILmP0yjW63zTAY14 L4CgNxtM1NMtGifZTq605kG1BI37U5nzaYTnKqYaxNG2nHzTEI9WxS0z1MUJdgH8ou6Q 7rtT58+i/e0PR9oKU/mBylDzM0NOCS2yWGmOZknB9CXslZKyJAuAaJ0tsvqz6LJ/tFm8 WGdVH7PZMfKGn2RPRtkbWcGG2yKoSsyjbeDwKL2xVhyfQwkFbQfnOlIuyaDeGLomVlza XWemlMqD0Xy5UgilUzvE9a2lCcd9tGLr/KU0u6YouWEgRA0/Bilo5Qvw147dQ+HOfNCe exhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=q7Tr7ixug/f6CAucX4e9I4JZW6IgA6gAGqbB6ARKCg8=; b=y38Laqbva3pIduD8zOiUcsEaSWSqM/iWpkapDbaGlEp3emu6cKT3x/GlbRIhII0qjO DLWSfeGyjZV34gpE9gt2t5KZfEi0el8H0xWzuyNrl9sqlLAgjIynbL9qXXHJ2Ok1TSdy l6z+5KOMAuqVddKFMyaBhfgLcGhjRB0sVcb87iNtjt3AXDZUcSdQd0Ko78ikQKahyuph 4q8hJG5N0Aj1t/waPsSGxyxVP8Mp/wOFjyOvTQoM8Il96xeC/i+rWmY2+en7OmJHY/w5 dHF/MZXWpGlSSeA0Cttp4NVXwGf1RCktocYT5cut3gasFrV67v0D+u9eLyR9rUgmCueJ 2Hbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=Z8qUJtAN; 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 d7si13551971ila.10.2021.09.20.09.49.57; Mon, 20 Sep 2021 09:50:17 -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=Z8qUJtAN; 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 S236807AbhITPb3 (ORCPT + 99 others); Mon, 20 Sep 2021 11:31:29 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:46158 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234117AbhITPb3 (ORCPT ); Mon, 20 Sep 2021 11:31:29 -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 684B72201E; Mon, 20 Sep 2021 15:30:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1632151801; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=q7Tr7ixug/f6CAucX4e9I4JZW6IgA6gAGqbB6ARKCg8=; b=Z8qUJtANdD0vqAB++YoQ86IDw77Cz/xWRihBZsUrEhRsRHbRW9+EL12ZkoetS4VdRvtxql CC/cT///uOQDs/6RrXx3BceUB4/tfH+wcK5HtvGdwU/Ugjn6toM8dZMFMC0C8h5XOxO2Fg sRn1cdr9xWe+J2vn+VWZuuRG9HM1lcs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1632151801; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=q7Tr7ixug/f6CAucX4e9I4JZW6IgA6gAGqbB6ARKCg8=; b=IXgqXssa57t0fm4kdtNCctV3Jt7VwcD02r7pqTtWf+TjZuN6ih/eYXlyw6JSMOpg275TnR xAqHbS14MivIn3BA== 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 3C00013AED; Mon, 20 Sep 2021 15:30:01 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Y3K7DPmoSGEYJQAAMHmgww (envelope-from ); Mon, 20 Sep 2021 15:30:01 +0000 Date: Mon, 20 Sep 2021 17:29:59 +0200 From: Petr Vorel To: linux-nfs@vger.kernel.org Cc: Steve Dickson , Jianhong Yin Subject: Re: [PATCH 1/1] install-dep: Use command -v instead of which Message-ID: Reply-To: Petr Vorel References: <20210920152505.9423-1-pvorel@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210920152505.9423-1-pvorel@suse.cz> 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. nit: [2] missing at the end of this paragraph. Kind regards, Petr > [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 > }