Commit 2ca7dcd6 2ca7dcd648057aaa45b6b4f74acd3afbd99e410c by Sergey Poznyakoff

Housekeeping: implement a tool for producing intermediate alpha tarballs.

Intermediate tarballs have the same version number as initial alpha
version, to which is appended a suffix "-N", where N is the number of
commits between the current git HEAD and the original alpha release.

Additionally, the --version (or -version, for MH) output has been changed
to include the N and the git description (for all releases, but stable).

* .gitignore: Update.
* Makefile.am: Remove git-describe and git-describe.h goals.
(alpha, alphacheck): Rewrite.
* configure.ac (GITINFO): New subst variable.
* include/mailutils/Makefile.am (gitinfo.h): New built source.
* libmailutils/cli/cli.c: Include gitinfo.h
(mu_version_hook): Rewrite.
* mh/mh_getopt.c: Include gitinfo.h
(mh_version_hook): Rewrite.
* mu-aux/gitinfo.pl: New file.
* mu-aux/Makefile.am (EXTRA_DIST): Add gitinfo.pl
* mu/Makefile.am (mu-setup.c): Add dependency
* testsuite/testsuite.inc (MUT_VERSION): Account for changes in
version output.
1 parent 1da223b0
/config.rpath
*.a
*.cflow
*.la
......
......@@ -120,9 +120,8 @@ SUBDIRS = . \
$(MOVEMAIL_DIR)\
$(MIMEVIEW_DIR)
EXTRA_DIST = COPYING.LESSER paths git-describe git-describe.h
BUILT_SOURCES = git-describe git-describe.h
DISTCLEANFILES = pathdefs.h git-describe.h
EXTRA_DIST = COPYING.LESSER paths
DISTCLEANFILES = pathdefs.h
gen_start_date = "2008-12-08"
prev_change_log = "doc/ChangeLog.CVS"
......@@ -155,20 +154,7 @@ ChangeLog:
mv cl-t ChangeLog; \
fi
.PHONY: git-describe
git-describe:
$(AM_V_GEN)if test -d .git; then \
dirty=`git diff-index --name-only HEAD 2>/dev/null` || dirty=;\
test -n "$$dirty" && dirty="-dirty"; \
descr=`git describe`; \
echo $${descr}$$dirty > git-describe.tmp; \
test -f git-describe && \
cmp git-describe.tmp git-describe >/dev/null || \
cp git-describe.tmp git-describe; \
rm git-describe.tmp; \
fi
dist-hook: ChangeLog git-describe
dist-hook: ChangeLog
@PATCHLEV=`echo "$(PACKAGE_VERSION)" | \
sed -r "s/[0-9]+\.[0-9]+\.?//"`; \
if test $${PATCHLEV:-0} -lt 50; then \
......@@ -178,30 +164,20 @@ dist-hook: ChangeLog git-describe
fi; \
fi
git-describe.h: git-describe
$(AM_V_GEN)if test -f $(srcdir)/git-describe; then \
sed '1s/.*/#define GIT_DESCRIBE "&"/' $(srcdir)/git-describe; \
else \
echo "/* No git tag */"; \
fi > git-describe.h.tmp; \
test -f git-describe.h && \
cmp git-describe.h.tmp git-describe.h >/dev/null || \
cp git-describe.h.tmp git-describe.h; \
rm git-describe.h.tmp
alpha: git-describe
$(AM_V_GEN)if test -f $(srcdir)/git-describe; then \
tag=`head -n 1 $(srcdir)/git-describe`; \
alpha:
version=`$(GITINFO) -H'$$refversion{?$$n>0??-$$n?}'`;\
if test -n "$$version"; then\
$(MAKE) dist distdir=$(PACKAGE)-$$version; \
else \
tag=`date +"%Y%m%d"`; \
fi; \
$(MAKE) dist distdir=$(PACKAGE)-$(VERSION)-$$tag
$(MAKE) dist; \
fi
alphacheck:
$(AM_V_GEN)if test -f $(srcdir)/git-describe; then \
tag=`head -n 1 $(srcdir)/git-describe`; \
version=`$(GITINFO) -H'$$refversion{?$$n>0??-$$n?}'`;\
if test -n "$$version"; then\
$(MAKE) distcheck distdir=$(PACKAGE)-$$version; \
else \
tag=`date +"%Y%m%d"`; \
fi; \
$(MAKE) distcheck distdir=$(PACKAGE)-$(VERSION)-$$tag
$(MAKE) distcheck; \
fi
......
......@@ -1370,6 +1370,12 @@ CPPFLAGS="$CPPFLAGS -DSYSCONFDIR=\\\"\$(sysconfdir)\\\""
# Doc hints.
IMPRIMATUR_INIT([doc/imprimatur])
AC_PATH_PROG([PERL], perl)
if test -z "$PERL"; then
PERL=false
fi
AC_SUBST([GITINFO],'$(PERL) $(mu_aux_dir)/gitinfo.pl')
AC_CONFIG_COMMANDS([status],[
cat <<EOF
......
......@@ -15,7 +15,7 @@
## You should have received a copy of the GNU General Public License
## along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
BUILT_SOURCES=errno.h types.h
BUILT_SOURCES=errno.h types.h gitinfo.h
EXTRA_DIST=errno.hin types.hin
errno.h: $(top_srcdir)/libmailutils/diag/errors errno.hin
$(AM_V_GEN)$(AWK) -f $(mu_aux_dir)/generr.awk $(top_srcdir)/libmailutils/diag/errors errno.hin > errno.h
......@@ -24,7 +24,15 @@ types.h: $(top_srcdir)/include/mailutils/types.hin Makefile
$(AM_V_GEN)sed -e 's/_MU_OFF_TYPE_/$(MU_OFF_TYPE)/' \
-e 's/_MU_DEFAULT_RECORD_/$(MU_DEFAULT_RECORD)/' \
-e 's/_MU_PRI_OFF_T_/$(MU_PRI_OFF_T)/' \
$(top_srcdir)/include/mailutils/types.hin > $@
$(top_srcdir)/include/mailutils/types.hin > types.h
gitinfo.h: $(top_srcdir)/ChangeLog
$(AM_V_GEN)if ! $(GITINFO) -Hc -ogitinfo.h \
&& test ! -f $(srcdir)/gitinfo.h; then \
echo '/* no info */' > gitinfo.h;\
fi
DISTCLEANFILES = types.h
pkginclude_HEADERS = \
......@@ -51,6 +59,7 @@ pkginclude_HEADERS = \
error.h\
filter.h\
folder.h\
gitinfo.h\
glob.h\
gsasl.h\
guile.h\
......
......@@ -33,6 +33,7 @@
#include <mailutils/io.h>
#include <mailutils/syslog.h>
#include <mailutils/mu_auth.h>
#include <mailutils/gitinfo.h>
#define MU_LEGACY_CONFIG_FILE SYSCONFDIR "/mailutils.rc"
......@@ -59,10 +60,11 @@ const char mu_version_copyright[] =
void
mu_version_hook (struct mu_parseopt *po, mu_stream_t stream)
{
#ifdef GIT_DESCRIBE
mu_stream_printf (stream, "%s (%s) %s [%s]\n",
#if MU_GIT_COMMIT_DISTANCE > 0
mu_stream_printf (stream, "%s (%s) %s-%d [%s]\n",
mu_program_name, PACKAGE_NAME, PACKAGE_VERSION,
GIT_DESCRIBE);
MU_GIT_COMMIT_DISTANCE,
MU_GIT_DESCRIBE_STRING);
#else
mu_stream_printf (stream, "%s (%s) %s\n", mu_program_name,
PACKAGE_NAME, PACKAGE_VERSION);
......
......@@ -27,6 +27,7 @@
#include <mailutils/wordsplit.h>
#include <mailutils/io.h>
#include <mailutils/cli.h>
#include <mailutils/gitinfo.h>
struct getopt_data
{
......@@ -144,12 +145,13 @@ static struct mu_option folder_option[] = {
void
mh_version_hook (struct mu_parseopt *po, mu_stream_t stream)
{
#ifdef GIT_DESCRIBE
mu_stream_printf (stream, "%s (%s %s) [%s]\n",
#if MU_GIT_COMMIT_DISTANCE > 0
mu_stream_printf (stream, "%s (%s) %s-%d [%s]\n",
mu_program_name, PACKAGE_NAME, PACKAGE_VERSION,
GIT_DESCRIBE);
MU_GIT_COMMIT_DISTANCE,
MU_GIT_DESCRIBE_STRING);
#else
mu_stream_printf (stream, "%s (%s %s)\n", mu_program_name,
mu_stream_printf (stream, "%s (%s) %s\n", mu_program_name,
PACKAGE_NAME, PACKAGE_VERSION);
#endif
/* TRANSLATORS: Translate "(C)" to the copyright symbol
......
......@@ -22,7 +22,8 @@ EXTRA_DIST = \
mailutils.spec.in\
texify.sed\
sqlmod.sh\
generr.awk
generr.awk\
gitinfo.pl
m4datadir = $(datadir)/aclocal
dist_m4data_DATA = mailutils.m4
......
......@@ -108,6 +108,6 @@ mu-setup.h: Makefile.am $(MODULES) $(IDLE_MODULES)
$(AM_V_GEN)$(AWK) -f $(srcdir)/mu-setup.awk -v mode=h \
$(MODULES) $(IDLE_MODULES) > mu-setup.h
mu-setup.c: Makefile.am $(MODULES)
mu-setup.c: Makefile.am $(MODULES) $(IDLE_MODULES)
$(AM_V_GEN)$(AWK) -f $(srcdir)/mu-setup.awk -v mode=c \
$(MODULES) $(IDLE_MODULES) > mu-setup.c
......
......@@ -34,19 +34,10 @@ dnl
m4_define([MUT_VERSION],[
AT_SETUP([$1 version])
AT_CHECK([$1 --version | sed '1{s/ *[\[.*\]]//;q;}' ],
AT_CHECK([$1 --version | sed ['1{s/-[0-9][0-9]* //;s/ *\[.*\]//;q;}'] ],
[0],
[$1 (AT_PACKAGE_NAME) AT_PACKAGE_VERSION
],
[],
[cat >.xfailfile <<'_EOT'
==============================================================
WARNING: Not using the proper version, *all* checks dubious...
==============================================================
_EOT
],
[rm -f $[]XFAILFILE])
])
AT_CLEANUP
])
......