summaryrefslogtreecommitdiffstats
path: root/rfc.sh
diff options
context:
space:
mode:
authorEmmanuel Dreyfus <manu@netbsd.org>2011-08-12 06:43:07 +0200
committerAnand Avati <avati@gluster.com>2011-08-11 23:43:55 -0700
commitcc756d0075ff9829700cfc74d1bf3e2080523f65 (patch)
tree095f69953e864ef94ced6b392f0628def4c2988b /rfc.sh
parentb4d166be42acd65d083a6e839f96989746b0ef46 (diff)
sed -i is available from GNU sed, but is not portable. Output to a new
file and move it to the original one on success instead. Change-Id: Ib23dd9becd035054e6490dcb4d64b3f9eff89bf4 Reviewed-on: http://review.gluster.com/212 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
Diffstat (limited to 'rfc.sh')
-rwxr-xr-xrfc.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/rfc.sh b/rfc.sh
index 2a5e779c12c..1ee6d042d75 100755
--- a/rfc.sh
+++ b/rfc.sh
@@ -40,7 +40,7 @@ function rebase_changes()
function editor_mode()
{
if [ $(basename "$1") = "git-rebase-todo" ]; then
- sed -i 's/^pick /reword /g' "$1";
+ sed 's/^pick /reword /g' "$1" > $1.new && mv $1.new $1;
return;
fi
@@ -60,7 +60,8 @@ function editor_mode()
continue;
fi
- sed -i "s/^\(Change-Id: .*\)$/\1\nBUG: $bug/g" $1;
+ sed -i "s/^\(Change-Id: .*\)$/\1\nBUG: $bug/g" $1 > $1.new && \
+ mv $i.new $i
return;
done
fi