From: Thomas Roessler Date: Wed, 7 Nov 2001 10:51:29 +0000 (+0000) Subject: Implement the patchlist scheme instead of version number munging. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=29506c7acc06835be826b24b658c9e70f65fc3bc;p=neomutt Implement the patchlist scheme instead of version number munging. --- diff --git a/Makefile.am b/Makefile.am index 96ab586d2..6cc0d4bbe 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 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 \ diff --git a/doc/patch-notes.txt b/doc/patch-notes.txt index 6856e4a91..d4ceb0361 100644 --- a/doc/patch-notes.txt +++ b/doc/patch-notes.txt @@ -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 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 ".". 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 by your -patch ID. + patch-... + +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 by your patch ID. ------------------------------snip------------------------------ --- PATCHES~ Tue Nov 6 19:59:33 2001 @@ -29,9 +38,8 @@ patch ID. + ------------------------------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 8ddd934a3..1bd9fc05c 100644 --- 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); } diff --git a/muttlib.c b/muttlib.c index 3db704051..a5cc61d78 100644 --- 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 index 000000000..9cefc141b --- /dev/null +++ b/patchlist.sh @@ -0,0 +1,18 @@ +#!/bin/sh -- + +cat < +#include + +#include "mutt.h" + +void mutt_print_patchlist (void) +{ +EOF + +while read patch ; do + echo " puts (\"${patch}\");" +done + +echo "}" diff --git a/protos.h b/protos.h index 629c57fff..361dc82b9 100644 --- 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); diff --git a/sendlib.c b/sendlib.c index 6ae6f5cb6..3569b4649 100644 --- 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 */