Add code to generate ChangeLog from git

This code will determine the repo type (git or svn) and use the
appropriate command to generate the ChangeLog file accordingly.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22982 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Geert Janssens 2013-05-17 10:10:37 +00:00
parent 35036bd24e
commit 9582469c11
2 changed files with 40 additions and 4 deletions

View File

@ -183,8 +183,10 @@ intl-scm/guile-strings.c:
.potfiles:
GIT_CMD = @GIT_CMD@
SVN = svn
XSLTPROC = xsltproc
SCM_TYPE = @SCM_TYPE@
if BUILDING_FROM_SCM
# This rule will generate a ChangeLog of gnucash/trunk commits, plus
@ -193,9 +195,20 @@ if BUILDING_FROM_SCM
# idea? Before a release, NEWS will get updated because of the version
# change, so this should fit just fine.)
ChangeLog: NEWS
$(SVN) log -v --xml -r HEAD:22687 http://svn.gnucash.org/repo/gnucash | \
$(XSLTPROC) --stringparam strip-prefix "gnucash/trunk" \
--stringparam include-rev "yes" $(srcdir)/macros/svn2cl.xsl - > $@
cd $(abs_srcdir) ; \
if test x$(SCM_TYPE) = xsvn ; then \
$(SVN) log -v --xml -r HEAD:'{2013-01-01}' http://svn.gnucash.org/repo/gnucash | \
$(XSLTPROC) --stringparam strip-prefix "gnucash/trunk" \
--stringparam include-rev "yes" $(abs_srcdir)/macros/svn2cl.xsl - > $(abs_builddir)/$@ ; \
else \
if test x$(SCM_TYPE) = xgit ; then \
"$(GIT_CMD)" log --format="%ad %aN %n%n%x09* %s%d%n" --date=short --since=2013-01-01 > $(abs_builddir)/$@ ; \
else \
touch $(abs_builddir)/$@ ; \
echo "Note: not in svn or git. ChangeLog not regenerated." ; \
fi ; \
fi ; \
cd $(abs_builddir)
endif
ASTYLE = /usr/bin/astyle

View File

@ -175,15 +175,35 @@ if test x$am_cv_scanf_lld = "xno"; then
fi
# test whether we are building directly from svn/svk/git/bzr
${srcdir}/util/gnc-scm-info -r ${srcdir} >/dev/null 2>&1
AC_MSG_CHECKING(if building from an scm managed directory)
GIT_CMD=
savedir="$PWD"
cd "${srcdir}"
./util/gnc-scm-info -r . >/dev/null 2>&1
if test $? = 0 -o "x${BUILDING_FROM_SCM}" = "xyes" ; then
BUILDING_FROM_SCM=yes
SCM_TYPE=$(./util/gnc-scm-info -t .)
AC_MSG_RESULT($SCM_TYPE)
if test "x${SCM_TYPE}" = "xgit"; then
AC_MSG_CHECKING(git command to use due to detected git repo)
# The windows build uses environment variable $GIT_CMD to invoke git (adding git
# to the PATH in Windows results in a build failure).
# So for platform independence, use GIT_CMD for all
if test -z "${GIT_CMD}" ; then
GIT_CMD=git
fi
AC_MSG_RESULT(${GIT_CMD})
fi
# We need at least version 1.3.31 of SWIG because
# that's when SWIG doesn't barf on the "inline" keyword in C headers anymore
AC_PROG_SWIG(1.3.31)
else
AC_MSG_RESULT(no)
BUILDING_FROM_SCM=no
SCM_TYPE=
# Make sure we've got swig-runtime.h and gnc-scm-info.h
AC_CHECK_FILE(${srcdir}/src/swig-runtime.h, [],
[AC_MSG_ERROR([
@ -206,7 +226,10 @@ the tarball you downloaded is broken.
])])
fi
cd "${savedir}"
AM_CONDITIONAL(BUILDING_FROM_SCM, test "x$BUILDING_FROM_SCM" = "xyes")
AC_SUBST(SCM_TYPE)
AC_SUBST(GIT_CMD)
# Build dir adjustments
AM_CONDITIONAL(GNUCASH_SEPARATE_BUILDDIR, test "x${srcdir}" != "x.")