diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2019-01-19 10:06:29 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2019-01-19 10:06:29 +0000 | 
| commit | 94994d372d014ce4c8758b9605d63fae651bd8aa (patch) | |
| tree | 51c0b708bd59f205d6b35cb2a8c24d62f0c33d77 /scripts/framework-header-fix.sh | |
| parent | 39be7ce23363d12ae3e49aeb1fdb2bfeb892e836 (diff) | |
Notes
Diffstat (limited to 'scripts/framework-header-fix.sh')
| -rwxr-xr-x | scripts/framework-header-fix.sh | 14 | 
1 files changed, 9 insertions, 5 deletions
diff --git a/scripts/framework-header-fix.sh b/scripts/framework-header-fix.sh index c09d1458ff827..3459dd91c9ec1 100755 --- a/scripts/framework-header-fix.sh +++ b/scripts/framework-header-fix.sh @@ -1,13 +1,17 @@  #!/bin/sh  # Usage: framework-header-fix.sh <source header dir> <LLDB Version> + +set -e +  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" +  /usr/bin/sed -i.bak 's/\(#include\)[ ]*"lldb\/\(API\/\)\{0,1\}\(.*\)"/\1 <LLDB\/\3>/1' "$file" +  /usr/bin/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" +  /usr/bin/sed -i.bak "s|//#define LLDB_VERSION$|#define LLDB_VERSION $LLDB_VERSION |" "$file" +  /usr/bin/sed -i.bak "s|//#define LLDB_REVISION|#define LLDB_REVISION $LLDB_REVISION |" "$file" +  /usr/bin/sed -i.bak "s|//#define LLDB_VERSION_STRING|#define LLDB_VERSION_STRING \"$LLDB_VERSION_STRING\" |" "$file" +  rm -f "$file.bak"  done  | 
