Merge "Include /product_services software in NOTICE."

This commit is contained in:
Dario Freni 2018-08-29 09:11:44 +00:00 committed by Gerrit Code Review
commit d909caf397
2 changed files with 32 additions and 5 deletions

View File

@ -949,10 +949,11 @@ $(2) $(3): PRIVATE_DIR := $(5)
$(2) : $(3)
$(3) : $(6) $(BUILD_SYSTEM)/Makefile build/make/tools/generate-notice-files.py
build/make/tools/generate-notice-files.py --text-output $(2) \
$(if $(filter $(1),xml_excluded_vendor_product),-e vendor$(comma)product --xml-output, \
$(if $(filter $(1),xml_excluded_extra_partitions),-e vendor$(comma)product$(comma)product_services --xml-output, \
$(if $(filter $(1),xml_vendor),-i vendor --xml-output, \
$(if $(filter $(1),xml_product),-i product --xml-output, \
--html-output))) $(3) \
$(if $(filter $(1),xml_product_services),-i product_services --xml-output, \
--html-output)))) $(3) \
-t $$(PRIVATE_MESSAGE) -s $$(PRIVATE_DIR)/src
notice_files: $(2) $(3)
endef
@ -983,6 +984,11 @@ target_product_notice_file_txt := $(TARGET_OUT_INTERMEDIATES)/NOTICE_PRODUCT.txt
target_product_notice_file_xml := $(TARGET_OUT_INTERMEDIATES)/NOTICE_PRODUCT.xml
target_product_notice_file_xml_gz := $(TARGET_OUT_INTERMEDIATES)/NOTICE_PRODUCT.xml.gz
installed_product_notice_xml_gz := $(TARGET_OUT_PRODUCT)/etc/NOTICE.xml.gz
target_product_services_notice_file_txt := $(TARGET_OUT_INTERMEDIATES)/NOTICE_PRODUCT_SERVICES.txt
target_product_services_notice_file_xml := $(TARGET_OUT_INTERMEDIATES)/NOTICE_PRODUCT_SERVICES.xml
target_product_services_notice_file_xml_gz := $(TARGET_OUT_INTERMEDIATES)/NOTICE_PRODUCT_SERVICES.xml.gz
installed_product_services_notice_xml_gz := $(TARGET_OUT_PRODUCT_SERVICES)/etc/NOTICE.xml.gz
endif
ifndef TARGET_BUILD_APPS
@ -991,7 +997,7 @@ winpthreads_notice_file := $(TARGET_OUT_NOTICE_FILES)/src/winpthreads.txt
pdk_fusion_notice_files := $(filter $(TARGET_OUT_NOTICE_FILES)/%, $(ALL_PDK_FUSION_FILES))
ifdef target_vendor_notice_file_xml_gz
$(eval $(call combine-notice-files, xml_excluded_vendor_product, \
$(eval $(call combine-notice-files, xml_excluded_extra_partitions, \
$(target_notice_file_txt), \
$(target_notice_file_html_or_xml), \
"Notices for files contained in the filesystem images in this directory:", \
@ -1011,6 +1017,14 @@ $(eval $(call combine-notice-files, xml_product, \
$(TARGET_OUT_NOTICE_FILES), \
$(target_notice_file_html_or_xml)))
endif
ifdef target_product_services_notice_file_txt
$(eval $(call combine-notice-files, xml_product_services, \
$(target_product_services_notice_file_txt), \
$(target_product_services_notice_file_xml), \
"Notices for files contained in the product_services filesystem image in this directory:", \
$(TARGET_OUT_NOTICE_FILES), \
$(target_notice_file_html_or_xml)))
endif
else
$(eval $(call combine-notice-files, html, \
$(target_notice_file_txt), \
@ -1054,6 +1068,14 @@ $(installed_product_notice_xml_gz): $(target_product_notice_file_xml_gz)
$(copy-file-to-target)
endif
ifdef target_product_services_notice_file_xml_gz
# Install the product html file at /product_services/etc/NOTICE.xml.gz.
$(target_product_services_notice_file_xml_gz): $(target_product_services_notice_file_xml) | $(MINIGZIP)
$(hide) $(MINIGZIP) -9 < $< > $@
$(installed_product_services_notice_xml_gz): $(target_product_services_notice_file_xml_gz)
$(copy-file-to-target)
endif
# if we've been run my mm, mmm, etc, don't reinstall this every time
ifeq ($(ONE_SHOT_MAKEFILE),)
ALL_DEFAULT_INSTALLED_MODULES += $(installed_notice_html_or_xml_gz)
@ -1063,6 +1085,9 @@ ifeq ($(ONE_SHOT_MAKEFILE),)
ifdef target_product_notice_file_xml_gz
ALL_DEFAULT_INSTALLED_MODULES += $(installed_product_notice_xml_gz)
endif
ifdef target_product_services_notice_file_xml_gz
ALL_DEFAULT_INSTALLED_MODULES += $(installed_product_services_notice_xml_gz)
endif
endif
endif # TARGET_BUILD_APPS

View File

@ -238,12 +238,14 @@ def main(argv):
if len(included_subdirs) > 0:
matched = False
for subdir in included_subdirs:
if root.startswith(input_dir + '/' + subdir):
if (root == (input_dir + '/' + subdir) or
root.startswith(input_dir + '/' + subdir + '/')):
matched = True
break
elif len(excluded_subdirs) > 0:
for subdir in excluded_subdirs:
if root.startswith(input_dir + '/' + subdir):
if (root == (input_dir + '/' + subdir) or
root.startswith(input_dir + '/' + subdir + '/')):
matched = False
break
if matched and file.endswith(".txt"):