2006-09-07 20:01:07 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
2014-02-07 19:14:52 +00:00
|
|
|
# Check for Git version
|
2006-09-07 20:01:07 +00:00
|
|
|
#
|
|
|
|
# Wireshark - Network traffic analyzer
|
|
|
|
# By Gerald Combs <gerald@wireshark.org>
|
|
|
|
# Copyright 2005 Ulf Lamping
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
2012-06-28 22:56:06 +00:00
|
|
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2014-01-22 18:15:44 +00:00
|
|
|
#
|
|
|
|
|
2014-02-09 19:01:49 +00:00
|
|
|
GIT_VERSION="unknown git version"
|
2014-02-07 19:14:52 +00:00
|
|
|
if [ -d ../.git ] ; then
|
2014-02-09 19:01:49 +00:00
|
|
|
GIT_VERSION=`git describe --always --long`
|
2014-02-07 19:14:52 +00:00
|
|
|
fi
|
|
|
|
echo '<!ENTITY GitVersion "'${GIT_VERSION}'">' > git_version_tmp.xml
|
2006-09-07 20:01:07 +00:00
|
|
|
|
2014-02-07 19:14:52 +00:00
|
|
|
#echo -n '<!ENTITY GitVersion "' > git_version_tmp.xml
|
|
|
|
#[ -x svnversion ] && svnversion -n . >> git_version_tmp.xml
|
|
|
|
#echo '">' >> git_version_tmp.xml
|
2006-09-07 20:01:07 +00:00
|
|
|
|
|
|
|
# /dev/null buries the output of the "cmp" command.
|
2014-01-22 18:15:44 +00:00
|
|
|
diff git_version.xml git_version_tmp.xml &> /dev/null
|
2006-09-07 20:01:07 +00:00
|
|
|
|
|
|
|
if [ $? -ne 0 ]
|
|
|
|
then
|
2014-01-22 18:15:44 +00:00
|
|
|
cp git_version_tmp.xml git_version.xml
|
2006-09-07 20:01:07 +00:00
|
|
|
fi
|
|
|
|
|
2014-01-22 18:15:44 +00:00
|
|
|
rm git_version_tmp.xml
|
2009-12-29 12:12:26 +00:00
|
|
|
|