From 7134f72530c7606c19fc02f9454eaf05e7d7b06a Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 11 Feb 2020 22:31:38 +0300 Subject: Add copyright variable substitution in doc/doc.sh --- doc/doc.sh | 16 +++++++++++++--- doc/odb-epilogue.1 | 2 +- doc/odb-epilogue.xhtml | 2 +- doc/odb-prologue.xhtml | 2 +- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/doc/doc.sh b/doc/doc.sh index a5517af..4e96aed 100755 --- a/doc/doc.sh +++ b/doc/doc.sh @@ -1,7 +1,6 @@ #! /usr/bin/env bash version=2.5.0-b.6 -date="$(date +"%B %Y")" trap 'exit 1' ERR set -o errtrace # Trap in functions. @@ -9,6 +8,9 @@ set -o errtrace # Trap in functions. function info () { echo "$*" 1>&2; } function error () { info "$*"; exit 1; } +date="$(date +"%B %Y")" +copyright="$(sed -n -re 's%^Copyright \(c\) (.+)\.$%\1%p' ../LICENSE)" + while [ $# -gt 0 ]; do case $1 in --clean) @@ -36,14 +38,22 @@ function compile () # done # --html-suffix .xhtml - cli -I .. -v project="odb" -v version="$version" -v date="$date" \ + cli -I .. \ +-v project="odb" \ +-v version="$version" \ +-v date="$date" \ +-v copyright="$copyright" \ "${ops[@]}" --generate-html --stdout \ --html-prologue-file odb-prologue.xhtml \ --html-epilogue-file odb-epilogue.xhtml \ "../odb/$i.cli" >"$o.xhtml" # --man-suffix .1 - cli -I .. -v project="odb" -v version="$version" -v date="$date" \ + cli -I .. \ +-v project="odb" \ +-v version="$version" \ +-v date="$date" \ +-v copyright="$copyright" \ "${ops[@]}" --generate-man --stdout \ --man-prologue-file odb-prologue.1 \ --man-epilogue-file odb-epilogue.1 \ diff --git a/doc/odb-epilogue.1 b/doc/odb-epilogue.1 index aa80feb..e331b23 100644 --- a/doc/odb-epilogue.1 +++ b/doc/odb-epilogue.1 @@ -144,7 +144,7 @@ Send bug reports to the odb-users@codesynthesis.com mailing list. .\" COPYRIGHT .\" .SH COPYRIGHT -Copyright (c) 2009-2019 Code Synthesis Tools CC. +Copyright (c) $copyright$. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, diff --git a/doc/odb-epilogue.xhtml b/doc/odb-epilogue.xhtml index fda5ec6..9eba558 100644 --- a/doc/odb-epilogue.xhtml +++ b/doc/odb-epilogue.xhtml @@ -111,7 +111,7 @@