]> granicus.if.org Git - neomutt/commitdiff
Implement the patchlist scheme instead of version number munging.
authorThomas Roessler <roessler@does-not-exist.org>
Wed, 7 Nov 2001 10:51:29 +0000 (10:51 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Wed, 7 Nov 2001 10:51:29 +0000 (10:51 +0000)
Makefile.am
doc/patch-notes.txt
main.c
muttlib.c
patchlist.sh [new file with mode: 0755]
protos.h
sendlib.c

index 96ab586d2f2f5aecf9906498d95ac6cb28239193..6cc0d4bbe1a51a109de24be3aad083d9713a6842 100644 (file)
@@ -13,7 +13,7 @@ SUBDIRS = m4 po intl doc contrib $(IMAP_SUBDIR)
 
 bin_SCRIPTS = muttbug flea
 
-BUILT_SOURCES = keymap_defs.h patches.h
+BUILT_SOURCES = keymap_defs.h patchlist.c
 
 bin_PROGRAMS = mutt @DOTLOCK_TARGET@ @PGPAUX_TARGET@
 mutt_SOURCES = $(BUILT_SOURCES) \
@@ -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 patches.h
+       keymap_alldefs.h keymap_defs.h patchlist.c
 
 ACLOCAL_AMFLAGS = -I m4
 
@@ -116,8 +116,8 @@ 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/\+$$//'`\";" > $@
+patchlist.c: $(srcdir)/PATCHES $(srcdir)/patchlist.sh
+       $(srcdir)/patchlist.sh < $< > $@
 
 install-exec-local:
        if test -f $(DESTDIR)$(bindir)/mutt.dotlock && test -f $(DESTDIR)$(bindir)/mutt_dotlock ; then  \
index 6856e4a91820ccd700c9f2328b42468fa58e61b2..d4ceb0361f1b99ef9aec30dccf9e682d79bb2d72 100644 (file)
@@ -1,26 +1,35 @@
-Date: Tue, 6 Nov 2001 20:10:13 +0100
+From roessler@does-not-exist.org Wed Nov  7 11:49:56 2001
+Date: Wed, 7 Nov 2001 11:49:56 +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
+Subject: To those shipping patches (v2)
+MIME-Version: 1.0
+Content-Type: text/plain; format=flowed
+Status: RO
+Content-Length: 1273
+Lines: 34
 
-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.
+You folks have convinced me that the old patchlist was almost the 
+right way to go for mutt identifying what patches have been 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.
+Thus, I've implemented this scheme (and will commit it to the CVS 
+in a moment): 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.
+the same as the file names used for distributing patches.  The 
+format for these file names should be this: 
 
-In order to properly construct this file, please include the 
-following chunk with your patch, replacing <your-id-here> by your 
-patch ID.
+     patch-<version>.<initials>.<patch-description>.<patchlevel>
+
+That is, Vsevolod's NNTP patch for mutt-1.3.42 could be named like 
+this:
+
+     patch-1.3.42.vvv.nntp.1
+
+ From PATCHES, patchlist.c will be automatically generated.  In 
+order to properly construct PATCHES, 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
@@ -29,9 +38,8 @@ patch ID.
 +<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.
+The patch IDs will be displayed when mutt is run with the 'v' 
+command line switch.
 
 -- 
 Thomas Roessler                        http://log.does-not-exist.org/
diff --git a/main.c b/main.c
index 8ddd934a348c54cf7475e99bafcd6f7c47e35a6c..1bd9fc05ca7e4de22b2af1335d9460466cff28c7 100644 (file)
--- a/main.c
+++ b/main.c
@@ -392,9 +392,11 @@ static void show_version (void)
 #else
   puts ("-MIXMASTER");
 #endif
-  
+
   puts(_(ReachingUs));
 
+  mutt_print_patchlist();
+  
   exit (0);
 }
 
index 3db7040516e8722c6f082e04f6aa3728a484f343..a5cc61d78556d58a33ed75428cda3fe2904fb5b6 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
@@ -25,7 +25,6 @@
 #include "url.h"
 
 #include "reldate.h"
-#include "patches.h"
 
 #ifdef USE_IMAP
 #include "imap.h"
@@ -1291,13 +1290,8 @@ time_t mutt_decrease_mtime (const char *f, struct stat *st)
 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);
+  snprintf (vstring, sizeof (vstring), "Mutt %s (%s)",
+           MUTT_VERSION, ReleaseDate);
   return vstring;
 }
 
-const char *mutt_make_patches (void)
-{
-  return Patches;
-}
diff --git a/patchlist.sh b/patchlist.sh
new file mode 100755 (executable)
index 0000000..9cefc14
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/sh --
+
+cat <<EOF
+/* this is an autogenerated file.  do not edit. */
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "mutt.h"
+
+void mutt_print_patchlist (void)
+{
+EOF
+
+while read patch ; do
+       echo "  puts (\"${patch}\");"
+done
+
+echo "}"
index 629c57fff24808bfdd9d06ae457d06d7230dd35c..361dc82b9a3c544f81b1ad07c1e81ed71c7dfbd7 100644 (file)
--- a/protos.h
+++ b/protos.h
@@ -140,7 +140,6 @@ char *mutt_pgp_hook (ADDRESS *);
 char *mutt_make_date (char *, size_t);
 
 const char *mutt_make_version (void);
-const char *mutt_make_patches (void);
 
 const char *mutt_fqdn(short);
 
@@ -208,6 +207,7 @@ void mutt_pretty_mailbox (char *);
 void mutt_pretty_size (char *, size_t, long);
 void mutt_pipe_message (HEADER *);
 void mutt_print_message (HEADER *);
+void mutt_print_patchlist (void);
 void mutt_query_exit (void);
 void mutt_query_menu (char *, size_t);
 void mutt_safe_path (char *s, size_t l, ADDRESS *a);
index 6ae6f5cb61afa7fca13ea191d02b48aeb72e56f4..3569b4649103b9e339397addf4acb9d894740765 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
@@ -1661,10 +1661,8 @@ 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%s%s\n", MUTT_VERSION, *p ? "+" : "",
-            p);
+    fprintf (fp, "User-Agent: Mutt/%s\n", MUTT_VERSION);
   }
 
   /* Add any user defined headers */