Debian Codegraph @

update-version_m4

raw
1 #!/bin/sh
2
3 # Fig2dev: Translate Fig code to various Devices
4 # Copyright (c) 1991 by Micah Beck
5 # Parts Copyright (c) 1985-1988 by Supoj Sutanthavibul
6 # Parts Copyright (c) 1989-2015 by Brian V. Smith
7 # Parts Copyright (c) 2015-2019 by Thomas Loimer
8 #
9 # Any party obtaining a copy of these files is granted, free of charge, a
10 # full and unrestricted irrevocable, world-wide, paid up, royalty-free,
11 # nonexclusive right and license to deal in this software and documentation
12 # files (the "Software"), including without limitation the rights to use,
13 # copy, modify, merge, publish, distribute, sublicense and/or sell copies
14 # of the Software, and to permit persons who receive copies from any such
15 # party to do so, with the only requirement being that the above copyright
16 # and this permission notice remain intact.
17 #
18 #
19
20 #
21 # update-version_m4: Set the version information in version.m4.
22 # Author: Thomas Loimer <[email protected]>, 2016-2023
23 #
24
25 # test, whether git is available, and we are in a git tree
26 if git config --local -l >/dev/null 2>&1 && \
27 test "`git describe --abbrev=1`" != \
28 "`sed -n '/^m4_def.*FIG_VERS/ {s/.*, *\[\(.*\)\])/\1/;p}' version.m4`"
29 then
30 sed -i "\
31 /^m4_define(\[\{0,1\}FIG_VERSION/ s/\(.*, *\[\).*\]/\1`git describe --abbrev=1`]/
32 /^m4_define(\[\{0,1\}RELEASEDATE/ s/\(.*, *\[\).*\]/\1`LC_TIME=C git show -s --pretty=%cd --date=format:'%b %Y'`]/" version.m4
33 fi