summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/pgf/pgfrevisionfile.sh
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-12-19 22:11:59 +0000
committerKarl Berry <karl@freefriends.org>2019-12-19 22:11:59 +0000
commit8876a8021514f190d676e4e5261f1084a66754d3 (patch)
tree9a496107a312a1acbbdb06ea0e1657c285109729 /Master/texmf-dist/scripts/pgf/pgfrevisionfile.sh
parent693eacf895c01285e2992460bb489142ead8ae8a (diff)
pgf (19dec19)
git-svn-id: svn://tug.org/texlive/trunk@53187 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/pgf/pgfrevisionfile.sh')
-rwxr-xr-xMaster/texmf-dist/scripts/pgf/pgfrevisionfile.sh43
1 files changed, 43 insertions, 0 deletions
diff --git a/Master/texmf-dist/scripts/pgf/pgfrevisionfile.sh b/Master/texmf-dist/scripts/pgf/pgfrevisionfile.sh
new file mode 100755
index 00000000000..b2f596ce734
--- /dev/null
+++ b/Master/texmf-dist/scripts/pgf/pgfrevisionfile.sh
@@ -0,0 +1,43 @@
+#!/bin/bash
+# it generates tex/generic/pgf/pgf.revision.tex which, in turn, will be loaded
+# by pgf.sty
+#
+# The resulting macros define the current version of pgf.
+
+set -e
+
+LATEST_TAG=`git describe --abbrev=0 --tags`
+REVISION=`git describe --tags HEAD`
+
+
+rm -f tex/generic/pgf/pgf.revision.tex
+echo '\begingroup' >> tex/generic/pgf/pgf.revision.tex
+echo '\catcode`\-=12' >> tex/generic/pgf/pgf.revision.tex
+echo '\catcode`\/=12' >> tex/generic/pgf/pgf.revision.tex
+echo '\catcode`\.=12' >> tex/generic/pgf/pgf.revision.tex
+echo '\catcode`\:=12' >> tex/generic/pgf/pgf.revision.tex
+echo '\catcode`\+=12' >> tex/generic/pgf/pgf.revision.tex
+echo '\catcode`\-=12' >> tex/generic/pgf/pgf.revision.tex
+
+# this is the REVISION, i.e. the unique hash of the changeset.
+echo '\gdef\pgfrevision{'"$REVISION}" >> tex/generic/pgf/pgf.revision.tex
+
+# this is the public version name. It corresponds to the latest tag name in the git repo.
+echo '\gdef\pgfversion{'"$LATEST_TAG}" >> tex/generic/pgf/pgf.revision.tex
+
+# this is the commit date of the latest tag, i.e. the date when \pgfversion has been committed.
+# It is NOT the date of \pgfrevision.
+echo -n '\gdef\pgfversiondatetime{' >> tex/generic/pgf/pgf.revision.tex
+git log -n 1 "$LATEST_TAG" --pretty=format:"%ci" >> tex/generic/pgf/pgf.revision.tex
+echo '}' >> tex/generic/pgf/pgf.revision.tex
+
+echo -n '\gdef\pgfrevisiondatetime{' >> tex/generic/pgf/pgf.revision.tex
+git log -n 1 "$REVISION" --pretty=format:"%ci" >> tex/generic/pgf/pgf.revision.tex
+echo '}' >> tex/generic/pgf/pgf.revision.tex
+
+# convert to latex format YYYY/MM/DD :
+echo '\gdef\pgf@glob@TMPa#1-#2-#3 #4\relax{#1/#2/#3}' >> tex/generic/pgf/pgf.revision.tex
+echo '\xdef\pgfversiondate{\expandafter\pgf@glob@TMPa\pgfversiondatetime\relax}' >> tex/generic/pgf/pgf.revision.tex
+echo '\xdef\pgfrevisiondate{\expandafter\pgf@glob@TMPa\pgfrevisiondatetime\relax}' >> tex/generic/pgf/pgf.revision.tex
+echo '\endgroup' >> tex/generic/pgf/pgf.revision.tex
+exit 0