Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 92f80438 authored by Colin Cross's avatar Colin Cross
Browse files

Escape sbom lines

Go 1.21 changes the names of some factory functions to include
characters that need shell escaping.  Wrap everything written to
the sbom file with single quotes.

Bug: 309895579
Test: m out/target/product/vsoc_x86_64/sbom-metadata.csv
Change-Id: Ia61f02d8b02dd9f92ce144307087423c592a1833
parent 5f24ce61
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -2162,7 +2162,7 @@ metadata_list := $(OUT_DIR)/.module_paths/METADATA.list
metadata_files := $(subst $(newline),$(space),$(file <$(metadata_list)))
$(PRODUCT_OUT)/sbom-metadata.csv:
	rm -f $@
	echo installed_file,module_path,soong_module_type,is_prebuilt_make_module,product_copy_files,kernel_module_copy_files,is_platform_generated,build_output_path,static_libraries,whole_static_libraries,is_static_lib >> $@
	echo 'installed_file,module_path,soong_module_type,is_prebuilt_make_module,product_copy_files,kernel_module_copy_files,is_platform_generated,build_output_path,static_libraries,whole_static_libraries,is_static_lib' >> $@
	$(eval _all_static_libs :=)
	$(foreach f,$(installed_files),\
	  $(eval _module_name := $(ALL_INSTALLED_FILES.$f)) \
@@ -2190,7 +2190,7 @@ $(PRODUCT_OUT)/sbom-metadata.csv:
	  $(eval _whole_static_libs := $(ALL_INSTALLED_FILES.$f.WHOLE_STATIC_LIBRARIES)) \
	  $(foreach l,$(_static_libs),$(eval _all_static_libs += $l:$(strip $(sort $(ALL_MODULES.$l.PATH))):$(strip $(sort $(ALL_MODULES.$l.SOONG_MODULE_TYPE))):$(ALL_STATIC_LIBRARIES.$l.BUILT_FILE))) \
	  $(foreach l,$(_whole_static_libs),$(eval _all_static_libs += $l:$(strip $(sort $(ALL_MODULES.$l.PATH))):$(strip $(sort $(ALL_MODULES.$l.SOONG_MODULE_TYPE))):$(ALL_STATIC_LIBRARIES.$l.BUILT_FILE))) \
	  echo /$(_path_on_device),$(_module_path),$(_soong_module_type),$(_is_prebuilt_make_module),$(_product_copy_files),$(_kernel_module_copy_files),$(_is_platform_generated),$(_build_output_path),$(_static_libs),$(_whole_static_libs), >> $@; \
	  echo '/$(_path_on_device),$(_module_path),$(_soong_module_type),$(_is_prebuilt_make_module),$(_product_copy_files),$(_kernel_module_copy_files),$(_is_platform_generated),$(_build_output_path),$(_static_libs),$(_whole_static_libs),' >> $@; \
	)
	$(foreach l,$(sort $(_all_static_libs)), \
	  $(eval _lib_stem := $(call word-colon,1,$l)) \
@@ -2200,7 +2200,7 @@ $(PRODUCT_OUT)/sbom-metadata.csv:
	  $(eval _static_libs := $(ALL_STATIC_LIBRARIES.$l.STATIC_LIBRARIES)) \
	  $(eval _whole_static_libs := $(ALL_STATIC_LIBRARIES.$l.WHOLE_STATIC_LIBRARIES)) \
	  $(eval _is_static_lib := Y) \
	  echo $(_lib_stem).a,$(_module_path),$(_soong_module_type),,,,,$(_built_file),$(_static_libs),$(_whole_static_libs),$(_is_static_lib) >> $@; \
	  echo '$(_lib_stem).a,$(_module_path),$(_soong_module_type),,,,,$(_built_file),$(_static_libs),$(_whole_static_libs),$(_is_static_lib)' >> $@; \
	)

# (TODO: b/272358583 find another way of always rebuilding sbom.spdx)