A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
even more informative error message
[simgrid.git]
/
src
/
smpi
/
patch_source.sh
diff --git
a/src/smpi/patch_source.sh
b/src/smpi/patch_source.sh
index
9b43196
..
38fd745
100755
(executable)
--- a/
src/smpi/patch_source.sh
+++ b/
src/smpi/patch_source.sh
@@
-1,7
+1,16
@@
#!/bin/bash
#!/bin/bash
+
+# Copyright (c) 2011, 2014. The SimGrid Team.
+# All rights reserved.
+
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the license (GNU LGPL) which comes with this package.
+
INFILE="$1"
OUTFILE="$2"
SPFILE="replace_globals.cocci"
INFILE="$1"
OUTFILE="$2"
SPFILE="replace_globals.cocci"
-spatch -sp_file ${SPFILE} $1 -o $2.tmp >/dev/null 2>/dev/null
-./fixsrc.pl < $2.tmp > $2
-rm $2.tmp
+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}