This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: wwwdocs/bin/preprocess


[ This slept in my postponed folder for two days, after I committed the
  patch on Friday. ]

Add a new command-line option -v (verbose) and make the default less
verbose.  Improve some comments.

Installed and tested on the whole tree on gcc.gnu.org.

Gerald

Index: preprocess
===================================================================
RCS file: /cvs/gcc/wwwdocs/bin/preprocess,v
retrieving revision 1.35
diff -u -3 -p -r1.35 preprocess
--- preprocess	6 Nov 2002 20:31:12 -0000	1.35
+++ preprocess	15 Nov 2002 18:49:12 -0000
@@ -9,21 +9,24 @@
 # $STYLE. HTML files in the destination tree are overwritten if and only if
 # the new version is different from the old version modulo lines containing
 # the string indicated by $IGNORE_DIFF_MARKER.
-# The environment variable PREPROCESS_FILE is always set to the name
-# of the HTML file (relative to the document root) which is currently
-# preprocessed and can be accessed by MetaHTML commands.
+#
+# When processing HTML files, the environment variable PREPROCESS_FILE
+# is set to the name of the current file (relative to the document root)
+# and can be accessed by MetaHTML commands.
 #
 # Files called .htaccess or .htpasswd are copied if the copy in the
 # destination tree differs from the one in the source tree (or does
 # not exist).
 #
-# Binary files are just copied, and GIF files are warned about and ignored.
+# GIF files are warned about and ignored; all other files are just copied.
 #
 # Command-line options:
 #
 #  -r   Remove cruft, i.e., files and directories that exist in the
 #       target tree but not in the source tree from the former.
 #
+#  -v   Verbose output, especially concerning the -r option.
+#
 # As a special case for compatibility with existing installations, if
 # there is no command-line parameter at all, we assume -r.
 #
@@ -58,7 +61,9 @@ remove_cruft() {
     for f in `find . -type f` ; do
         case $f in
             ./onlinedocs/*|./benchresults/*|./testresults/*|./fom_serv/*)
-                echo "  Warning: Keeping $f";
+                if [ -n "$VERBOSE" ]; then
+                    echo "  Warning: Keeping $f";
+                fi
                 ;;
             *)
                 if [ ! -f $SOURCETREE/$f ]; then
@@ -113,7 +118,7 @@ process_file()

         # Treat the following files as "binary" and simply copy them
         # whenever they do not already exist in the destination tree
-        # or when the copies in the source and destination trees differ.
+        # or when the copies in the source and destination trees differ.
         *\.htaccess|*\.htpasswd)
             copy_if_different $f $DESTTREE/$f
             ;;
@@ -173,9 +178,10 @@ if [ $# = 0 ]; then
     REMOVE_CRUFT=true
 fi

-while getopts "r" ARG; do
+while getopts "rv" ARG; do
     case $ARG in
         r)    REMOVE_CRUFT=true;;
+        v)    VERBOSE=true;;
         \?)   echo "Invalid command-line option"; exit 1;;
     esac
 done
@@ -212,6 +218,7 @@ else
 fi

 if [ -n "$REMOVE_CRUFT" ]; then
+    echo "Removing obsolete files in $DESTTREE."
     remove_cruft
 fi




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]