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...
[simgrid.git] / 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}