From: pini Date: Tue, 18 Jan 2011 14:52:51 +0000 (+0000) Subject: In the end use a temporary file (for those systems where patch cannot output to stdou... X-Git-Tag: v3.6_beta2~490 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/f82b0adea2eacaca7f393e2d072af3e622c1604a In the end use a temporary file (for those systems where patch cannot output to stdout), but trap its removal upon exit. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9438 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/smpi/patch_source.sh b/src/smpi/patch_source.sh index 6587641044..fa085bbd5f 100755 --- a/src/smpi/patch_source.sh +++ b/src/smpi/patch_source.sh @@ -2,4 +2,8 @@ INFILE="$1" OUTFILE="$2" SPFILE="replace_globals.cocci" -spatch -sp_file ${SPFILE} ${INFILE} 2>/dev/null | patch -o - | ./fixsrc.pl > ${OUTFILE} +TMPFILE=`mktemp` + +trap "rm -f ${TMPFILE}" EXIT +spatch -sp_file ${SPFILE} ${INFILE} -o ${TMPFILE} >/dev/null 2>/dev/null +./fixsrc.pl < ${TMPFILE} > ${OUTFILE}