[pushed] wwwdocs: preprocess: Abstract hard-coded /www/gcc/bin/preprocess-html.py

Message ID 20250201160514.8948E33E8A@hamza.pair.com
State New
Headers
Series [pushed] wwwdocs: preprocess: Abstract hard-coded /www/gcc/bin/preprocess-html.py |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 fail Patch failed to apply
linaro-tcwg-bot/tcwg_gcc_build--master-arm fail Patch failed to apply

Commit Message

Gerald Pfeifer Feb. 1, 2025, 4:05 p.m. UTC
  A little abstraction/cleanup after I hardcoded this as a small tweak when 
committing David's original script.

Pushed.

Gerald


Introduce a new variable PREPROCESSHTML that as an added bonus can
be overriden from the environment.
---
 bin/preprocess | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
  

Patch

diff --git a/bin/preprocess b/bin/preprocess
index 8bb65934..adced1f0 100755
--- a/bin/preprocess
+++ b/bin/preprocess
@@ -34,6 +34,7 @@ 
 # By Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> 1999-12-29.
 
 MHC=${MHC-/usr/local/bin/mhc}
+PREPROCESSHTML=${PREPROCESSHTML-/www/gcc/bin/preprocess-html.py}
 
 SOURCETREE=${SOURCETREE-/www/gcc/htdocs-preformatted}
 DESTTREE=${DESTTREE-/www/gcc/htdocs}
@@ -121,8 +122,8 @@  process_html_file()
 
     # Run output.raw through a Python script, then overwrite it with the
     # output from the script.
-    if ! python3 /www/gcc/bin/preprocess-html.py $TMPDIR/output.raw $TMPDIR/output.after-py; then
-        echo "preprocess-html.py failed; aborting."
+    if ! python3 $PREPROCESSHTML $TMPDIR/output.raw $TMPDIR/output.after-py; then
+        echo "$(basename $PREPROCESSHTML) failed; aborting."
         exit 1
     fi
     mv $TMPDIR/output.after-py $TMPDIR/output.raw