From patchwork Sun Oct 2 01:44:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allan McRae X-Patchwork-Id: 2084 Return-Path: Delivered-To: patchwork@archlinux.org Received: from mail.archlinux.org [2a01:4f9:c010:3052::1] by patchwork.archlinux.org with IMAP (fetchmail-6.4.33) for (single-drop); Sun, 02 Oct 2022 01:44:58 +0000 (UTC) Received: from mail.archlinux.org by mail.archlinux.org with LMTP id +KHhLhntOGOf5woAK+/4rw (envelope-from ) for ; Sun, 02 Oct 2022 01:44:57 +0000 Received: from lists.archlinux.org (lists.archlinux.org [95.217.236.249]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.archlinux.org (Postfix) with ESMTPS id 498CB151274F; Sun, 2 Oct 2022 01:44:56 +0000 (UTC) Received: from lists.archlinux.org (localhost [127.0.0.1]) by lists.archlinux.org (Postfix) with ESMTP id 1CE8A501EE0; Sun, 2 Oct 2022 01:44:54 +0000 (UTC) Received: from mail.archlinux.org (mail.archlinux.org [95.216.189.61]) by lists.archlinux.org (Postfix) with ESMTPS id 11CF3501ED7 for ; Sun, 2 Oct 2022 01:44:51 +0000 (UTC) From: Allan McRae DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=archlinux.org; s=dkim-rsa; t=1664675090; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=RMIIZiENck695+O0IqFHc8HsCsQhB1AaF/tfYeQsgQU=; b=nKhNGixHM2zkpe6U3CI4sdcgKY1V3a1tRzM9eYk7WDJNgscJ0eu4KUK+Oom0WIxtorY4+8 mx4tX+0opIW+lWe5/YHLduA+aj0plk34ava7QRBPJSo4hl2hYfUzOtK8riAZ/yo8M55yYI Jyg5C0iC248MMv1MgJyURZSPmO+48BWHyalL6XkXKTIPQFamxEw1T71GDf7mbfsFoyCwYs oWDkUFMUyDohjRud8r/xI8JKncT/h6YE37i/pHS+faBbnAcCB7y5bVlN8x7QR0lIJKD3Us D3DYlPpXh38CGJ1MGLiHYxPG3EBqpFwriBzERNT9SD9OR7iOWu7JNWwPKYusBt5HN3kVSb waRHYN4cTHe+6znGUmQ0OERUYtmxxPSEHX7Rd0BNnovG/61wEbyjse0RY5nJmUeGYIhQBe I/llwf7ZCCdifTXjwv+L025LVnsfKc4GvxYMZZ5Ur4YQ5OdJdU0kyhf2SR2B8M9Jw1vgxN SOEosIUoe7BDkBv4tbXjCZwCU57TCBMleWhnrSQ2Ee8f87nVoC5yXSOg2kervOA7UF8v8s ojO5O32mw2/sx4j24v0QHKC3NJgQ6sRZOoqM38JQO+fE7EH7Of13KXxtHJ8Y06oYt7Hieg hxdDXJIT3FkA9sHYv5RhvGuWLTYdffGNNVDjhcWBMcOZn6ap8JBXg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=archlinux.org; s=dkim-ed25519; t=1664675090; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=RMIIZiENck695+O0IqFHc8HsCsQhB1AaF/tfYeQsgQU=; b=0S4Bp7+BBqxpuDjsTlW4PywMmHILQ2V1DAwIwqgKjfWC9kEDBWZ3uHDH2/tM8BW5mjlFhX V5LlukT8Awt2IhAg== To: pacman-dev@lists.archlinux.org Subject: [PATCH] libmakepkg: fix compatibility with bash-5.2 globskipdots Date: Sun, 2 Oct 2022 11:44:39 +1000 Message-Id: <20221002014439.1072365-1-allan@archlinux.org> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Message-ID-Hash: EKX6YRRT7QFOELXZGVHCB4FKKMNNSKKM X-Message-ID-Hash: EKX6YRRT7QFOELXZGVHCB4FKKMNNSKKM X-MailFrom: allan@archlinux.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.5 Precedence: list List-Id: Discussion list for pacman development Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Authentication-Results: mail.archlinux.org; dkim=pass header.d=archlinux.org header.s=dkim-rsa header.b=nKhNGixH; dkim=pass header.d=archlinux.org header.s=dkim-ed25519 header.b=0S4Bp7+B; dmarc=pass (policy=none) header.from=archlinux.org; spf=pass (mail.archlinux.org: domain of pacman-dev-bounces@lists.archlinux.org designates 95.217.236.249 as permitted sender) smtp.mailfrom=pacman-dev-bounces@lists.archlinux.org X-Rspamd-Queue-Id: 498CB151274F X-Spamd-Result: default: False [-1.51 / 15.00]; DWL_DNSWL_LOW(-1.00)[archlinux.org:dkim]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; DMARC_POLICY_ALLOW(-0.50)[archlinux.org,none]; MAILLIST(-0.20)[mailman]; R_DKIM_ALLOW(-0.20)[archlinux.org:s=dkim-rsa,archlinux.org:s=dkim-ed25519]; RCVD_IN_DNSWL_MED(-0.20)[95.217.236.249:from]; R_SPF_ALLOW(-0.20)[+ip4:95.217.236.249]; RCVD_IN_DNSWL_LOW(-0.10)[95.216.189.61:received]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; PREVIOUSLY_DELIVERED(0.00)[pacman-dev@lists.archlinux.org]; ARC_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:24940, ipnet:95.217.0.0/16, country:DE]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_NONE(0.00)[]; FROM_NEQ_ENVFROM(0.00)[allan@archlinux.org,pacman-dev-bounces@lists.archlinux.org]; DKIM_TRACE(0.00)[archlinux.org:+]; MIME_TRACE(0.00)[0:+]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; NEURAL_HAM(-0.00)[-1.000]; FORGED_SENDER_MAILLIST(0.00)[] X-Rspamd-Server: mail.archlinux.org Bash 5.2 has a new globskipdots option, which is enabled by default. The check_dotfiles lint fails with globskipdots due to the assumption that at least the "." and ".." paths will match. Disabling globskipdots would be the usual solution, but that fails on bash<5.2. Instead, enable nullglob for this check. Signed-off-by: Allan McRae --- scripts/libmakepkg/lint_package/dotfiles.sh.in | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/libmakepkg/lint_package/dotfiles.sh.in b/scripts/libmakepkg/lint_package/dotfiles.sh.in index 243fb31c..0b993dd4 100644 --- a/scripts/libmakepkg/lint_package/dotfiles.sh.in +++ b/scripts/libmakepkg/lint_package/dotfiles.sh.in @@ -29,10 +29,17 @@ lint_package_functions+=('check_dotfiles') check_dotfiles() { local ret=0 + + local shellopts=$(shopt -p nullglob) + shopt -s nullglob + for f in "$pkgdir"/.*; do [[ ${f##*/} == . || ${f##*/} == .. ]] && continue error "$(gettext "Dotfile found in package root '%s'")" "$f" ret=1 done + + eval "$shellopts" + return $ret }