Skip to content

Commit

Permalink
Remove duplicate src:dest pairs in PRODUCT_COPY_FILES
Browse files Browse the repository at this point in the history
Before setting up the rules.

Change-Id: Ifedbc0e988895a899cae315dc730a152bae91ae2
  • Loading branch information
Ying Wang authored and Gerrit Code Review committed Nov 6, 2012
1 parent 16bde1f commit 8bce8c0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion core/Makefile
Expand Up @@ -35,8 +35,13 @@ define check-product-copy-files
$(if $(filter %.apk, $(1)),$(error \
Prebuilt apk found in PRODUCT_COPY_FILES: $(1), use BUILD_PREBUILT instead!))
endef
unique_product_copy_files_destinations :=
# filter out the duplicate <source file>:<dest file> pairs.
unique_product_copy_files_pairs :=
$(foreach cf,$(PRODUCT_COPY_FILES), \
$(if $(filter $(unique_product_copy_files_pairs),$(cf)),,\
$(eval unique_product_copy_files_pairs += $(cf))))
unique_product_copy_files_destinations :=
$(foreach cf,$(unique_product_copy_files_pairs), \
$(eval _src := $(call word-colon,1,$(cf))) \
$(eval _dest := $(call word-colon,2,$(cf))) \
$(if $(filter $(unique_product_copy_files_destinations),$(_dest)), \
Expand All @@ -47,6 +52,7 @@ $(foreach cf,$(PRODUCT_COPY_FILES), \
$(eval $(call copy-one-file,$(_src),$(_fulldest)))) \
$(eval ALL_DEFAULT_INSTALLED_MODULES += $(_fulldest)) \
$(eval unique_product_copy_files_destinations += $(_dest))))
unique_product_copy_files_pairs :=
unique_product_copy_files_destinations :=

# -----------------------------------------------------------------
Expand Down

0 comments on commit 8bce8c0

Please sign in to comment.