blob: 3459dd91c9ec1d13913002deef927aad306bcbf3 [file] [log] [blame]
Chris Bieneman7f47b852017-07-25 20:30:58 +00001#!/bin/sh
2# Usage: framework-header-fix.sh <source header dir> <LLDB Version>
Dave Lee3d2de272018-11-04 15:55:28 +00003
4set -e
5
Chris Bieneman7f47b852017-07-25 20:30:58 +00006for file in `find $1 -name "*.h"`
7do
Dave Lee3d2de272018-11-04 15:55:28 +00008 /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 Bieneman7f47b852017-07-25 20:30:58 +000010 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 Lee3d2de272018-11-04 15:55:28 +000013 /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 Meenai1a890fc2018-08-28 23:47:22 +000016 rm -f "$file.bak"
Chris Bieneman7f47b852017-07-25 20:30:58 +000017done