public inbox for gcc-cvs-wwwdocs@sourceware.org
help / color / mirror / Atom feed
* gcc-wwwdocs branch master updated. 38ca21a31d68e73189d602c5cfafea6becd7f27b
@ 2023-05-19 13:52 Gerald Pfeifer
  0 siblings, 0 replies; only message in thread
From: Gerald Pfeifer @ 2023-05-19 13:52 UTC (permalink / raw)
  To: gcc-cvs-wwwdocs

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gcc-wwwdocs".

The branch, master has been updated
       via  38ca21a31d68e73189d602c5cfafea6becd7f27b (commit)
      from  7a18a9b9dc329dfa6640f6584b0ea8ae33b0a653 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 38ca21a31d68e73189d602c5cfafea6becd7f27b
Author: Gerald Pfeifer <gerald@pfeifer.com>
Date:   Fri May 19 15:10:55 2023 +0200

    preprocess: Check whether input files exist
    
    This has not come up in all those years since the preprocess script
    usually is invoked from other scripts, notably post commit hooks. It
    can, however, be invoked manually, and error handling is generally a
    good thing.
    
    Instead of
       cat: foo/bar/index.html: No such file or directory
       New file /www/gcc/htdocs/foo/bar/index.html
    and an empty output file, we now get
       Input file foo/bar/index.html not found.
    when invoking `preprocess foo/bar/index.html`.

diff --git a/bin/preprocess b/bin/preprocess
index c62ba457..c6d34c4b 100755
--- a/bin/preprocess
+++ b/bin/preprocess
@@ -155,6 +155,11 @@ process_file()
     # Strip possibly leading "./".
     f=`echo $1 | sed -e 's#^\./##'`
 
+    if [ ! -f "$SRCTREE/$f" ]; then
+        echo "Input file $f not found."
+        return
+    fi
+
     if [ ! -d "$DESTTREE/`dirname $f`" ]; then
         echo "Creating new directory `dirname $f`."
         mkdir -p $DESTTREE/`dirname $f`

-----------------------------------------------------------------------

Summary of changes:
 bin/preprocess | 5 +++++
 1 file changed, 5 insertions(+)


hooks/post-receive
-- 
gcc-wwwdocs

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-05-19 13:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-19 13:52 gcc-wwwdocs branch master updated. 38ca21a31d68e73189d602c5cfafea6becd7f27b Gerald Pfeifer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).