diff mbox

[wwwdocs] Harden bin/preprocess a bit

Message ID alpine.LNX.2.00.1009120459040.17560@acrux.dbai.tuwien.ac.at
State New
Headers show

Commit Message

Gerald Pfeifer Sept. 12, 2010, 3:07 a.m. UTC
I ran into this while testing something locally, and while this is 
not a current issue on gcc.gnu.org, adding a check like this seems
like a generally good idea.

Installed, and updated the copy on gcc.gnu.org, too.

Gerald


Sanity check the mhc tool upon startup.
diff mbox

Patch

Index: preprocess
===================================================================
RCS file: /cvs/gcc/wwwdocs/bin/preprocess,v
retrieving revision 1.46
retrieving revision 1.48
diff -u -3 -p -r1.46 -r1.48
--- preprocess	30 Mar 2008 19:31:39 -0000	1.46
+++ preprocess	12 Sep 2010 03:05:44 -0000	1.48
@@ -193,7 +193,7 @@  process_file()
 ########
 # Main: This is where executions starts.
 
-## First of all,  process command-line options. As a special case for
+## First of all, process command-line options. As a special case for
 #  compatibility with existing installations, if there is no command-line
 #  parameter at all, we assume -r.
 
@@ -212,6 +212,11 @@  shift `expr ${OPTIND} - 1`
 
 ## Various safety checks.
 
+if ! ${MHC} --version >/dev/null; then
+    echo "Something does not look right with \"${MHC}\"; aborting."
+    exit 1
+fi
+
 if [ ! -d $SOURCETREE ]; then
     echo "Source tree \"$SOURCETREE\" does not exist."
     exit 1