On Fri, 23 May 2025, Richard Biener wrote:

> The following makes update_web_docs_git work on branches without
> libgdiagnostic.
> 
> I'm re-running update_web_docs_git with this, OK if it succeeds now?

One more bit, the find command also fails.

OK?
Richard.

>From 97b55be8f9bb5d822371e463dff3bbe64e1fe6f9 Mon Sep 17 00:00:00 2001
From: Richard Biener <rguent...@suse.de>
Date: Fri, 23 May 2025 13:32:47 +0200
Subject: [PATCH] Conditionalize libgdiagnostic processing on presence
To: gcc-patches@gcc.gnu.org

The following makes update_web_docs_git work on branches without
libgdiagnostic.

maintainer_scripts/
        * update_web_docs_git: Conditionalize libgdiagnostic processing
        on presence.
---
 maintainer-scripts/update_web_docs_git | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/maintainer-scripts/update_web_docs_git 
b/maintainer-scripts/update_web_docs_git
index 424808847b6..00334ddac7d 100755
--- a/maintainer-scripts/update_web_docs_git
+++ b/maintainer-scripts/update_web_docs_git
@@ -242,11 +242,15 @@ popd
 cp -a gcc/gcc/jit/docs/_build/html jit
 mkdir -p $DOCSDIR/jit
 
-pushd gcc/gcc/doc/libgdiagnostics
-make html SPHINXBUILD=$SPHINX_VENV/bin/sphinx-build || true
-popd
-cp -a gcc/gcc/doc/libgdiagnostics/_build/html libgdiagnostics
-mkdir -p $DOCSDIR/libgdiagnostics
+LIBGDIAGNOSTICS=
+if test -d gcc/gcc/doc/libgdiagnostics; then
+  pushd gcc/gcc/doc/libgdiagnostics
+  make html SPHINXBUILD=$SPHINX_VENV/bin/sphinx-build || true
+  popd
+  cp -a gcc/gcc/doc/libgdiagnostics/_build/html libgdiagnostics
+  mkdir -p $DOCSDIR/libgdiagnostics
+  LIBGDIAGNOSTICS=libgdiagnostics
+fi
 
 # Work around makeinfo generated file names and references with
 # "_002d" instead of "-".
@@ -298,7 +302,7 @@ done
 # below them, and with some non-HTML files (.png images from us,
 # plus .css and .js supplied by sphinx, and source files, renamed
 # from .rst to .txt).
-find jit libgdiagnostics \
+find jit $LIBGDIAGNOSTICS \
     -name "*.html" -o -name "*.png" \
     -o -name "*.css" -o -name "*.js" \
     -o -name "*.txt" |
-- 
2.43.0

Reply via email to