Patchwork maintainer-scripts/update_web_docs_libstdcxx_svn: add error detection

login
register
mail settings
Submitter Gerald Pfeifer
Date April 5, 2013, 8:44 p.m.
Message ID <alpine.LNX.2.00.1304050141150.2247@trevally.site>
Download mbox | patch
Permalink /patch/234282/
State New
Headers show

Comments

Gerald Pfeifer - April 5, 2013, 8:44 p.m.
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.
Gerald Pfeifer - April 7, 2013, 7:55 p.m.
On Fri, 5 Apr 2013, Gerald Pfeifer wrote:
> 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.

I committed this now, after it has been active on gcc.gnu.org for a few 
days.  Looks good so far (cf. http://gcc.gnu.org/ml/gccadmin/2013-q2/ ).

Gerald

Patch

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