#!/bin/sh
if test "`git describe --abbrev=1`" != \
	"`sed -n '/^m4_def.*XFIG_VERS/ {s/.*, *\[\(.*\)\])/\1/;p}' version.m4`"
then
    sed  -i "\
	/^m4_define(\[\{0,1\}XFIG_VERSION/ s/\(.*, *\[\).*\]/\1`git describe --abbrev=1`]/
	/^m4_define(\[\{0,1\}RELEASEDATE/ s/\(.*, *\[\).*\]/\1`git show -s --pretty=%cd --date=format:'%b %Y'`]/" version.m4
fi
