[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Temp file to avoid the "svn: Write error: Broken pipe" error messages

From: Aldo Castillo <acastillo_at_quipudigital.com>
Date: Sun, 27 Mar 2011 20:34:41 -0700 (PDT)

Try using a temp file to store log output

http://code.quipudigital.net/get-svn-head-revision-number.php
http://code.quipudigital.net/get-svn-head-revision-number.php

Vincent Lefevre-11 wrote:
>
> Since http://subversion.tigris.org/issues/show_bug.cgi?id=3014
> ("svn log | head" should not print "Write error: Broken pipe")
> isn't fixed yet, I've eventually written a simple wrapper. See
> attachment. It's not perfect, but better than nothing.
>
> Note: for those who use localized messages, the script needs to
> be modified accordingly.
>
> --
> Vincent Lefèvre <vincent@vinc17.net> - Web: <http://www.vinc17.net/>
> 100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
> Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)
>
> #!/bin/sh
>
> # svn wrapper to avoid "svn: Write error: Broken pipe" error messages
> # when piping the svn output to some command.
> #
> # Caveat: if svn fails, its exit status is lost. However this script
> # will generally be used in an interactive way before a pipe (where
> # the user doesn't have a direct access to the exit status), and the
> # user can still look at the possible other error messages.
> #
> # Script written by Vincent Lefevre <vincent_at_vinc17.net> in July 2010,
> # released in the public domain.
>
> filter()
> {
> unset brpipe
> while read err
> do
> case "$err" in
> *Write\ error:\ Broken\ pipe) brpipe=1 ;;
> *) printf "%s\n" "$err" ;;
> esac
> done
> test -z "$brpipe" || kill -PIPE $$
> }
>
> { svn "$@" 2>&1 >&3 3>&- | filter >&2 3>&-; } 3>&1
>
> # $Id: svnwrapper 38281 2010-07-30 13:34:46Z vinc17/ypig $
>
>

-- 
View this message in context: http://old.nabble.com/Avoiding-the-%22svn%3A-Write-error%3A-Broken-pipe%22-error-messages-tp29306886p31253585.html
Sent from the Subversion Users mailing list archive at Nabble.com.
Received on 2011-03-28 05:35:19 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.