]> granicus.if.org Git - neomutt/commitdiff
fix hcachever.sh script
authorRichard Russon <rich@flatcap.org>
Tue, 11 Jul 2017 13:33:48 +0000 (14:33 +0100)
committerRichard Russon <rich@flatcap.org>
Fri, 14 Jul 2017 11:54:57 +0000 (12:54 +0100)
This script stopped working when all the structs were renamed
(and lots of the moved out of mutt.h)

hcache/Makefile.am
hcache/hcachever.sh

index 8d0c95840eda18ebdc2d241df3fce4891becedab..b53952a95ab156aeaba21b8364a35babcb0913aa 100644 (file)
@@ -44,7 +44,14 @@ BUILT_SOURCES = $(HCVERSION)
 $(top_srcdir)/keymap_defs.h:
        +$(MAKE) -C $(top_srcdir) keymap_defs.h
 
-hcversion.h: $(top_srcdir)/mutt.h $(top_srcdir)/rfc822.h $(srcdir)/hcachever.sh ../$(MUTT_MD5)
-       ( echo '#include "config.h"'; echo '#include "mutt.h"'; ) \
-       | $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) - | sh $(srcdir)/hcachever.sh hcversion.h
+hcversion.h: $(top_srcdir)/mutt.h $(top_srcdir)/address.h $(top_srcdir)/list.h \
+               $(top_srcdir)/buffer.h $(top_srcdir)/parameter.h \
+               $(top_srcdir)/body.h $(top_srcdir)/envelope.h \
+               $(top_srcdir)/header.h $(srcdir)/hcachever.sh ../$(MUTT_MD5)
+       ( echo '#include "config.h"'; echo '#include "mutt.h"'; \
+       echo '#include "address.h"'; echo '#include "list.h"'; \
+       echo '#include "buffer.h"'; echo '#include "parameter.h"'; \
+       echo '#include "body.h"'; echo '#include "envelope.h"'; \
+       echo '#include "header.h"'; \
+       ) | $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) - | sh $(srcdir)/hcachever.sh hcversion.h
 
index 2eb88d08202d23e806c041430e6125bb35234534..733e6ca16d4d542d64fbc4565e976c0af61646f7 100755 (executable)
@@ -3,7 +3,7 @@
 BASEVERSION=2
 
 cleanstruct () {
-  echo "$1" | sed -e 's/} *//' -e 's/;$//'
+  echo "$1" | sed -e 's/.* //'
 }
 
 cleanbody () {
@@ -19,6 +19,8 @@ getstruct () {
     *';') return ;;
   esac
 
+  STRUCT=`cleanstruct "$1"`
+
   while read line
   do
     if test $inbody -eq 0
@@ -30,13 +32,7 @@ getstruct () {
     fi
 
     case "$line" in
-      '} '*)
-        STRUCT=`cleanstruct "$line"`
-        break
-      ;;
-      '}')
-        read line
-        STRUCT=`cleanstruct "$line"`
+      '};'*)
         break
       ;;
       '#'*) continue ;;
@@ -50,7 +46,7 @@ getstruct () {
   done
 
   case $STRUCT in
-    ADDRESS|LIST|BUFFER|PARAMETER|BODY|ENVELOPE|HEADER)
+    Address|List|Buffer|Parameter|Body|Envelope|Header)
       BODY=`cleanbody "$BODY"`
       echo "$STRUCT: $BODY"
     ;;
@@ -67,7 +63,7 @@ echo "/* base version: $BASEVERSION" > $TMPD
 while read line
 do
   case "$line" in
-    'typedef struct'*)
+    'struct'*)
        STRUCT=`getstruct "$line"`
        if test -n "$STRUCT"
        then