From Martin Mathieson
[obnox/wireshark/wip.git] / make-faq
index 357ee19d4b5effe069ccffe5c38481d5fa0077dd..a4e8d9084f6a8bcf56892b967b0e48971fb87fc6 100755 (executable)
--- a/make-faq
+++ b/make-faq
@@ -1,13 +1,9 @@
 #!/bin/sh
 #
-# $Id: make-faq,v 1.5 2003/12/21 03:06:49 jmayer Exp $
+# $Id$
 #
 # Make-faq - Creates a plain text version of the Ethereal FAQ
-#      from http://www.ethereal.com/faq
-
-# Split the FAQ every LINECOUNT lines so the strings don't become too long
-# for some compilers.
-LINECOUNT=400
+#      from http://www.ethereal.com/faq.html
 
 rm -f FAQ
 cat >FAQ <<EOF
@@ -15,38 +11,19 @@ cat >FAQ <<EOF
    The Ethereal FAQ
 
    Note: This is just an ASCII snapshot of the faq and may not be up to
-         date. Please go to http://www.ethereal.com/faq for the up to
-         date version. The version of this snapshot can be found at the
-         end of this document.
+         date. Please go to http://www.ethereal.com/faq.html for the up
+         to date version. The version of this snapshot can be found at
+         the end of this document.
 
    INDEX
 
 EOF
 
-lynx -dump -nolist "http://www.ethereal.com/faq" | sed -e '1,/INDEX/d' >>FAQ
-
-# Create an #include'able version for help/faq.h
-rm -f FAQ.include FAQTMP*
-split -l $LINECOUNT FAQ FAQTMP
-NUM=0
-echo "/* THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY!!! */" >FAQ.include
-echo "const char *faq_part[] = {" >>FAQ.include
-for i in FAQTMP*; do
-   if [ $NUM -ne 0 ]; then
-      echo "," >>FAQ.include
-      echo >>FAQ.include
-   fi
-   sed -e 's/\\/\\\\/g' -e 's/"/\\"/g' -e 's/^/"/' -e 's/$/\\n"/' <$i >>FAQ.include
-   NUM=`expr $NUM + 1`
-done
-echo "};" >>FAQ.include
-echo "#define FAQ_PARTS $NUM" >>FAQ.include
-SIZE=`wc -c FAQ | tr -d ' A-Za-z'`
-echo "#define FAQ_SIZE $SIZE" >>FAQ.include
-rm -f FAQTMP*
+lynx -dump -nolist "http://www.ethereal.com/faq.html" | sed -e '1,/^Index/d' >>FAQ
 
 echo
-echo "Now move FAQ to help/faq.txt and FAQ.include to help/faq.h"
+echo "Now verfiy everything is OK and copy FAQ to help/faq.txt"
+echo "To verify run: diff -u help/faq.txt FAQ"
 echo
 
 exit 0