From: Thomas Roessler Date: Tue, 6 Nov 2001 19:12:29 +0000 (+0000) Subject: Add and document a new mechanism for displaying patches in running X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0a6ded263e667ef87c31b2d406d964a108622e44;p=neomutt Add and document a new mechanism for displaying patches in running mutts' output. --- diff --git a/Makefile.am b/Makefile.am index 16c6ee345..96ab586d2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,7 +13,7 @@ SUBDIRS = m4 po intl doc contrib $(IMAP_SUBDIR) bin_SCRIPTS = muttbug flea -BUILT_SOURCES = keymap_defs.h +BUILT_SOURCES = keymap_defs.h patches.h bin_PROGRAMS = mutt @DOTLOCK_TARGET@ @PGPAUX_TARGET@ mutt_SOURCES = $(BUILT_SOURCES) \ @@ -79,7 +79,7 @@ EXTRA_DIST = COPYRIGHT GPL OPS OPS.PGP TODO configure acconfig.h account.h \ _regex.h OPS.MIX README.SECURITY remailer.c remailer.h browser.h \ mbyte.h lib.h extlib.c pgpewrap.c pgplib.h Muttrc.head Muttrc \ makedoc.c stamp-doc-rc README.SSL \ - muttbug pgppacket.h depcomp ascii.h BEWARE + muttbug pgppacket.h depcomp ascii.h BEWARE PATCHES mutt_dotlock_SOURCES = mutt_dotlock.c mutt_dotlock_LDADD = @LIBOBJS@ @@ -93,7 +93,7 @@ mutt_dotlock.c: dotlock.c cp $(srcdir)/dotlock.c mutt_dotlock.c CLEANFILES = mutt_dotlock.c stamp-doc-rc makedoc \ - keymap_alldefs.h keymap_defs.h + keymap_alldefs.h keymap_defs.h patches.h ACLOCAL_AMFLAGS = -I m4 @@ -116,6 +116,9 @@ keymap_alldefs.h: $(srcdir)/OPS $(srcdir)/OPS.PGP $(srcdir)/OPS.MIX $(srcdir)/ge reldate: echo 'const char *ReleaseDate = "'`date +%Y-%m-%d`'";' > $(srcdir)/reldate.h +patches.h: $(srcdir)/PATCHES + echo "const char *Patches = \"`tr '\n' '+' < $< | sed -e 's/\+$$//'`\";" > $@ + install-exec-local: if test -f $(DESTDIR)$(bindir)/mutt.dotlock && test -f $(DESTDIR)$(bindir)/mutt_dotlock ; then \ rm -f $(DESTDIR)$(bindir)/mutt.dotlock ; \ diff --git a/PATCHES b/PATCHES new file mode 100644 index 000000000..9daeafb98 --- /dev/null +++ b/PATCHES @@ -0,0 +1 @@ +test diff --git a/configure.in b/configure.in index 4bd59e5a9..91e0ec5c7 100644 --- a/configure.in +++ b/configure.in @@ -9,8 +9,10 @@ AM_CONFIG_HEADER(config.h) mutt_cv_version=`cat $srcdir/VERSION` + AM_INIT_AUTOMAKE(mutt, $mutt_cv_version) + ALL_LINGUAS="de ru it es uk fr pl nl cs id sk ko el zh_TW zh_CN pt_BR eo gl sv da lt tr ja hu et" AC_CANONICAL_HOST diff --git a/doc/Makefile.in b/doc/Makefile.in index 590f4a1dd..a8f22c0bf 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -50,10 +50,11 @@ DISTFILES = Makefile.in dotlock.man \ manual.html \ stamp-doc-sgml \ stamp-doc-man \ - instdoc.sh.in + instdoc.sh.in \ + patch-notes.txt srcdir_DOCFILES = PGP-Notes.txt applying-patches.txt \ - devel-notes.txt + devel-notes.txt patch-notes.txt topsrcdir_DOCFILES = COPYRIGHT GPL INSTALL ChangeLog \ diff --git a/doc/patch-notes.txt b/doc/patch-notes.txt new file mode 100644 index 000000000..cbcf0b23e --- /dev/null +++ b/doc/patch-notes.txt @@ -0,0 +1,38 @@ +Date: Tue, 6 Nov 2001 20:10:13 +0100 +From: Thomas Roessler +To: mutt-dev@mutt.org +Subject: To those shipping patches +Mail-Followup-To: mutt-dev@mutt.org + +We've repeatedly had bug reports in the recent past where it was +hard to see whether or not the problematic version of mutt had, say, +the compressed folders patch or the NNTP patch applied. + +From 1.3.23.2 on, I'll include the following mechanism to add a +patch identifier to mutt's version ID: There's a new file called +.PATCHES in the source tree, which will be _empty_ in the official +distribution. + +This file's format is one patch ID per line. Patch IDs should be +short, and follow the format ".". An +example would be "vvv.nntp" for Vsevolod's NNTP patch, or +"rr.compress" for Roland Rosenfeld's compressed folder patch. + +In order to properly construct this file, please include the +following chunk with your patch, replacing by your +patch ID. + +------------------------------snip------------------------------ +--- PATCHES~ Tue Nov 6 19:59:33 2001 ++++ PATCHES Tue Nov 6 19:59:42 2001 +@@ -1,0 +1 @@ ++ +------------------------------snip------------------------------ + +The patch IDs will be used to construct mutt's version number as +displayed when mutt is run with the 'v' command line switch, and as +displayed on the User-Agent header. + +-- +Thomas Roessler http://log.does-not-exist.org/ + diff --git a/main.c b/main.c index 684cded69..8ddd934a3 100644 --- a/main.c +++ b/main.c @@ -24,7 +24,6 @@ #include "keymap.h" #include "mailbox.h" #include "url.h" -#include "reldate.h" #include #include @@ -83,7 +82,8 @@ void mutt_exit (int code) static void mutt_usage (void) { - printf ("Mutt %s (%s)\n", MUTT_VERSION, ReleaseDate); + puts (mutt_make_version ()); + puts _( "usage: mutt [ -nRyzZ ] [ -e ] [ -F ] [ -m ] [ -f ]\n\ mutt [ -nx ] [ -e ] [ -a ] [ -F ] [ -H ] [ -i ] [ -s ] [ -b ] [ -c ] [ ... ]\n\ @@ -118,7 +118,7 @@ static void show_version (void) { struct utsname uts; - printf ("Mutt %s (%s)\n", MUTT_VERSION, ReleaseDate); + puts (mutt_make_version()); puts (_(Notice)); uname (&uts); @@ -583,7 +583,7 @@ int main (int argc, char **argv) show_version (); break; default: - printf ("Mutt %s (%s)\n", MUTT_VERSION, ReleaseDate); + puts (mutt_make_version ()); puts (_(Copyright)); puts (_(ReachingUs)); exit (0); diff --git a/muttlib.c b/muttlib.c index a77c6c127..3db704051 100644 --- a/muttlib.c +++ b/muttlib.c @@ -24,6 +24,9 @@ #include "mx.h" #include "url.h" +#include "reldate.h" +#include "patches.h" + #ifdef USE_IMAP #include "imap.h" #endif @@ -1284,3 +1287,17 @@ time_t mutt_decrease_mtime (const char *f, struct stat *st) return mtime; } + +const char *mutt_make_version (void) +{ + static char vstring[STRING]; + const char *p = mutt_make_patches (); + snprintf (vstring, sizeof (vstring), "Mutt %s%s%s (%s)", + MUTT_VERSION, *p ? "+" : "", p, ReleaseDate); + return vstring; +} + +const char *mutt_make_patches (void) +{ + return Patches; +} diff --git a/protos.h b/protos.h index 273594fca..629c57fff 100644 --- a/protos.h +++ b/protos.h @@ -139,6 +139,9 @@ char *mutt_pgp_hook (ADDRESS *); #endif /* HAVE_PGP */ char *mutt_make_date (char *, size_t); +const char *mutt_make_version (void); +const char *mutt_make_patches (void); + const char *mutt_fqdn(short); void mutt_account_hook (const char* url); diff --git a/sendlib.c b/sendlib.c index 862cd80e1..6ae6f5cb6 100644 --- a/sendlib.c +++ b/sendlib.c @@ -29,6 +29,7 @@ #include "pager.h" #include "charset.h" + #include #include #include @@ -1660,8 +1661,10 @@ int mutt_write_rfc822_header (FILE *fp, ENVELOPE *env, BODY *attach, if (mode == 0 && !privacy && option (OPTXMAILER)) { + const char *p = mutt_make_patches (); /* Add a vanity header */ - fprintf (fp, "User-Agent: Mutt/%s\n", MUTT_VERSION); + fprintf (fp, "User-Agent: Mutt/%s%s%s\n", MUTT_VERSION, *p ? "+" : "", + p); } /* Add any user defined headers */