From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id C290315817D for ; Fri, 21 Jun 2024 13:14:23 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 347F1E2AA9; Fri, 21 Jun 2024 13:14:20 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 18D3FE2A9F for ; Fri, 21 Jun 2024 13:14:20 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2A77C33BF41 for ; Fri, 21 Jun 2024 13:14:19 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 78C2F1D59 for ; Fri, 21 Jun 2024 13:14:15 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1718176002.f8b3029be34143dbd19737aa9bad2948bf0b88c7.sam@gentoo> Subject: [gentoo-commits] proj/gentoo-functions:master commit in: / X-VCS-Repository: proj/gentoo-functions X-VCS-Files: functions.sh X-VCS-Directories: / X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: f8b3029be34143dbd19737aa9bad2948bf0b88c7 X-VCS-Branch: master Date: Fri, 21 Jun 2024 13:14:15 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 301243f5-248d-42fd-b4e1-f7f77173d7f4 X-Archives-Hash: 5043de7f66f2ad5f133a91a6f83a944a commit: f8b3029be34143dbd19737aa9bad2948bf0b88c7 Author: Kerin Millar plushkava net> AuthorDate: Tue Jun 4 02:35:09 2024 +0000 Commit: Sam James gentoo org> CommitDate: Wed Jun 12 07:06:42 2024 +0000 URL: https://gitweb.gentoo.org/proj/gentoo-functions.git/commit/?id=f8b3029b Clean up the jq detection procedure in eqatag() Signed-off-by: Kerin Millar plushkava.net> functions.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/functions.sh b/functions.sh index 6b4c3fa..f5a59fc 100644 --- a/functions.sh +++ b/functions.sh @@ -194,14 +194,9 @@ eqatag() 0) return 1 ;; - 1) - ;; - *) - if command -v jq >/dev/null; then - genfun_has_jq=1 - else + '') + if ! hash jq 2>/dev/null; [ "$(( genfun_has_jq = $? ))" -eq 0 ]; then warn "eqatag: this function requires that jq be installed" - genfun_has_jq=0 return 1 fi esac