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 697416DE0B29 for ; Wed, 26 Aug 2015 12:12:11 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.259 X-Spam-Level: X-Spam-Status: No, score=0.259 tagged_above=-999 required=5 tests=[AWL=0.799, 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 PQVtxiVwKLl8 for ; Wed, 26 Aug 2015 12:12:08 -0700 (PDT) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by arlo.cworth.org (Postfix) with ESMTP id 925016DE0350 for ; Wed, 26 Aug 2015 12:12:08 -0700 (PDT) Received: by guru.guru-group.fi (Postfix, from userid 501) id C46101000E6; Wed, 26 Aug 2015 22:10:37 +0300 (EEST) From: Tomi Ollila To: notmuch@notmuchmail.org Subject: [PATCH v2] devel/release-checks: added checking of copyright year in documentation Date: Wed, 26 Aug 2015 22:10:36 +0300 Message-Id: <1440616236-17866-1-git-send-email-tomi.ollila@iki.fi> X-Mailer: git-send-email 2.0.0 Cc: tomi.ollila@iki.fi X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.18 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: Wed, 26 Aug 2015 19:12:11 -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. --- 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 $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 + *$year*) + echo Yes. ;; + *) + echo No. + append_emsg "The copyright in doc/conf.py line '$copyrightline' does not contain '$year'" +esac + if [ -n "$emsgs" ] then echo -- 2.0.0