From 1a890fcc72c7938f8d0e8b21f4715482de0899a9 Mon Sep 17 00:00:00 2001 From: Shoaib Meenai Date: Tue, 28 Aug 2018 23:47:22 +0000 Subject: [PATCH] [LLDB] Fix script to work with GNU sed GNU sed and BSD sed have a different command-line syntax for in-place editing, and the current form of the script would only work with BSD sed. The easiest way to get cross-platform behavior is to specify a backup suffix and then just delete the backup file at the end. (BSD sed is the default on macOS, but it's possible to acquire GNU coreutils and have your `sed` be GNU sed even on macOS; I'm aware it's not officially supported in any capacity, but it's easy enough to support here.) An alternative would be using `perl -p -i -e` instead of `sed -i`, but I figured it was best to make the minimal working change. Differential Revision: https://reviews.llvm.org/D51374 llvm-svn: 340885 --- lldb/scripts/framework-header-fix.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lldb/scripts/framework-header-fix.sh b/lldb/scripts/framework-header-fix.sh index c09d1458ff82..bb259d17561f 100755 --- a/lldb/scripts/framework-header-fix.sh +++ b/lldb/scripts/framework-header-fix.sh @@ -2,12 +2,13 @@ # Usage: framework-header-fix.sh for file in `find $1 -name "*.h"` do - sed -i '' 's/\(#include\)[ ]*"lldb\/\(API\/\)\{0,1\}\(.*\)"/\1 /1' "$file" - sed -i '' 's|/1' "$file" + sed -i.bak 's|