From: Brendan Cully Date: Sun, 18 May 2008 00:36:05 +0000 (-0700) Subject: Build local md5 tool for hcachever.sh. Closes #3025. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=27a1b5eb57b710744d7e85b5dae6ace097eee359;p=mutt Build local md5 tool for hcachever.sh. Closes #3025. --- diff --git a/.hgignore b/.hgignore index 8a33fcc2..e5f3e25c 100644 --- 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$ diff --git a/ChangeLog b/ChangeLog index 5f590b59..788b03d4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,15 @@ -2008-05-17 12:31 -0700 Brendan Cully (fa4990c5b5c6) +2008-05-17 12:39 -0700 Brendan Cully (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. diff --git a/Makefile.am b/Makefile.am index 68ee596e..d4db79b6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/configure.ac b/configure.ac index 01696769..b61d6daa 100644 --- a/configure.ac +++ b/configure.ac @@ -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) diff --git a/hcachever.sh.in b/hcachever.sh.in index 4137f8a7..730ca76b 100755 --- a/hcachever.sh.in +++ b/hcachever.sh.in @@ -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 87db8f95..60ef57a2 100644 --- 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