From 6b0ff4756a17e7af22d283ac3599a8b1925e5827 Mon Sep 17 00:00:00 2001 From: Robert Craig <rpcraig@tycho.ncsc.mil> Date: Wed, 29 Jan 2014 13:10:58 -0500 Subject: [PATCH] Catch nonexistent BOARD_SEPOLICY_UNION policy files. Added a new check to make sure that all listed BOARD_SEPOLICY_UNION files are located somewhere in the listed BOARD_SEPOLICY_DIRS locations. The build will error out otherwise. Change-Id: Icc5febc5fe5a7cccb90ac5b83e6289c2aa5bf069 Signed-off-by: rpcraig <rpcraig@tycho.ncsc.mil> --- Android.mk | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Android.mk b/Android.mk index a3463bb01..10b3ca3d9 100644 --- a/Android.mk +++ b/Android.mk @@ -50,6 +50,15 @@ $(foreach pf, $(BOARD_SEPOLICY_REPLACE), \ ) \ ) +# Quick edge case error detection for BOARD_SEPOLICY_UNION. +# This ensures that a requested union file exists somewhere +# in one of the listed BOARD_SEPOLICY_DIRS. +$(foreach pf, $(BOARD_SEPOLICY_UNION), \ + $(if $(filter 0, $(words $(wildcard $(addsuffix /$(pf), $(BOARD_SEPOLICY_DIRS))))), \ + $(error No sepolicy file found for $(pf) in $(BOARD_SEPOLICY_DIRS)), \ + ) \ +) + # Builds paths for all requested policy files w.r.t # both BOARD_SEPOLICY_REPLACE and BOARD_SEPOLICY_UNION # product variables. -- GitLab