Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
In the end use a temporary file (for those systems where patch cannot output to stdou...
authorpini <pini@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 18 Jan 2011 14:52:51 +0000 (14:52 +0000)
committerpini <pini@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 18 Jan 2011 14:52:51 +0000 (14:52 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9438 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/smpi/patch_source.sh

index 6587641..fa085bb 100755 (executable)
@@ -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}