[Lldb-commits] [PATCH] D51374: [LLDB] Fix script to work with GNU sed

Shoaib Meenai via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Aug 28 16:48:24 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB340885: [LLDB] Fix script to work with GNU sed (authored by smeenai, committed by ).
Herald added a subscriber: abidh.

Changed prior to commit:
  https://reviews.llvm.org/D51374?vs=162928&id=162988#toc

Repository:
  rLLDB LLDB

https://reviews.llvm.org/D51374

Files:
  scripts/framework-header-fix.sh


Index: scripts/framework-header-fix.sh
===================================================================
--- scripts/framework-header-fix.sh
+++ scripts/framework-header-fix.sh
@@ -2,12 +2,13 @@
 # Usage: framework-header-fix.sh <source header dir> <LLDB Version>
 for file in `find $1 -name "*.h"`
 do
-  sed -i '' 's/\(#include\)[ ]*"lldb\/\(API\/\)\{0,1\}\(.*\)"/\1 <LLDB\/\3>/1' "$file"
-  sed -i '' 's|<LLDB/Utility|<LLDB|' "$file"
+  sed -i.bak 's/\(#include\)[ ]*"lldb\/\(API\/\)\{0,1\}\(.*\)"/\1 <LLDB\/\3>/1' "$file"
+  sed -i.bak 's|<LLDB/Utility|<LLDB|' "$file"
   LLDB_VERSION=`echo $2 | /usr/bin/sed -E 's/^([0-9]+).([0-9]+).([0-9]+)(.[0-9]+)?$/\\1/g'`
   LLDB_REVISION=`echo $2 | /usr/bin/sed -E 's/^([0-9]+).([0-9]+).([0-9]+)(.[0-9]+)?$/\\3/g'`
   LLDB_VERSION_STRING=`echo $2`
-  sed -i '' "s|//#define LLDB_VERSION$|#define LLDB_VERSION $LLDB_VERSION |" "$file"
-  sed -i '' "s|//#define LLDB_REVISION|#define LLDB_REVISION $LLDB_REVISION |" "$file"
-  sed -i '' "s|//#define LLDB_VERSION_STRING|#define LLDB_VERSION_STRING \"$LLDB_VERSION_STRING\" |" "$file"
+  sed -i.bak "s|//#define LLDB_VERSION$|#define LLDB_VERSION $LLDB_VERSION |" "$file"
+  sed -i.bak "s|//#define LLDB_REVISION|#define LLDB_REVISION $LLDB_REVISION |" "$file"
+  sed -i.bak "s|//#define LLDB_VERSION_STRING|#define LLDB_VERSION_STRING \"$LLDB_VERSION_STRING\" |" "$file"
+  rm -f "$file.bak"
 done


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51374.162988.patch
Type: text/x-patch
Size: 1393 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20180828/a002be42/attachment.bin>


More information about the lldb-commits mailing list