Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 18AFD6DE0B20 for ; Sun, 1 Nov 2015 05:42:09 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.146 X-Spam-Level: X-Spam-Status: No, score=0.146 tagged_above=-999 required=5 tests=[AWL=0.686, RP_MATCHES_RCVD=-0.55, T_HEADER_FROM_DIFFERENT_DOMAINS=0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id u36DlCNSK1IP for ; Sun, 1 Nov 2015 05:42:05 -0800 (PST) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by arlo.cworth.org (Postfix) with ESMTP id 841846DE0A94 for ; Sun, 1 Nov 2015 05:42:05 -0800 (PST) Received: by guru.guru-group.fi (Postfix, from userid 501) id 217A31000B3; Sun, 1 Nov 2015 15:41:58 +0200 (EET) From: Tomi Ollila To: notmuch@notmuchmail.org Cc: tomi.ollila@iki.fi Subject: [PATCH v3] devel/release-checks: added checking of copyright year in documentation Date: Sun, 1 Nov 2015 15:41:55 +0200 Message-Id: <1446385315-20217-1-git-send-email-tomi.ollila@iki.fi> X-Mailer: git-send-email 2.0.0 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Nov 2015 13:42:09 -0000 Check that copyright year will be current year in generated documentation. Checking is done my matching that copyright line contains current year as a substring which is good enough "approximation" in this context. --- v3 of id:1440616236-17866-1-git-send-email-tomi.ollila@iki.fi changed $year to 2009-$year v2 of id:1438511187-11321-1-git-send-email-tomi.ollila@iki.fi, perhaps addressing comments in id:87r3niwan6.fsf@maritornes.cs.unb.ca devel/release-checks.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/devel/release-checks.sh b/devel/release-checks.sh index 8604a9f7d10b..5802942aa975 100755 --- a/devel/release-checks.sh +++ b/devel/release-checks.sh @@ -175,6 +175,21 @@ case $news_date in append_emsg "Date '$news_date' in NEWS file is not in format (yyyy-mm-dd)" 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)"` +case $copyrightline in + *2009-$year*) + echo Yes. ;; + *) + echo No. + append_emsg "The copyright in doc/conf.py line '$copyrightline' does not contain '2009-$year'" +esac + if [ -n "$emsgs" ] then echo -- 2.0.0