Rocco Rutte:
authorpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Wed, 24 Aug 2005 11:39:27 +0000 (11:39 +0000)
committerpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Wed, 24 Aug 2005 11:39:27 +0000 (11:39 +0000)
- try to fix version generation for SVN vs. non-SVN once more

git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@436 e385b8ad-14ed-0310-8656-cc95a2468c6d

Makefile.am
VERSION.date [new file with mode: 0644]
do-commit.sh [new file with mode: 0755]
muttlib.c
sendlib.c

index 2a90349..5087f3d 100644 (file)
@@ -23,7 +23,7 @@ SUBDIRS = m4 po intl doc contrib lib $(IMAP_SUBDIR) $(POP_SUBDIR) $(NNTP_SUBDIR)
 
 bin_SCRIPTS = muttngbug fleang
 
-BUILT_SOURCES = keymap_defs.h patchlist.c svnrev.h
+BUILT_SOURCES = keymap_defs.h patchlist.c version.h
 
 bin_PROGRAMS = muttng @DOTLOCK_TARGET@ @PGPAUX_TARGET@ @SMIMEAUX_TARGET@
 muttng_SOURCES = $(BUILT_SOURCES) \
@@ -126,7 +126,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 patchlist.c svnrev.h
+       keymap_alldefs.h keymap_defs.h patchlist.c version.h
 
 ACLOCAL_AMFLAGS = -I m4
 
@@ -152,11 +152,12 @@ keymap_alldefs.h: $(srcdir)/OPS $(srcdir)/OPS.PGP $(srcdir)/OPS.MIX $(srcdir)/OP
                $(srcdir)/OPS.MIX $(srcdir)/OPS.CRYPT $(srcdir)/OPS.SMIME \
                        > keymap_alldefs.h
 
-svnrev.h:
+version.h:
+       echo "#undef MUTT_VERSION" > version.h
        if test -f "$(srcdir)/.svn/entries" ; then \
-         echo "#define MUTTNG_SVNREV \"r`grep revision $(srcdir)/.svn/entries | sort -r | uniq | head -n 1 | cut -d '"' -f 2`\"" > svnrev.h ; \
+         echo "#define MUTT_VERSION \"`cat $(srcdir)/VERSION.in`-r`grep revision $(srcdir)/.svn/entries | sort -r | uniq | head -n 1 | cut -d '"' -f 2`\"" >> version.h ; \
        else \
-         echo "#define MUTTNG_SVNREV \"`date "+%Y%m%d"`\"" > svnrev.h ; \
+         echo "#define MUTT_VERSION \"`cat $(srcdir)/VERSION.in`-`cat $(srcdir)/VERSION.date`\"" >> version.h ; \
        fi
 
 reldate:
diff --git a/VERSION.date b/VERSION.date
new file mode 100644 (file)
index 0000000..283880d
--- /dev/null
@@ -0,0 +1 @@
+20050824
diff --git a/do-commit.sh b/do-commit.sh
new file mode 100755 (executable)
index 0000000..795ce32
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+date "+%Y%m%d" > ./VERSION.date
+svn commit "$@"
index b55dfda..4efa41b 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
@@ -23,7 +23,7 @@
 #include "attach.h"
 
 #include "reldate.h"
-#include "svnrev.h"
+#include "version.h"
 
 #ifdef USE_IMAP
 #include "imap.h"
@@ -1290,12 +1290,10 @@ const char *mutt_make_version (int full)
   static char vstring[STRING];
 
   if (full)
-    snprintf (vstring, sizeof (vstring), "Mutt-ng %s-%s (based "
-              "on Mutt 1.5.10/%s)", MUTT_VERSION, MUTTNG_SVNREV,
-              ReleaseDate);
+    snprintf (vstring, sizeof (vstring), "Mutt-ng %s (based "
+              "on Mutt 1.5.10/%s)", MUTT_VERSION, ReleaseDate);
   else
-    snprintf (vstring, sizeof (vstring), "mutt-ng/%s-%s",
-              MUTT_VERSION, MUTTNG_SVNREV);
+    snprintf (vstring, sizeof (vstring), "mutt-ng/%s", MUTT_VERSION);
   return vstring;
 }
 
index b3f08b8..450f543 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
@@ -27,7 +27,6 @@
 #include "charset.h"
 #include "mutt_crypt.h"
 #include "mutt_idna.h"
-#include "svnrev.h"
 
 #include "lib/mem.h"
 #include "lib/str.h"