File: update-version_m4

package info (click to toggle)
fig2dev 1%3A3.2.9a-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,708 kB
  • sloc: ansic: 38,164; sh: 7,981; makefile: 162; csh: 12
file content (33 lines) | stat: -rwxr-xr-x 1,406 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh

# Fig2dev: Translate Fig code to various Devices
# Copyright (c) 1991 by Micah Beck
# Parts Copyright (c) 1985-1988 by Supoj Sutanthavibul
# Parts Copyright (c) 1989-2015 by Brian V. Smith
# Parts Copyright (c) 2015-2019 by Thomas Loimer
#
# Any party obtaining a copy of these files is granted, free of charge, a
# full and unrestricted irrevocable, world-wide, paid up, royalty-free,
# nonexclusive right and license to deal in this software and documentation
# files (the "Software"), including without limitation the rights to use,
# copy, modify, merge, publish, distribute, sublicense and/or sell copies
# of the Software, and to permit persons who receive copies from any such
# party to do so, with the only requirement being that the above copyright
# and this permission notice remain intact.
#
#

#
# update-version_m4: Set the version information in version.m4.
# Author: Thomas Loimer <thomas.loimer@tuwien.ac.at>, 2016-2023
#

# test, whether git is available, and we are in a git tree
if git config --local -l >/dev/null 2>&1 &&	\
    test "`git describe --abbrev=1`" !=		\
	"`sed -n '/^m4_def.*FIG_VERS/ {s/.*, *\[\(.*\)\])/\1/;p}' version.m4`"
then
    sed  -i "\
	/^m4_define(\[\{0,1\}FIG_VERSION/ s/\(.*, *\[\).*\]/\1`git describe --abbrev=1`]/
	/^m4_define(\[\{0,1\}RELEASEDATE/ s/\(.*, *\[\).*\]/\1`LC_TIME=C git show -s --pretty=%cd --date=format:'%b %Y'`]/" version.m4
fi