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.oll...@iki.fi, perhaps
addressing comments in id:87r3niwan6....@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

_______________________________________________
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch

Reply via email to