summaryrefslogtreecommitdiffstats
path: root/core/tasks
diff options
context:
space:
mode:
authorYing Wang <wangying@google.com>2012-04-30 15:48:27 -0700
committerYing Wang <wangying@google.com>2012-04-30 16:32:25 -0700
commit000e89a5b95a1d3071277ff279263204f49cbd78 (patch)
tree73f325a721650fb9c3642f2262f6ca896eb0f8df /core/tasks
parentf598c6f8cd46a1a5ff188ce51ba5b8941916526e (diff)
downloadbuild-000e89a5b95a1d3071277ff279263204f49cbd78.tar.gz
build-000e89a5b95a1d3071277ff279263204f49cbd78.tar.bz2
build-000e89a5b95a1d3071277ff279263204f49cbd78.zip
Strengthen dependencies on LOCAL_REQUIRED_MODULES
Bug: 6418863 This change expands the PRODUCT_PACKAGES with the required modules. Before this change, since the required modules are not in the PRODUCT_PACKAGES, they are not directly depended on by the image files. If the dependent is not to be included in the image but the required modules are to be included, the dependency of the image on the required modules gets lost! That would lead to build race condition. Change-Id: I0b656db1538ca43d3785dbf17364ffa88b80ac41
Diffstat (limited to 'core/tasks')
-rw-r--r--core/tasks/vendor_module_check.mk22
1 files changed, 5 insertions, 17 deletions
diff --git a/core/tasks/vendor_module_check.mk b/core/tasks/vendor_module_check.mk
index 65c4258d6..d26a0453a 100644
--- a/core/tasks/vendor_module_check.mk
+++ b/core/tasks/vendor_module_check.mk
@@ -30,21 +30,8 @@ _vendor_owner_whitelist := \
ifneq (,$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_RESTRICT_VENDOR_FILES))
-_check_modules := $(sort $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES))
-
-# expand with the required modules
-# $(1) the module name set to expand
-define _expand_required_modules
-$(eval _erm_new_modules:=)\
-$(foreach m, $(1), $(eval r:=$(ALL_MODULES.$(m).REQUIRED))\
- $(if $(r), $(if $(filter $(_check_modules), $(r)),,\
- $(eval _check_modules := $(_check_modules) $(r))\
- $(eval _erm_new_modules := $(_erm_new_modules) $(r)))))\
-$(if $(_erm_new_modules), $(call _expand_required_modules, $(_erm_new_modules)))
-endef
-
-$(call _expand_required_modules, $(_check_modules))
-
+_vendor_check_modules := $(sort $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES))
+$(call expand-required-modules,_vendor_check_modules,$(_vendor_check_modules))
# Restrict owners
ifneq (,$(filter true owner all, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_RESTRICT_VENDOR_FILES)))
@@ -58,7 +45,7 @@ $(error Error: Product "$(TARGET_PRODUCT)" can not have PRODUCT_COPY_FILES from
$(filter vendor/%, $(PRODUCT_COPY_FILES)))
endif
-$(foreach m, $(_check_modules), \
+$(foreach m, $(_vendor_check_modules), \
$(if $(filter vendor/%, $(ALL_MODULES.$(m).PATH)),\
$(if $(filter $(_vendor_owner_whitelist), $(ALL_MODULES.$(m).OWNER)),,\
$(error Error: vendor module "$(m)" in $(ALL_MODULES.$(m).PATH) with unknown owner \
@@ -70,7 +57,7 @@ endif
# Restrict paths
ifneq (,$(filter path all, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_RESTRICT_VENDOR_FILES)))
-$(foreach m, $(_check_modules), \
+$(foreach m, $(_vendor_check_modules), \
$(if $(filter vendor/%, $(ALL_MODULES.$(m).PATH)),\
$(if $(filter $(TARGET_OUT_VENDOR)/%, $(ALL_MODULES.$(m).INSTALLED)),,\
$(error Error: vendor module "$(m)" in $(ALL_MODULES.$(m).PATH) \
@@ -79,4 +66,5 @@ $(foreach m, $(_check_modules), \
endif
+_vendor_check_modules :=
endif