aboutsummaryrefslogtreecommitdiff
path: root/devel/release-checks.sh
diff options
context:
space:
mode:
authorTomi Ollila <tomi.ollila@iki.fi>2015-11-01 15:41:55 +0200
committerDavid Bremner <david@tethera.net>2015-11-19 07:34:29 -0400
commit36ad2717049452db877f310549bea263301bfe95 (patch)
tree113f8f80afad7d1f3dadfe54eb0c9e79941983c0 /devel/release-checks.sh
parentedae844efaeda706568850003da116a805b352ee (diff)
devel/release-checks: added checking of copyright year in documentation
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.
Diffstat (limited to 'devel/release-checks.sh')
-rwxr-xr-xdevel/release-checks.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/devel/release-checks.sh b/devel/release-checks.sh
index 8604a9f7..5a7578b8 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