From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1593302-garchives=archives.gentoo.org@lists.gentoo.org>
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 DBDA415838C
	for <garchives@archives.gentoo.org>; Mon, 22 Jan 2024 11:29:41 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 41B102BC013;
	Mon, 22 Jan 2024 11:29:39 +0000 (UTC)
Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(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 298E52BC013
	for <gentoo-commits@lists.gentoo.org>; Mon, 22 Jan 2024 11:29:39 +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 22267343297
	for <gentoo-commits@lists.gentoo.org>; Mon, 22 Jan 2024 11:29:38 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 8AA2214CB
	for <gentoo-commits@lists.gentoo.org>; Mon, 22 Jan 2024 11:29:35 +0000 (UTC)
From: "Michael Orlitzky" <mjo@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Michael Orlitzky" <mjo@gentoo.org>
Message-ID: <1705922962.f2a9af36a8fa484a62b116d322a4c483a05407e6.mjo@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
X-VCS-Repository: repo/gentoo
X-VCS-Files: eclass/gap-pkg.eclass
X-VCS-Directories: eclass/
X-VCS-Committer: mjo
X-VCS-Committer-Name: Michael Orlitzky
X-VCS-Revision: f2a9af36a8fa484a62b116d322a4c483a05407e6
X-VCS-Branch: master
Date: Mon, 22 Jan 2024 11:29:35 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 670693cd-fb2d-4621-ba5e-00f717d9f493
X-Archives-Hash: 6692e5b1f9d9f7eb64461ac4780ada40

commit:     f2a9af36a8fa484a62b116d322a4c483a05407e6
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 14 19:14:25 2024 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Mon Jan 22 11:29:22 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f2a9af36

gap-pkg.eclass: use nullglob instead of working around it

Suggested-by: Michał Górny <mgorny <AT> gentoo.org>
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>

 eclass/gap-pkg.eclass | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/eclass/gap-pkg.eclass b/eclass/gap-pkg.eclass
index ecb73a9e27d7..6f50444bfa12 100644
--- a/eclass/gap-pkg.eclass
+++ b/eclass/gap-pkg.eclass
@@ -46,6 +46,9 @@ case ${EAPI} in
 	*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
+# For eshopts_push and eshopts_pop
+inherit estack
+
 # Some packages have additional homepages, but pretty much every GAP
 # package can be found at this URL.
 HOMEPAGE="https://www.gap-system.org/Packages/${PN}.html"
@@ -292,6 +295,9 @@ gap-pkg_src_test() {
 gap-pkg_src_install() {
 	einstalldocs
 
+	# So we don't have to "test -f" on the result of every glob.
+	eshopts_push -s nullglob
+
 	# Install the "normal" documentation from the doc directory. This
 	# includes anything the interactive GAP help might need in addition
 	# to the documentation intended for direct user consumption.
@@ -310,8 +316,7 @@ gap-pkg_src_install() {
 		# the bibliography is in BibXMLext format, but you may wind up
 		# with some additional GAPDoc (XML) source files as a result.
 		for f in *.{bib,lab,six,tex,txt,xml}; do
-			# The -f test avoids needing nullglob when no files match.
-			[[ -f "${f}" ]] && doins "${f}"
+			doins "${f}"
 		done
 
 		# The PDF docs are also potentially used by the interface, since
@@ -319,10 +324,8 @@ gap-pkg_src_install() {
 		# then afterwards we symlink them to their proper Gentoo
 		# locations
 		for f in *.pdf; do
-			if [[ -f "${f}" ]]; then
-				doins "${f}"
-				dosym -r "${docdir}/${f}" "/usr/share/doc/${PF}/${f}"
-			fi
+			doins "${f}"
+			dosym -r "${docdir}/${f}" "/usr/share/doc/${PF}/${f}"
 		done
 
 		popd > /dev/null || die
@@ -340,10 +343,8 @@ gap-pkg_src_install() {
 
 		# See above
 		for f in *.{htm,html,css,js,png}; do
-			if [[ -f "${f}" ]]; then
-				doins "${f}"
-				dosym -r "${docdir}/${f}" "/usr/share/doc/${PF}/html/${f}"
-			fi
+			doins "${f}"
+			dosym -r "${docdir}/${f}" "/usr/share/doc/${PF}/html/${f}"
 		done
 
 		popd > /dev/null || die
@@ -352,9 +353,12 @@ gap-pkg_src_install() {
 	# Any GAP source files that live in the top-level directory.
 	insinto $(gap-pkg_dir)
 	for f in *.g; do
-		[[ -f "${f}" ]] && doins "${f}"
+		doins "${f}"
 	done
 
+	# We're done globbing
+	eshopts_pop
+
 	# The gap and lib dirs that usually also contain GAP code.
 	[[ -d gap ]] && doins -r gap
 	[[ -d lib ]] && doins -r lib