]> granicus.if.org Git - mutt/commitdiff
Build local md5 tool for hcachever.sh. Closes #3025.
authorBrendan Cully <brendan@kublai.com>
Sun, 18 May 2008 00:36:05 +0000 (17:36 -0700)
committerBrendan Cully <brendan@kublai.com>
Sun, 18 May 2008 00:36:05 +0000 (17:36 -0700)
.hgignore
ChangeLog
Makefile.am
configure.ac
hcachever.sh.in
md5.c

index 8a33fcc2280adcb60d91b4acaeaaa4c4a23064e6..e5f3e25c0d680db4075e918d3fd1efc46bb97738 100644 (file)
--- a/.hgignore
+++ b/.hgignore
@@ -1,6 +1,7 @@
 # autoconf products
 ^aclocal\.m4$
 ^autom4te\.cache
+^compile$
 ^(contrib/|doc/|imap/|m4/|po/)?Makefile\.in$
 ^config\.h(\.in~?)?$
 ^config\.(log|status)$
@@ -24,6 +25,7 @@
 ^doc/makedoc$
 ^mutt$
 ^mutt_dotlock(\.c)?$
+^mutt_md5$
 ^patchlist\.c$
 ^pgpewrap|pgpring$
 ^reldate\.h$
index 5f590b592c2626dc5bcd5ea6335d59355683ba47..788b03d4ef5c3ef9c33e0eecad39e7ef56e8d9dd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,15 @@
-2008-05-17 12:31 -0700  Brendan Cully  <brendan@kublai.com>  (fa4990c5b5c6)
+2008-05-17 12:39 -0700  Brendan Cully  <brendan@kublai.com>  (692b7c063bf1)
+
+       * .hgsigs: mutt-1.5.18 signed
+
+       * .hgtags: Added tag mutt-1-5-18-rel for changeset ff9e4d0464b1
+
+       * ChangeLog, VERSION, po/bg.po, po/ca.po, po/cs.po, po/da.po,
+       po/de.po, po/el.po, po/eo.po, po/es.po, po/et.po, po/eu.po,
+       po/fr.po, po/ga.po, po/gl.po, po/hu.po, po/id.po, po/it.po,
+       po/ja.po, po/ko.po, po/lt.po, po/nl.po, po/pl.po, po/pt_BR.po,
+       po/ru.po, po/sk.po, po/sv.po, po/tr.po, po/uk.po, po/zh_CN.po,
+       po/zh_TW.po: automatic post-release commit for mutt-1.5.18
 
        * UPDATING: Update UPDATING.
 
index 68ee596ec89ca03331f268a0b4f6fde3c31c90f2..d4db79b6ebd63a973c6d3c0a8b90212313c0ea47 100644 (file)
@@ -2,7 +2,7 @@
 ## Use aclocal -I m4; automake --foreign
 
 AUTOMAKE_OPTIONS = 1.6 foreign
-EXTRA_PROGRAMS = mutt_dotlock pgpring pgpewrap
+EXTRA_PROGRAMS = mutt_dotlock pgpring pgpewrap mutt_md5
 
 if BUILD_IMAP
 IMAP_SUBDIR = imap
@@ -81,6 +81,11 @@ pgpring_SOURCES = pgppubring.c pgplib.c lib.c extlib.c sha1.c md5.c pgppacket.c
 pgpring_LDADD = @LIBOBJS@ $(INTLLIBS) 
 pgpring_DEPENDENCIES = @LIBOBJS@ $(INTLDEPS)
 
+mutt_md5_SOURCES = md5.c
+mutt_md5_CFLAGS = -DMD5UTIL
+
+noinst_PROGRAMS = $(MUTT_MD5)
+
 mutt_dotlock.c: dotlock.c
        cp $(srcdir)/dotlock.c mutt_dotlock.c
 
index 01696769ae2f3ee9b95b65a0fec6ab66b3ce9d19..b61d6daaedd74f1c84d55210a9e667dce3626e61 100644 (file)
@@ -825,9 +825,6 @@ then
 
     need_md5="yes"
 
-    dnl hcachever.sh tool for calculating struct digest
-    AC_CHECK_PROGS([MD5], [md5 md5sum openssl], [none])
-
     dnl -- QDBM --
     if test "$with_qdbm" != "no"
     then
@@ -952,7 +949,9 @@ dnl -- end cache --
 if test "$need_md5" = "yes"
 then
   MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS md5.o"
+  MUTT_MD5="mutt_md5"
 fi
+AC_SUBST(MUTT_MD5)
 
 AC_SUBST(MUTTLIBS)
 AC_SUBST(MUTT_LIB_OBJECTS)
index 4137f8a79598e8d5d5cd13c284781f4461eb6c59..730ca76b8cbd597c30bb6b858360eececb6ac3cd 100755 (executable)
@@ -2,16 +2,6 @@
 
 BASEVERSION=2
 
-MD5=@MD5@
-if test "$MD5" = "openssl"
-then
-  MD5="openssl md5 -hex"
-elif test "$MD5" = "none"
-then
-  echo "ERROR: no MD5 tool found"
-  exit 1
-fi
-
 cleanstruct () {
   echo "$1" | sed -e 's/} *//' -e 's/;$//'
 }
@@ -91,7 +81,7 @@ do
 done
 echo " */" >> $TMPD
 
-MD5TEXT=`echo "$TEXT" | $MD5`
+MD5TEXT=`echo "$TEXT" | ./mutt_md5`
 echo "#define HCACHEVER 0x"`echo $MD5TEXT | cut -c-8` >> $TMPD
 
 # TODO: validate we have all structs
diff --git a/md5.c b/md5.c
index 87db8f956c6f8fa9d6722d81a1dbfee96d542217..60ef57a2c710570c981be1b4a466c6a071aca7ec 100644 (file)
--- a/md5.c
+++ b/md5.c
@@ -450,3 +450,22 @@ md5_process_block (const void *buffer, size_t len, struct md5_ctx *ctx)
   ctx->C = C;
   ctx->D = D;
 }
+
+#ifdef MD5UTIL
+/* local md5 equivalent for header cache versioning */
+int main(int argc, char** argv)
+{
+  unsigned char r[16];
+  int rc;
+
+  if ((rc = md5_stream(stdin, r)))
+    return rc;
+
+  printf("%02x%02x%02x%02x%02x%02x%02x%02x"
+         "%02x%02x%02x%02x%02x%02x%02x%02x\n",
+         r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7],
+         r[8], r[9], r[10], r[11], r[12], r[13], r[14], r[15]);
+
+  return 0;
+}
+#endif