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
1 /config.rpath
1 *.a 2 *.a
2 *.cflow 3 *.cflow
3 *.la 4 *.la
......
...@@ -120,9 +120,8 @@ SUBDIRS = . \ ...@@ -120,9 +120,8 @@ SUBDIRS = . \
120 $(MOVEMAIL_DIR)\ 120 $(MOVEMAIL_DIR)\
121 $(MIMEVIEW_DIR) 121 $(MIMEVIEW_DIR)
122 122
123 EXTRA_DIST = COPYING.LESSER paths git-describe git-describe.h 123 EXTRA_DIST = COPYING.LESSER paths
124 BUILT_SOURCES = git-describe git-describe.h 124 DISTCLEANFILES = pathdefs.h
125 DISTCLEANFILES = pathdefs.h git-describe.h
126 125
127 gen_start_date = "2008-12-08" 126 gen_start_date = "2008-12-08"
128 prev_change_log = "doc/ChangeLog.CVS" 127 prev_change_log = "doc/ChangeLog.CVS"
...@@ -155,20 +154,7 @@ ChangeLog: ...@@ -155,20 +154,7 @@ ChangeLog:
155 mv cl-t ChangeLog; \ 154 mv cl-t ChangeLog; \
156 fi 155 fi
157 156
158 .PHONY: git-describe 157 dist-hook: ChangeLog
159 git-describe:
160 $(AM_V_GEN)if test -d .git; then \
161 dirty=`git diff-index --name-only HEAD 2>/dev/null` || dirty=;\
162 test -n "$$dirty" && dirty="-dirty"; \
163 descr=`git describe`; \
164 echo $${descr}$$dirty > git-describe.tmp; \
165 test -f git-describe && \
166 cmp git-describe.tmp git-describe >/dev/null || \
167 cp git-describe.tmp git-describe; \
168 rm git-describe.tmp; \
169 fi
170
171 dist-hook: ChangeLog git-describe
172 @PATCHLEV=`echo "$(PACKAGE_VERSION)" | \ 158 @PATCHLEV=`echo "$(PACKAGE_VERSION)" | \
173 sed -r "s/[0-9]+\.[0-9]+\.?//"`; \ 159 sed -r "s/[0-9]+\.[0-9]+\.?//"`; \
174 if test $${PATCHLEV:-0} -lt 50; then \ 160 if test $${PATCHLEV:-0} -lt 50; then \
...@@ -178,30 +164,20 @@ dist-hook: ChangeLog git-describe ...@@ -178,30 +164,20 @@ dist-hook: ChangeLog git-describe
178 fi; \ 164 fi; \
179 fi 165 fi
180 166
181 git-describe.h: git-describe 167 alpha:
182 $(AM_V_GEN)if test -f $(srcdir)/git-describe; then \ 168 version=`$(GITINFO) -H'$$refversion{?$$n>0??-$$n?}'`;\
183 sed '1s/.*/#define GIT_DESCRIBE "&"/' $(srcdir)/git-describe; \ 169 if test -n "$$version"; then\
184 else \ 170 $(MAKE) dist distdir=$(PACKAGE)-$$version; \
185 echo "/* No git tag */"; \
186 fi > git-describe.h.tmp; \
187 test -f git-describe.h && \
188 cmp git-describe.h.tmp git-describe.h >/dev/null || \
189 cp git-describe.h.tmp git-describe.h; \
190 rm git-describe.h.tmp
191
192 alpha: git-describe
193 $(AM_V_GEN)if test -f $(srcdir)/git-describe; then \
194 tag=`head -n 1 $(srcdir)/git-describe`; \
195 else \ 171 else \
196 tag=`date +"%Y%m%d"`; \ 172 $(MAKE) dist; \
197 fi; \ 173 fi
198 $(MAKE) dist distdir=$(PACKAGE)-$(VERSION)-$$tag 174
199 175
200 alphacheck: 176 alphacheck:
201 $(AM_V_GEN)if test -f $(srcdir)/git-describe; then \ 177 version=`$(GITINFO) -H'$$refversion{?$$n>0??-$$n?}'`;\
202 tag=`head -n 1 $(srcdir)/git-describe`; \ 178 if test -n "$$version"; then\
179 $(MAKE) distcheck distdir=$(PACKAGE)-$$version; \
203 else \ 180 else \
204 tag=`date +"%Y%m%d"`; \ 181 $(MAKE) distcheck; \
205 fi; \ 182 fi
206 $(MAKE) distcheck distdir=$(PACKAGE)-$(VERSION)-$$tag
207 183
......
...@@ -1370,6 +1370,12 @@ CPPFLAGS="$CPPFLAGS -DSYSCONFDIR=\\\"\$(sysconfdir)\\\"" ...@@ -1370,6 +1370,12 @@ CPPFLAGS="$CPPFLAGS -DSYSCONFDIR=\\\"\$(sysconfdir)\\\""
1370 # Doc hints. 1370 # Doc hints.
1371 IMPRIMATUR_INIT([doc/imprimatur]) 1371 IMPRIMATUR_INIT([doc/imprimatur])
1372 1372
1373 AC_PATH_PROG([PERL], perl)
1374 if test -z "$PERL"; then
1375 PERL=false
1376 fi
1377 AC_SUBST([GITINFO],'$(PERL) $(mu_aux_dir)/gitinfo.pl')
1378
1373 AC_CONFIG_COMMANDS([status],[ 1379 AC_CONFIG_COMMANDS([status],[
1374 cat <<EOF 1380 cat <<EOF
1375 1381
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
15 ## You should have received a copy of the GNU General Public License 15 ## You should have received a copy of the GNU General Public License
16 ## along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>. 16 ## along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
17 17
18 BUILT_SOURCES=errno.h types.h 18 BUILT_SOURCES=errno.h types.h gitinfo.h
19 EXTRA_DIST=errno.hin types.hin 19 EXTRA_DIST=errno.hin types.hin
20 errno.h: $(top_srcdir)/libmailutils/diag/errors errno.hin 20 errno.h: $(top_srcdir)/libmailutils/diag/errors errno.hin
21 $(AM_V_GEN)$(AWK) -f $(mu_aux_dir)/generr.awk $(top_srcdir)/libmailutils/diag/errors errno.hin > errno.h 21 $(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 ...@@ -24,7 +24,15 @@ types.h: $(top_srcdir)/include/mailutils/types.hin Makefile
24 $(AM_V_GEN)sed -e 's/_MU_OFF_TYPE_/$(MU_OFF_TYPE)/' \ 24 $(AM_V_GEN)sed -e 's/_MU_OFF_TYPE_/$(MU_OFF_TYPE)/' \
25 -e 's/_MU_DEFAULT_RECORD_/$(MU_DEFAULT_RECORD)/' \ 25 -e 's/_MU_DEFAULT_RECORD_/$(MU_DEFAULT_RECORD)/' \
26 -e 's/_MU_PRI_OFF_T_/$(MU_PRI_OFF_T)/' \ 26 -e 's/_MU_PRI_OFF_T_/$(MU_PRI_OFF_T)/' \
27 $(top_srcdir)/include/mailutils/types.hin > $@ 27 $(top_srcdir)/include/mailutils/types.hin > types.h
28
29 gitinfo.h: $(top_srcdir)/ChangeLog
30 $(AM_V_GEN)if ! $(GITINFO) -Hc -ogitinfo.h \
31 && test ! -f $(srcdir)/gitinfo.h; then \
32 echo '/* no info */' > gitinfo.h;\
33 fi
34
35
28 DISTCLEANFILES = types.h 36 DISTCLEANFILES = types.h
29 37
30 pkginclude_HEADERS = \ 38 pkginclude_HEADERS = \
...@@ -51,6 +59,7 @@ pkginclude_HEADERS = \ ...@@ -51,6 +59,7 @@ pkginclude_HEADERS = \
51 error.h\ 59 error.h\
52 filter.h\ 60 filter.h\
53 folder.h\ 61 folder.h\
62 gitinfo.h\
54 glob.h\ 63 glob.h\
55 gsasl.h\ 64 gsasl.h\
56 guile.h\ 65 guile.h\
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
33 #include <mailutils/io.h> 33 #include <mailutils/io.h>
34 #include <mailutils/syslog.h> 34 #include <mailutils/syslog.h>
35 #include <mailutils/mu_auth.h> 35 #include <mailutils/mu_auth.h>
36 #include <mailutils/gitinfo.h>
36 37
37 #define MU_LEGACY_CONFIG_FILE SYSCONFDIR "/mailutils.rc" 38 #define MU_LEGACY_CONFIG_FILE SYSCONFDIR "/mailutils.rc"
38 39
...@@ -59,10 +60,11 @@ const char mu_version_copyright[] = ...@@ -59,10 +60,11 @@ const char mu_version_copyright[] =
59 void 60 void
60 mu_version_hook (struct mu_parseopt *po, mu_stream_t stream) 61 mu_version_hook (struct mu_parseopt *po, mu_stream_t stream)
61 { 62 {
62 #ifdef GIT_DESCRIBE 63 #if MU_GIT_COMMIT_DISTANCE > 0
63 mu_stream_printf (stream, "%s (%s) %s [%s]\n", 64 mu_stream_printf (stream, "%s (%s) %s-%d [%s]\n",
64 mu_program_name, PACKAGE_NAME, PACKAGE_VERSION, 65 mu_program_name, PACKAGE_NAME, PACKAGE_VERSION,
65 GIT_DESCRIBE); 66 MU_GIT_COMMIT_DISTANCE,
67 MU_GIT_DESCRIBE_STRING);
66 #else 68 #else
67 mu_stream_printf (stream, "%s (%s) %s\n", mu_program_name, 69 mu_stream_printf (stream, "%s (%s) %s\n", mu_program_name,
68 PACKAGE_NAME, PACKAGE_VERSION); 70 PACKAGE_NAME, PACKAGE_VERSION);
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
27 #include <mailutils/wordsplit.h> 27 #include <mailutils/wordsplit.h>
28 #include <mailutils/io.h> 28 #include <mailutils/io.h>
29 #include <mailutils/cli.h> 29 #include <mailutils/cli.h>
30 #include <mailutils/gitinfo.h>
30 31
31 struct getopt_data 32 struct getopt_data
32 { 33 {
...@@ -144,12 +145,13 @@ static struct mu_option folder_option[] = { ...@@ -144,12 +145,13 @@ static struct mu_option folder_option[] = {
144 void 145 void
145 mh_version_hook (struct mu_parseopt *po, mu_stream_t stream) 146 mh_version_hook (struct mu_parseopt *po, mu_stream_t stream)
146 { 147 {
147 #ifdef GIT_DESCRIBE 148 #if MU_GIT_COMMIT_DISTANCE > 0
148 mu_stream_printf (stream, "%s (%s %s) [%s]\n", 149 mu_stream_printf (stream, "%s (%s) %s-%d [%s]\n",
149 mu_program_name, PACKAGE_NAME, PACKAGE_VERSION, 150 mu_program_name, PACKAGE_NAME, PACKAGE_VERSION,
150 GIT_DESCRIBE); 151 MU_GIT_COMMIT_DISTANCE,
152 MU_GIT_DESCRIBE_STRING);
151 #else 153 #else
152 mu_stream_printf (stream, "%s (%s %s)\n", mu_program_name, 154 mu_stream_printf (stream, "%s (%s) %s\n", mu_program_name,
153 PACKAGE_NAME, PACKAGE_VERSION); 155 PACKAGE_NAME, PACKAGE_VERSION);
154 #endif 156 #endif
155 /* TRANSLATORS: Translate "(C)" to the copyright symbol 157 /* TRANSLATORS: Translate "(C)" to the copyright symbol
......
...@@ -22,7 +22,8 @@ EXTRA_DIST = \ ...@@ -22,7 +22,8 @@ EXTRA_DIST = \
22 mailutils.spec.in\ 22 mailutils.spec.in\
23 texify.sed\ 23 texify.sed\
24 sqlmod.sh\ 24 sqlmod.sh\
25 generr.awk 25 generr.awk\
26 gitinfo.pl
26 27
27 m4datadir = $(datadir)/aclocal 28 m4datadir = $(datadir)/aclocal
28 dist_m4data_DATA = mailutils.m4 29 dist_m4data_DATA = mailutils.m4
......
...@@ -108,6 +108,6 @@ mu-setup.h: Makefile.am $(MODULES) $(IDLE_MODULES) ...@@ -108,6 +108,6 @@ mu-setup.h: Makefile.am $(MODULES) $(IDLE_MODULES)
108 $(AM_V_GEN)$(AWK) -f $(srcdir)/mu-setup.awk -v mode=h \ 108 $(AM_V_GEN)$(AWK) -f $(srcdir)/mu-setup.awk -v mode=h \
109 $(MODULES) $(IDLE_MODULES) > mu-setup.h 109 $(MODULES) $(IDLE_MODULES) > mu-setup.h
110 110
111 mu-setup.c: Makefile.am $(MODULES) 111 mu-setup.c: Makefile.am $(MODULES) $(IDLE_MODULES)
112 $(AM_V_GEN)$(AWK) -f $(srcdir)/mu-setup.awk -v mode=c \ 112 $(AM_V_GEN)$(AWK) -f $(srcdir)/mu-setup.awk -v mode=c \
113 $(MODULES) $(IDLE_MODULES) > mu-setup.c 113 $(MODULES) $(IDLE_MODULES) > mu-setup.c
......
...@@ -34,19 +34,10 @@ dnl ...@@ -34,19 +34,10 @@ dnl
34 m4_define([MUT_VERSION],[ 34 m4_define([MUT_VERSION],[
35 AT_SETUP([$1 version]) 35 AT_SETUP([$1 version])
36 36
37 AT_CHECK([$1 --version | sed '1{s/ *[\[.*\]]//;q;}' ], 37 AT_CHECK([$1 --version | sed ['1{s/-[0-9][0-9]* //;s/ *\[.*\]//;q;}'] ],
38 [0], 38 [0],
39 [$1 (AT_PACKAGE_NAME) AT_PACKAGE_VERSION 39 [$1 (AT_PACKAGE_NAME) AT_PACKAGE_VERSION
40 ], 40 ])
41 [],
42 [cat >.xfailfile <<'_EOT'
43
44 ==============================================================
45 WARNING: Not using the proper version, *all* checks dubious...
46 ==============================================================
47 _EOT
48 ],
49 [rm -f $[]XFAILFILE])
50 41
51 AT_CLEANUP 42 AT_CLEANUP
52 ]) 43 ])
......