mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Make GnuCash compile from a git repository.
Patch gnc-svnversion to check for .git, but in the top-level source directory instead of src/gnome-utils. Use the output of "git-rev-parse HEAD" as version string. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15292 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
b7ddce32b3
commit
348c8cce3e
@ -220,7 +220,7 @@ _gnc-version.h: gnc-svninfo.h Makefile
|
||||
@echo "#ifndef GNC_VERSION_H" >> _gnc-version.h
|
||||
@echo "#define GNC_VERSION_H" >> _gnc-version.h
|
||||
@echo "" >> _gnc-version.h
|
||||
@svninfo=`${top_srcdir}/util/gnc-svnversion ${srcdir}` ; \
|
||||
@svninfo=`${top_srcdir}/util/gnc-svnversion ${top_srcdir}` ; \
|
||||
if [ $$? = 0 ] ; then \
|
||||
echo "#define GNUCASH_SVN 1" >> _gnc-version.h ; \
|
||||
fi
|
||||
@ -234,11 +234,11 @@ gnc-svninfo.h: _gnc-svninfo.h
|
||||
-rm -f _gnc-svninfo.h
|
||||
|
||||
_gnc-svninfo.h: Makefile
|
||||
@svninfo=`${top_srcdir}/util/gnc-svnversion ${srcdir}` ; \
|
||||
@svninfo=`${top_srcdir}/util/gnc-svnversion ${top_srcdir}` ; \
|
||||
if [ $$? = 0 ] ; then \
|
||||
if [ -z "$$svninfo" ] ; then \
|
||||
echo "gnc-svnversion failed. figure out why." ; \
|
||||
echo "can't determine svn revision from ${srcdir}." ; \
|
||||
echo "can't determine svn revision from ${top_srcdir}." ; \
|
||||
exit 1 ; \
|
||||
fi ; \
|
||||
echo "/* Autogenerated. Do not change. */" > _gnc-svninfo.h ; \
|
||||
|
@ -4,7 +4,7 @@
|
||||
# gnc-svnversion <srcdir>
|
||||
#
|
||||
# Prints the revision number to stdout and exits 0 on success
|
||||
# exits with errorcode 1 if we're not in an svn or svk checkout
|
||||
# exits with errorcode 1 if we're not in an svn, svk or git checkout
|
||||
#
|
||||
# Written By: Derek Atkins <derek@ihtfp.com>
|
||||
#
|
||||
@ -40,8 +40,21 @@ then
|
||||
exit $?
|
||||
fi
|
||||
|
||||
# If we get here then this is NOT an svn checkout. Maybe it's
|
||||
# SVK? First, check if we've got 'svk' in the path. If not,
|
||||
# If we get here then this is NOT an svn checkout.
|
||||
|
||||
# Maybe it's git?
|
||||
if test -d "${real_srcdir}"/.git
|
||||
then
|
||||
githead=`git --git-dir "${real_srcdir}"/.git rev-parse HEAD 2>/dev/null`
|
||||
if test $? = 0 ; then
|
||||
echo $githead
|
||||
exit 0
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Maybe it's SVK? First, check if we've got 'svk' in the path. If not,
|
||||
# then exit with an error code of 1..
|
||||
which svk >/dev/null 2>&1
|
||||
if test $? != 0 ; then exit 1 ; fi
|
||||
|
Loading…
Reference in New Issue
Block a user