]> granicus.if.org Git - neomutt/commitdiff
Add and document a new mechanism for displaying patches in running
authorThomas Roessler <roessler@does-not-exist.org>
Tue, 6 Nov 2001 19:12:29 +0000 (19:12 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Tue, 6 Nov 2001 19:12:29 +0000 (19:12 +0000)
mutts' output.

Makefile.am
PATCHES [new file with mode: 0644]
configure.in
doc/Makefile.in
doc/patch-notes.txt [new file with mode: 0644]
main.c
muttlib.c
protos.h
sendlib.c

index 16c6ee345bda7913d12587fb943609c02ea1a69e..96ab586d2f2f5aecf9906498d95ac6cb28239193 100644 (file)
@@ -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 (file)
index 0000000..9daeafb
--- /dev/null
+++ b/PATCHES
@@ -0,0 +1 @@
+test
index 4bd59e5a9c707932904e0b5b19790fbc51c25ccc..91e0ec5c793f5a3f53c35c234943fdbe7b96f9aa 100644 (file)
@@ -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
index 590f4a1dd669d6ddf368a5e313e0b0202d11d4e6..a8f22c0bf4f1dc0beef6d25e8f0e5f5f588e8b21 100644 (file)
@@ -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 (file)
index 0000000..cbcf0b2
--- /dev/null
@@ -0,0 +1,38 @@
+Date: Tue, 6 Nov 2001 20:10:13 +0100
+From: Thomas Roessler <roessler@does-not-exist.org>
+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 "<initials>.<patch-description>". 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 <your-id-here> by your 
+patch ID.
+
+------------------------------snip------------------------------
+--- PATCHES~    Tue Nov  6 19:59:33 2001
++++ PATCHES     Tue Nov  6 19:59:42 2001
+@@ -1,0 +1 @@
++<your-id-here>
+------------------------------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 684cded699a8c379ac319185f00ea647908e175e..8ddd934a348c54cf7475e99bafcd6f7c47e35a6c 100644 (file)
--- a/main.c
+++ b/main.c
@@ -24,7 +24,6 @@
 #include "keymap.h"
 #include "mailbox.h"
 #include "url.h"
-#include "reldate.h"
 
 #include <string.h>
 #include <stdlib.h>
@@ -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 <cmd> ] [ -F <file> ] [ -m <type> ] [ -f <file> ]\n\
        mutt [ -nx ] [ -e <cmd> ] [ -a <file> ] [ -F <file> ] [ -H <file> ] [ -i <file> ] [ -s <subj> ] [ -b <addr> ] [ -c <addr> ] <addr> [ ... ]\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);
index a77c6c127a4f825bb95fe04362cb9a6540487352..3db7040516e8722c6f082e04f6aa3728a484f343 100644 (file)
--- 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;
+}
index 273594fca4b72fd5a4347e21543235916541e270..629c57fff24808bfdd9d06ae457d06d7230dd35c 100644 (file)
--- 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);
index 862cd80e1fa780060e8448613ebd1f82c48de4fe..6ae6f5cb61afa7fca13ea191d02b48aeb72e56f4 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
@@ -29,6 +29,7 @@
 #include "pager.h"
 #include "charset.h"
 
+
 #include <string.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -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 */