From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id qH3EJGpEOV9fHwAA0tVLHw (envelope-from ) for ; Sun, 16 Aug 2020 14:36:26 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id swZ2IGpEOV9wGAAAbx9fmQ (envelope-from ) for ; Sun, 16 Aug 2020 14:36:26 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2F2609408DB for ; Sun, 16 Aug 2020 14:36:25 +0000 (UTC) Received: from [144.217.243.247] (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 8522228871; Sun, 16 Aug 2020 10:36:17 -0400 (EDT) Received: from fethera.tethera.net (fethera.tethera.net [IPv6:2607:5300:60:c5::1]) by mail.notmuchmail.org (Postfix) with ESMTP id 1D2191F9DC for ; Sun, 16 Aug 2020 10:36:15 -0400 (EDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id DDBCA5FDE2; Sun, 16 Aug 2020 10:36:14 -0400 (EDT) Received: (nullmailer pid 120789 invoked by uid 1000); Sun, 16 Aug 2020 14:36:13 -0000 From: David Bremner To: notmuch@notmuchmail.org Cc: David Bremner Subject: [PATCH] devel/release-checks.sh: use grep to find copyright year. Date: Sun, 16 Aug 2020 11:36:10 -0300 Message-Id: <20200816143610.120729-1-david@tethera.net> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Message-ID-Hash: 7SQQ3TDOFAJZINGOXYCMATMIGAAX3HWM X-Message-ID-Hash: 7SQQ3TDOFAJZINGOXYCMATMIGAAX3HWM X-MailFrom: bremner@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Spam-Score: 1.53 X-TUID: g6dWn8cGjQpc This is quite fragile, but it works for now, unlike the python version. In general it seems conf.py is not intended to be evaluated outside of sphinx, as it assumes certain global names (in particular "tags") are defined. --- I am going to apply this to unblock the release process, but I welcome better solutions. devel/release-checks.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/devel/release-checks.sh b/devel/release-checks.sh index 7ba94822..cfa208d5 100755 --- a/devel/release-checks.sh +++ b/devel/release-checks.sh @@ -178,10 +178,7 @@ esac year=`exec date +%Y` echo -n "Checking that copyright in documentation contains 2009-$year... " # Read the value of variable `copyright' defined in 'doc/conf.py'. -# As __file__ is not defined when python command is given from command line, -# it is defined before contents of 'doc/conf.py' (which dereferences __file__) -# is executed. -copyrightline=`exec python -c "with open('doc/conf.py') as cf: __file__ = ''; exec(cf.read()); print(copyright)"` +copyrightline=$(grep ^copyright doc/conf.py) case $copyrightline in *2009-$year*) echo Yes. ;; -- 2.28.0