[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] elpa e4cde66 02/35: Determine AUCTEXDATE and AUCTEXVERSION from g
From: |
Tassilo Horn |
Subject: |
[elpa] elpa e4cde66 02/35: Determine AUCTEXDATE and AUCTEXVERSION from git |
Date: |
Sun, 31 Jan 2016 16:05:32 +0000 |
branch: elpa
commit e4cde665461df3397113aea7e1976eeec01f5dfc
Author: Mosè Giordano <address@hidden>
Commit: Mosè Giordano <address@hidden>
Determine AUCTEXDATE and AUCTEXVERSION from git
* aclocal.m4 (AC_DATE_VERSION_FROM_CHANGELOG): if this is git
repository, use it to determine the variables.
* autogen.sh: Ditto.
---
aclocal.m4 | 36 +++++++++++++++++++++++++++---------
autogen.sh | 23 +++++++++++++++++++----
2 files changed, 46 insertions(+), 13 deletions(-)
diff --git a/aclocal.m4 b/aclocal.m4
index 9b29ec0..b701653 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -93,21 +93,39 @@ fi
])
AC_DEFUN(AC_DATE_VERSION_FROM_CHANGELOG, [
-AC_MSG_CHECKING([for date in ChangeLog])
-$1=[`sed -n '1s/^\([-0-9][-0-9]*\).*/\1/p' "$3"`]
+AC_MSG_CHECKING([for date with git])
+$1=[`git log -1 --date=short --format=%ad 2> /dev/null`]
if test "X${$1}" = X
then
- AC_MSG_ERROR([[not found]])
+ AC_MSG_RESULT([git not found, checking for date in ChangeLog:])
+ $1=[`sed -n '1s/^\([-0-9][-0-9]*\).*/\1/p' "$3"`]
+ if test "X${$1}" = X
+ then
+ AC_MSG_ERROR([[not found]])
+ fi
fi
AC_MSG_RESULT(${$1})
-AC_MSG_CHECKING([for release in ChangeLog])
-$2=[`sed -n '2,/^[0-9]/s/.*Version \(.*\) released\..*/\1/p' "$3"`]
-if test "X${$2}" = X
+
+AC_MSG_CHECKING([for release with git])
+if git describe --tags > /dev/null 2> /dev/null
then
- $2=${$1}
- AC_MSG_RESULT([not found, using ${$2} instead])
+ if test "X`git describe --tags | sed 's/release_.._..//'`" = X
+ then
+ $2=[`git describe --tags`]
+ else
+ $2=${$1}
+ AC_MSG_RESULT([not found, using ${$2} instead])
+ fi
else
- AC_MSG_RESULT([${$2}])
+ AC_MSG_RESULT([git not found, checking for release in ChangeLog:])
+ $2=[`sed -n '2,/^[0-9]/s/.*Version \(.*\) released\..*/\1/p' "$3"`]
+ if test "X${$2}" = X
+ then
+ $2=${$1}
+ AC_MSG_RESULT([not found, using ${$2} instead])
+ else
+ AC_MSG_RESULT([${$2}])
+ fi
fi
])
diff --git a/autogen.sh b/autogen.sh
index 6b2bd73..1bed156 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -32,14 +32,29 @@ ${AUTOCONF} || { echo "Error running ${AUTOCONF} in ." >&2
; exit 1; }
rm -rf autom4te.cache
if test "x${AUCTEXDATE}" = x
then
- AUCTEXDATE=`LC_ALL=C sed -n '1s/^\([-0-9][-0-9]*\).*/\1/p' ChangeLog.1`
- test "X${AUCTEXDATE}" != X || { echo "Can't find date in ChangeLog.1" >&2
; exit 1; }
+ AUCTEXDATE=`git log -1 --date=short --format=%ad 2> /dev/null`
+ if test "X${AUCTEXDATE}" = X
+ then
+ echo "Can't find date with git, trying with ChangeLog.1..." >&2
+ AUCTEXDATE=`LC_ALL=C sed -n '1s/^\([-0-9][-0-9]*\).*/\1/p' ChangeLog.1`
+ test "X${AUCTEXDATE}" != X || { echo "Can't find date in ChangeLog.1"
>&2 ; exit 1; }
+ fi
fi
if test "x${AUCTEXVERSION}" = x
then
- AUCTEXVERSION=`sed -n '2,/^[0-9]/s/.*Version \(.*\) released\..*/\1/p'
ChangeLog.1`
- test "X${AUCTEXVERSION}" != X || AUCTEXVERSION=${AUCTEXDATE}
+ if git describe --tags >/dev/null 2> /dev/null
+ then
+ if test "X`git describe --tags | sed 's/release_.._..//'`" = X
+ then
+ AUCTEXVERSION=`git describe --tags`
+ else
+ AUCTEXVERSION=${AUCTEXDATE}
+ fi
+ else
+ AUCTEXVERSION=`sed -n '2,/^[0-9]/s/.*Version \(.*\) released\..*/\1/p'
ChangeLog.1`
+ test "X${AUCTEXVERSION}" != X || AUCTEXVERSION=${AUCTEXDATE}
+ fi
fi
cd doc
- [elpa] branch elpa created (now 0a99c11), Tassilo Horn, 2016/01/31
- [elpa] elpa 43cbc5f 04/35: Remove support to "Master:" line, Tassilo Horn, 2016/01/31
- [elpa] elpa e4cde66 02/35: Determine AUCTEXDATE and AUCTEXVERSION from git,
Tassilo Horn <=
- [elpa] elpa c2fbb9c 01/35: Fix error in autogen.sh, configure, and Makefile, Tassilo Horn, 2016/01/31
- [elpa] elpa fac521d 05/35: Fix bug in TeX-command-sequence, Tassilo Horn, 2016/01/31
- [elpa] elpa 4ed66ee 03/35: Activate RefTeX reference styles, Tassilo Horn, 2016/01/31
- [elpa] elpa 8334cde 08/35: ; Fix a typo in header, Tassilo Horn, 2016/01/31
- [elpa] elpa 065b1e8 09/35: Improve style/amsthm.el, Tassilo Horn, 2016/01/31
- [elpa] elpa 68d9b03 07/35: Rename TeX-after-TeX-LaTeX-command-finished-hook, Tassilo Horn, 2016/01/31
- [elpa] elpa 2880b62 13/35: Fix regex in texmathp, Tassilo Horn, 2016/01/31
- [elpa] elpa 63ea223 06/35: Convert Elisp source files to UTF-8, Tassilo Horn, 2016/01/31
- [elpa] elpa 5940550 10/35: Add new style/theorem.el, Tassilo Horn, 2016/01/31
- [elpa] elpa 15ebec9 12/35: Rename TeX-after-compilation-finished-hook to -functions, Tassilo Horn, 2016/01/31