From ebf3eacafeb1948af546bfb75436e99d7260270f Mon Sep 17 00:00:00 2001
From: Tri Vo <trong@google.com>
Date: Wed, 19 Dec 2018 12:22:05 -0800
Subject: [PATCH] sepolicy: fix mac build

sed "-i" flag on Mac has different syntax than on Linux. Replace use of
sed with grep.

A simple fix like this should suffice for this case, but ideally, we
should maintain our own utils instead of using tools on the host
machine.

Fixes: 121235932
Test: m selinux_policy
Change-Id: I46c3bdb90bf7de48d2c942b15a65ce82ae3041c5
---
 Android.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Android.mk b/Android.mk
index 83afdbdf2..0abbabe9b 100644
--- a/Android.mk
+++ b/Android.mk
@@ -514,7 +514,8 @@ $(HOST_OUT_EXECUTABLES)/build_sepolicy $(HOST_OUT_EXECUTABLES)/secilc $(built_pl
 		-f $(PRIVATE_PLAT_CIL) -t $@
 	# Line markers (denoted by ;;) are malformed after above cmd. They are only
 	# used for debugging, so we remove them.
-	$(hide) sed -i '/;;/d' $@
+	$(hide) grep -v ';;' $@ > $@.tmp
+	$(hide) mv $@.tmp $@
 	# Combine plat_sepolicy.cil and product_sepolicy.cil to make sure that the
 	# latter doesn't accidentally depend on vendor/odm policies.
 	$(hide) $(HOST_OUT_EXECUTABLES)/secilc -m -M true -G -c $(POLICYVERS) \
-- 
GitLab