]>
diplodocus.org Git - nmh/blob - config/version.sh
3 # version.sh -- script to create version string(s) for nmh.
5 # You need to pass the script the version number to use.
9 echo "usage: version.sh VERSION" 1>&2
18 # Find out the name of the host we are compiling on
19 for prog
in uname hostname
23 if [ ! -f $dir/$prog ]; then
27 uname
) HOSTNAME
=`$prog -n`
29 hostname
) HOSTNAME
=`$prog`
34 if [ X
"$HOSTNAME" != X
-a X
"$HOSTNAME" != Xunknown
]; then
41 if [ -d "${srcdir}/.git" ] ; then
42 branch
=`(git branch | grep '^\*' | tr -d '* ') || true`
44 if [ "${branch}" -a "${branch}" != "master" ] ; then
45 echo "char *version_str = \"nmh-$VERSION [branch ${branch}] [compiled on $HOSTNAME at `date`]\";"
47 echo "char *version_str = \"nmh-$VERSION [compiled on $HOSTNAME at `date`]\";"
49 echo "char *version_num = \"nmh-$VERSION\";"