Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
handle pending asynchronous requests on finalize (should be harmless in
[simgrid.git] / src / smpi / patch_source.sh
index 6587641..89e981b 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 ${OUTFILE}.XXXX`
+
+trap "rm -f ${TMPFILE}" EXIT
+spatch -sp_file ${SPFILE} ${INFILE} -o ${TMPFILE} >/dev/null 2>/dev/null
+./fixsrc.pl < ${TMPFILE} > ${OUTFILE}