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 08RNNotSOV8LQwAA0tVLHw (envelope-from ) for ; Sun, 16 Aug 2020 15:36:43 +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 8INzMYtSOV+FQwAAbx9fmQ (envelope-from ) for ; Sun, 16 Aug 2020 15:36:43 +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 4ECE3940367 for ; Sun, 16 Aug 2020 15:36:42 +0000 (UTC) Received: from [144.217.243.247] (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 2EB0528871; Sun, 16 Aug 2020 11:36:35 -0400 (EDT) Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [185.185.170.37]) by mail.notmuchmail.org (Postfix) with ESMTPS id E6DD41FA17 for ; Sun, 16 Aug 2020 11:36:32 -0400 (EDT) Received: from guru.guru-group.fi (unknown [IPv6:2a02:2380:1:9:5054:ff:feb7:a4bc]) (using TLSv1.2 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: too) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 316851B0029D; Sun, 16 Aug 2020 18:36:29 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1597592189; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=mFCL/fo5Mr3FYPiGuWHfFwtYdNEhivCs32vpRzAJ0DM=; b=EUhXowOVWsjd0R5wConoS3m4tIK7GgETjA0RjLhBohOlydbt3iZPBAOQPM53QNEwFg6Q4u tSzawizdnO7ffO5Wtyn+ATp0PLJ9YyJcqg/C1Q36ra8xCaMJCOzcX/+S78qzltth85TVh3 ASEGL9IgPUbQKEkQf0KfjDTx5WiED6ZtsLwwgLA7yGKPgrUKDX8qr+h+RDifffERgnlNpe LzYSZdah9tz2GrklACdNUhp3oLHFOQWZzY4vK9Oyei/7fa52c53hCgDctN20jf3ATpinj+ 1ywnpgq+W8M8k/3A0dzlQLUjYIiocnQYn2lIBOzK+WAAHov1Tq4Cu19D42UeOA== From: Tomi Ollila To: David Bremner , notmuch@notmuchmail.org Subject: Re: [PATCH] devel/release-checks.sh: use grep to find copyright year. In-Reply-To: <20200816143610.120729-1-david@tethera.net> References: <20200816143610.120729-1-david@tethera.net> User-Agent: Notmuch/0.30+160~gd1c5cc6 (https://notmuchmail.org) Emacs/27.1 (x86_64-pc-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1597592189; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=mFCL/fo5Mr3FYPiGuWHfFwtYdNEhivCs32vpRzAJ0DM=; b=nYarqcaTQzgaX4O5/7WyPqsgY545HPubR1W5AIh1orPf8x8/8fHxwMjcYEzn+tZUchjIF7 HphyWvvJCTU08rYnFRWS1rBsIbvLmsjIZZQFu32uEqRgkLMNRKcb1uredTEvW9UIHO/zuc 8Oo70qzW1GIz9Whe0Eqw3AcINICen8TbIg1on8r8eAGWmDmH6pk20Sexf9StjNwlInC/4D nhgpV3FT+0tc0RxqXQFLK45qvLIqp6LiwcddcYmq6SvlrFKhX32cPOjHJ0NTlMKKmTHUSN neabDqsAVlGbneiAQGtl6TLnewru2I+K8HK3oUtb81HM14ocrikIEKyu1/UngA== ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1597592189; a=rsa-sha256; cv=none; b=XrjZMJnlYAyUN/rNKfRNiOxI332+gxl4aEypKp1XG6G4V1F9IH7LdfYYvkng76msBBMG2X PtYFN0Hy9szkN4CntZ8+F1KSQNkEVNVScsYBrWjg37rlQF3BYkzZOenxi2w0TigkbcnJ7L hzhQzZbSM6dZx5OMOMluPK8uQ2bzqACHTceUSuGxhBhLrUr76yZGjjUgEjS7Yje6Fmw/pd nVoL/mPhaSJp1q8IxGBZMMOAvWlrdknCj06P91TiJ8ZHNPDYBMCdygzxs4Hza4egzP0OGe Lk1Slz8SdIbt9fAVKYjR6TMq6eC84SzEQoGNLmPFVR/anYDgPh5aIUuMK4QYxA== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=too smtp.mailfrom=tomi.ollila@iki.fi Message-ID-Hash: VB7TV263K7N2T6BHEVLLEOKWHBTI3TVM X-Message-ID-Hash: VB7TV263K7N2T6BHEVLLEOKWHBTI3TVM X-MailFrom: tomi.ollila@iki.fi 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=fail (body hash did not verify) header.d=iki.fi header.s=lahtoruutu header.b=EUhXowOV; 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: 3.53 X-TUID: Iuvrpks5HTGs On Sun, Aug 16 2020, David Bremner wrote: > 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. for this case solution is good enough... > > 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) For consistency and to save one fork(2) $(exec grep ...), but I could live with this, too ;D So LGTM. Tomi (2) bash forks for subshell and then for grep, even in this trivial case. Other shells fork only once. > case $copyrightline in > *2009-$year*) > echo Yes. ;; > -- > 2.28.0 > _______________________________________________ > notmuch mailing list -- notmuch@notmuchmail.org > To unsubscribe send an email to notmuch-leave@notmuchmail.org