From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2142) id 316A3384603C; Fri, 19 May 2023 13:52:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 316A3384603C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1684504375; bh=hxl9PoHEDmDboLnPbnjW227IImwgs7jJwYZwe1dtptQ=; h=To:Subject:Date:From:From; b=Xa9VrhLihEo6rIqFq4ydsihoCbhv11HV76kefiXQVFlJE8ow2VrEN6gpp7HBeFgAI cum83qV8evJgXxgY1kE0gsx8OpZEBakOFmClhUCVUPx8yLggF3eDx0km/qscloeQrh TYqCEoDBmSjQT1hufVFZw38VqlBIv/Bma65m6B/0= To: gcc-cvs-wwwdocs@gcc.gnu.org Subject: gcc-wwwdocs branch master updated. 38ca21a31d68e73189d602c5cfafea6becd7f27b X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 7a18a9b9dc329dfa6640f6584b0ea8ae33b0a653 X-Git-Newrev: 38ca21a31d68e73189d602c5cfafea6becd7f27b Message-Id: <20230519135255.316A3384603C@sourceware.org> Date: Fri, 19 May 2023 13:52:55 +0000 (GMT) From: Gerald Pfeifer List-Id: 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 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