This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
maintainer-scripts/update_web_docs_libstdcxx_svn: add error detection
- From: Gerald Pfeifer <gerald at pfeifer dot com>
- To: gcc-patches at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org, Benjamin De Kosnik <bkoz at redhat dot com>, Jonathan Wakely <jwakely dot gcc at gmail dot com>
- Date: Fri, 5 Apr 2013 22:44:21 +0200 (CEST)
- Subject: maintainer-scripts/update_web_docs_libstdcxx_svn: add error detection
So, I was debugging why the nightly run of this script did not actually
every update anything. As part of that I manually ran the script on
gcc.gnu.org.
Let's say the output was not particularly helpful. ;-)
This patch addresses that and does not simply ignore _all_ output any
more, plus it explicitly issues an error message if there was any problem.
http://gcc.gnu.org/ml/gccadmin/2013-q2/msg00004.html shows exemplary
output.
I have not committed this yet, but plan on doing that unless there are
any objections. Thoughts?
Gerald
2013-04-05 Gerald Pfeifer <gerald@pfeifer.com>
* update_web_docs_libstdcxx_svn: No longer ignore all output from
the actual copy process.
Check the exit code of the actual copy process; diagnose problems.
Index: update_web_docs_libstdcxx_svn
===================================================================
--- update_web_docs_libstdcxx_svn (revision 197262)
+++ update_web_docs_libstdcxx_svn (working copy)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# "sh update_web_docs_libstdcxx.sh"
@@ -39,8 +39,13 @@
# copy the tree to the onlinedocs area, preserve directory structure
#find . -depth -print | cpio -pdv $WWWDIR
-find . -depth -print | cpio -pd $WWWDIR > /dev/null 2>&1
+find . -depth -print | cpio -pd $WWWDIR 2>&1 | grep -v "newer or same age version exists"
+err=${PIPESTATUS[1]}
+if [ $err -gt 0 ]; then
+ printf "\nCopying failed with error code %d.\n" $err
+fi
+
cd /
/bin/rm -rf $WORKDIR