Chris Bieneman | 7f47b85 | 2017-07-25 20:30:58 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # Usage: framework-header-fix.sh <source header dir> <LLDB Version> |
Dave Lee | 3d2de27 | 2018-11-04 15:55:28 +0000 | [diff] [blame] | 3 | |
| 4 | set -e |
| 5 | |
Chris Bieneman | 7f47b85 | 2017-07-25 20:30:58 +0000 | [diff] [blame] | 6 | for file in `find $1 -name "*.h"` |
| 7 | do |
Dave Lee | 3d2de27 | 2018-11-04 15:55:28 +0000 | [diff] [blame] | 8 | /usr/bin/sed -i.bak 's/\(#include\)[ ]*"lldb\/\(API\/\)\{0,1\}\(.*\)"/\1 <LLDB\/\3>/1' "$file" |
| 9 | /usr/bin/sed -i.bak 's|<LLDB/Utility|<LLDB|' "$file" |
Chris Bieneman | 7f47b85 | 2017-07-25 20:30:58 +0000 | [diff] [blame] | 10 | LLDB_VERSION=`echo $2 | /usr/bin/sed -E 's/^([0-9]+).([0-9]+).([0-9]+)(.[0-9]+)?$/\\1/g'` |
| 11 | LLDB_REVISION=`echo $2 | /usr/bin/sed -E 's/^([0-9]+).([0-9]+).([0-9]+)(.[0-9]+)?$/\\3/g'` |
| 12 | LLDB_VERSION_STRING=`echo $2` |
Dave Lee | 3d2de27 | 2018-11-04 15:55:28 +0000 | [diff] [blame] | 13 | /usr/bin/sed -i.bak "s|//#define LLDB_VERSION$|#define LLDB_VERSION $LLDB_VERSION |" "$file" |
| 14 | /usr/bin/sed -i.bak "s|//#define LLDB_REVISION|#define LLDB_REVISION $LLDB_REVISION |" "$file" |
| 15 | /usr/bin/sed -i.bak "s|//#define LLDB_VERSION_STRING|#define LLDB_VERSION_STRING \"$LLDB_VERSION_STRING\" |" "$file" |
Shoaib Meenai | 1a890fc | 2018-08-28 23:47:22 +0000 | [diff] [blame] | 16 | rm -f "$file.bak" |
Chris Bieneman | 7f47b85 | 2017-07-25 20:30:58 +0000 | [diff] [blame] | 17 | done |