From af8af7ebae9718c35b8661bfdef3b4e2af56144d Mon Sep 17 00:00:00 2001
From: Mark Wooding <mdw@distorted.org.uk>
Date: Sun, 6 Sep 2020 15:36:35 +0100
Subject: [PATCH] Fix dates and version numbers in the package files.

And add a program to do this semiautomatically.
---
 at.dtx         |  2 +-
 centre.dtx     |  2 +-
 cmtt.dtx       |  2 +-
 colour.dtx     |  2 +-
 crypto.dtx     |  2 +-
 doafter.dtx    |  2 +-
 exercise.dtx   |  2 +-
 footnote.dtx   |  2 +-
 mdwkey.dtx     |  2 +-
 mdwlist.dtx    |  2 +-
 mdwmath.dtx    |  4 ++--
 mdwref.dtx     |  2 +-
 mdwtab.dtx     |  8 ++++----
 mdwthm.dtx     |  4 ++--
 mdwtools.tex   |  2 +-
 poetry.dtx     |  2 +-
 slowbox.dtx    |  2 +-
 sverb.dtx      |  8 ++++----
 syntax.dtx     |  2 +-
 update-version | 17 +++++++++++++++++
 20 files changed, 44 insertions(+), 27 deletions(-)
 create mode 100755 update-version

diff --git a/at.dtx b/at.dtx
index 18a2dd4..90318d6 100644
--- a/at.dtx
+++ b/at.dtx
@@ -22,7 +22,7 @@
 % \begin{meta-comment} <Package preamble>
 %<+package>\NeedsTeXFormat{LaTeX2e}
 %<+package>\ProvidesPackage{at}
-%<+package>                [1996/05/02 1.3 @-command support]
+%<+package>                [2020/09/06 1.14.0 @-command support]
 % \end{meta-comment}
 %
 % \CheckSum{355}
diff --git a/centre.dtx b/centre.dtx
index 7ae1032..053cfc2 100644
--- a/centre.dtx
+++ b/centre.dtx
@@ -22,7 +22,7 @@
 % \begin{meta-comment} <Package preambles>
 %<+package>\NeedsTeXFormat{LaTeX2e}
 %<+package>\ProvidesPackage{centre}
-%<+package>                [2003/08/24 1.0 center, only spelt correctly]
+%<+package>                [2020/09/06 1.14.0 center, only spelt correctly]
 % \end{meta-comment}
 %
 % \CheckSum{21}
diff --git a/cmtt.dtx b/cmtt.dtx
index 2934f58..534e33c 100644
--- a/cmtt.dtx
+++ b/cmtt.dtx
@@ -25,7 +25,7 @@
 %<+sty>\ProvidesPackage{cmtt}
 %<+fd>\ProvidesFile{mttcmtt.fd}
 %<+def>\ProvidesFile{mttcmtt.def}
-%<+sty|fd|def>         [1996/05/25 1.1 Handing of the cmtt font]
+%<+sty|fd|def>         [2020/09/06 1.14.0 Handing of the cmtt font]
 % \end{meta-comment}
 %
 % \CheckSum{174}
diff --git a/colour.dtx b/colour.dtx
index 5e66aa3..8277ac3 100644
--- a/colour.dtx
+++ b/colour.dtx
@@ -22,7 +22,7 @@
 % \begin{meta-comment} <Package preambles>
 %<+package>\NeedsTeXFormat{LaTeX2e}
 %<+package>\ProvidesPackage{colour}
-%<+package>                [2003/08/24 1.0 color, only spelt correctly]
+%<+package>                [2020/09/06 1.14.0 color, only spelt correctly]
 % \end{meta-comment}
 %
 % \CheckSum{26}
diff --git a/crypto.dtx b/crypto.dtx
index 8388b7f..77acde6 100644
--- a/crypto.dtx
+++ b/crypto.dtx
@@ -21,7 +21,7 @@
 % \begin{meta-comment} <Package preambles>
 %<+package>\NeedsTeXFormat{LaTeX2e}
 %<+package>\ProvidesPackage{crypto}
-%<+package>                [2001/09/16 1.0 Crypto typesetting]
+%<+package>                [2020/09/06 1.14.0 Crypto typesetting]
 % \end{meta-comment}
 %
 % \CheckSum{258}
diff --git a/doafter.dtx b/doafter.dtx
index 5218768..cf5b36a 100644
--- a/doafter.dtx
+++ b/doafter.dtx
@@ -25,7 +25,7 @@
 % \begin{meta-comment} <Package preamble>
 %<+latex2e>\NeedsTeXFormat{LaTeX2e}
 %<+latex2e>\ProvidesPackage{doafter}
-%<+latex2e>                [1996/05/08 1.2 Aftergroup hacking]
+%<+latex2e>                [2020/09/06 1.14.0 Aftergroup hacking]
 % \end{meta-comment}
 %
 % \CheckSum{259}
diff --git a/exercise.dtx b/exercise.dtx
index 41e3834..2658936 100644
--- a/exercise.dtx
+++ b/exercise.dtx
@@ -21,7 +21,7 @@
 % \begin{meta-comment} <Package preambles>
 %<+package>\NeedsTeXFormat{LaTeX2e}
 %<+package>\ProvidesPackage{exercise}
-%<+package>                [2003/08/25 1.1 Exercies with answers]
+%<+package>                [2020/09/06 1.14.0 Exercies with answers]
 % \end{meta-comment}
 %
 % \CheckSum{271}
diff --git a/footnote.dtx b/footnote.dtx
index 61df157..ef9e02a 100644
--- a/footnote.dtx
+++ b/footnote.dtx
@@ -24,7 +24,7 @@
 % \begin{meta-comment} <Package preamble>
 %<+package>\NeedsTeXFormat{LaTeX2e}
 %<+package>\ProvidesPackage{footnote}
-%<+package>                [1997/01/28 1.13 Save footnotes around boxes]
+%<+package>                [2020/09/06 1.14.0 Save footnotes around boxes]
 % \end{meta-comment}
 %
 % \CheckSum{329}
diff --git a/mdwkey.dtx b/mdwkey.dtx
index 2cfd9b3..fc34fd9 100644
--- a/mdwkey.dtx
+++ b/mdwkey.dtx
@@ -24,7 +24,7 @@
 % \begin{meta-comment} <Package preamble>
 %<+package&!plain>\NeedsTeXFormat{LaTeX2e}
 %<+package&!plain>\ProvidesPackage{mdwkey}
-%<+package&!plain>                [2003/08/21 1.0 Key/value parser]
+%<+package&!plain>                [2020/09/06 1.14.0 Key/value parser]
 % \end{meta-comment}
 %
 % \CheckSum{316}
diff --git a/mdwlist.dtx b/mdwlist.dtx
index 31afe9d..3102560 100644
--- a/mdwlist.dtx
+++ b/mdwlist.dtx
@@ -22,7 +22,7 @@
 % \begin{meta-comment} <Package preambles>
 %<+package>\NeedsTeXFormat{LaTeX2e}
 %<+package>\ProvidesPackage{mdwlist}
-%<+package>                [1996/05/02 1.1 Various list-related things]
+%<+package>                [2020/09/06 1.14.0 Various list-related things]
 % \end{meta-comment}
 %
 % \CheckSum{183}
diff --git a/mdwmath.dtx b/mdwmath.dtx
index 2843ed9..d482b12 100644
--- a/mdwmath.dtx
+++ b/mdwmath.dtx
@@ -22,10 +22,10 @@
 % \begin{meta-comment} <Package preamble>
 %<+package>\NeedsTeXFormat{LaTeX2e}
 %<+package>\ProvidesPackage{mdwmath}
-%<+package>                [2003/08/25 1.3 Nice mathematical things]
+%<+package>                [2020/09/06 1.14.0 Nice mathematical things]
 %<+oldeqnarray>\NeedsTeXFormat{LaTeX2e}
 %<+oldeqnarray>\ProvidesPackage{eqnarray}
-%<+oldeqnarray>                [1996/04/11 1.1 Old enhanced eqnarray]
+%<+oldeqnarray>                [2020/09/06 1.14.0 Old enhanced eqnarray]
 % \end{meta-comment}
 %
 % \CheckSum{740}
diff --git a/mdwref.dtx b/mdwref.dtx
index e6e20c8..e4b1fb4 100644
--- a/mdwref.dtx
+++ b/mdwref.dtx
@@ -22,7 +22,7 @@
 % \begin{meta-comment} <Package preambles>
 %<+package>\NeedsTeXFormat{LaTeX2e}
 %<+package>\ProvidesPackage{mdwref}
-%<+package>                [2007/04/09 1.01 Cross-referencing]
+%<+package>                [2020/09/06 1.14.0 Cross-referencing]
 % \end{meta-comment}
 %
 % ^^A\CheckSum{96}
diff --git a/mdwtab.dtx b/mdwtab.dtx
index 368b4b0..0315bce 100644
--- a/mdwtab.dtx
+++ b/mdwtab.dtx
@@ -22,16 +22,16 @@
 % \begin{meta-comment} <Package preambles>
 %<+mdwtab>\NeedsTeXFormat{LaTeX2e}
 %<+mdwtab>\ProvidesPackage{mdwtab}
-%<+mdwtab>                [2003/08/24 1.10 Table typesetting with style]
+%<+mdwtab>                [2020/09/06 1.14.0 Table typesetting with style]
 %<+mathenv>\NeedsTeXFormat{LaTeX2e}
 %<+mathenv>\ProvidesPackage{mathenv}
-%<+mathenv>                [2003/08/24 1.10 Various maths environments]
+%<+mathenv>                [2020/09/06 1.14.0 Various maths environments]
 %<+colour>\NeedsTeXFormat{LaTeX2e}
 %<+colour>\ProvidesPackage{mtcolour}
-%<+colour>                [2003/08/24 1.10 Colour support for mdwtab]
+%<+colour>                [2020/09/06 1.14.0 Colour support for mdwtab]
 %<+color>\NeedsTeXFormat{LaTeX2e}
 %<+color>\ProvidesPackage{mtcolor}
-%<+color>                [2003/08/24 1.10 Fix for people who can't spell]
+%<+color>                [2020/09/06 1.14.0 Fix for people who can't spell]
 % \end{meta-comment}
 %
 % \CheckSum{3424}
diff --git a/mdwthm.dtx b/mdwthm.dtx
index 83c171c..145dca1 100644
--- a/mdwthm.dtx
+++ b/mdwthm.dtx
@@ -21,9 +21,9 @@
 % \begin{meta-comment} <Package preambles>
 %<+package>\NeedsTeXFormat{LaTeX2e}
 %<+package>\ProvidesPackage{mdwthm}
-%<+package>                [2001/09/16 1.0 Theorem typesetting]
+%<+package>                [2020/09/06 1.14.0 Theorem typesetting]
 %<+thmstyle>\ProvidesFile{mdwmargin.thm}
-%<+thmstyle>             [2001/09/16 1.0 Numbers-in-the-margin theorem style]
+%<+thmstyle>             [2020/09/06 1.14.0 Numbers-in-the-margin theorem style]
 % \end{meta-comment}
 %
 % \CheckSum{204}
diff --git a/mdwtools.tex b/mdwtools.tex
index 147c223..f9b6851 100644
--- a/mdwtools.tex
+++ b/mdwtools.tex
@@ -22,7 +22,7 @@
 % \begin{meta-comment} <file preamble>
 %<*mdwtools>
 \ProvidesFile{mdwtools.tex}
-             [1996/05/10 1.4 Shared definitions for mdwtools .dtx files]
+             [2020/09/06 1.14.0 Shared definitions for mdwtools .dtx files]
 %</mdwtools>
 % \end{meta-comment}
 %
diff --git a/poetry.dtx b/poetry.dtx
index aad3065..0a29f69 100644
--- a/poetry.dtx
+++ b/poetry.dtx
@@ -22,7 +22,7 @@
 % \begin{meta-comment} <Package preambles>
 %<+package>\NeedsTeXFormat{LaTeX2e}
 %<+package>\ProvidesPackage{poetry}
-%<+package>                [1996/05/28 1.00 Poetry typesetting]
+%<+package>                [2016/01/24 1.8.0 Poetry typesetting]
 % \end{meta-comment}
 %
 % \CheckSum{593}
diff --git a/slowbox.dtx b/slowbox.dtx
index 756adf5..37d1e7b 100644
--- a/slowbox.dtx
+++ b/slowbox.dtx
@@ -21,7 +21,7 @@
 % \begin{meta-comment} <Package preambles>
 %<+package>\NeedsTeXFormat{LaTeX2e}
 %<+package>\ProvidesPackage{slowbox}
-%<+package>                [2003/08/27 1.0 Skipping of slow boxes]
+%<+package>                [2020/09/06 1.14.0 Skipping of slow boxes]
 % \end{meta-comment}
 %
 % \CheckSum{223}
diff --git a/sverb.dtx b/sverb.dtx
index 377205e..8185540 100644
--- a/sverb.dtx
+++ b/sverb.dtx
@@ -22,16 +22,16 @@
 % \begin{meta-comment} <Package preamble>
 %<+package>\NeedsTeXFormat{LaTeX2e}
 %<+package>\ProvidesPackage{sverb}
-%<+package>                [2003/09/04 1.4 Verbatim typesetting]
+%<+package>                [2020/09/06 1.14.0 Verbatim typesetting]
 %<+colour>\NeedsTeXFormat{LaTeX2e}
 %<+colour>\ProvidesPackage{svcolour}
-%<+colour>                [2003/09/04 1.4 Colour support for sverb]
+%<+colour>                [2020/09/06 1.14.0 Colour support for sverb]
 %<+color>\NeedsTeXFormat{LaTeX2e}
 %<+color>\ProvidesPackage{svcolor}
-%<+color>                [2003/09/04 1.4 Fix for people who can't spell]
+%<+color>                [2020/09/06 1.14.0 Fix for people who can't spell]
 %<+split>\NeedsTeXFormat{LaTeX2e}
 %<+split>\ProvidesPackage{svsplit}
-%<+split>                [2003/09/04 1.4 Verbatim, but with line breaking]
+%<+split>                [2020/09/06 1.14.0 Verbatim, but with line breaking]
 % \end{meta-comment}
 %
 % \CheckSum{1012}
diff --git a/syntax.dtx b/syntax.dtx
index b22eb15..d25e5f4 100644
--- a/syntax.dtx
+++ b/syntax.dtx
@@ -22,7 +22,7 @@
 % \begin{meta-comment} <Package preamble>
 %<+package>\NeedsTeXFormat{LaTeX2e}
 %<+package>\ProvidesPackage{syntax}
-%<+package>                [2003/08/25 1.08 Syntax typesetting]
+%<+package>                [2020/09/06 1.14.0 Syntax typesetting]
 % \end{meta-comment}
 %
 % \CheckSum{1628}
diff --git a/update-version b/update-version
new file mode 100755
index 0000000..27b1326
--- /dev/null
+++ b/update-version
@@ -0,0 +1,17 @@
+#! /bin/sh -e
+
+case $# in  0 | 1) echo >&2 "usage: $0 NEWVER FILE ..."; exit 2 ;; esac
+newver=$1; shift
+
+for i; do
+  t=$(git log -n1 --date="format:%Y/%m/%d" --format="%H %cd" "$i")
+  read h d <<EOF
+$t
+EOF
+  set +e
+  if ! v=$(git describe 2>/dev/null --contains $h); then v=$newver
+  else v=${v%[~^]*}
+  fi
+  set -e
+  perl -i -pe"s!^((?:\\%\<\\+[^>]*\\>)?\\s*\\[)[\\d/]+ [\\d.]+( .*$)!\${1}$d $v\${2}!" "$i"
+done
-- 
2.11.0

