summaryrefslogtreecommitdiffstats
path: root/rootdir
diff options
context:
space:
mode:
authorKiyoung Kim <kiyoungkim@google.com>2019-07-18 20:21:05 +0900
committerJustin Yun <justinyun@google.com>2019-08-02 11:15:28 +0900
commit1d85de658cdf882f367c485feb9d5ef5f87b14f0 (patch)
treec3eb0f70105143c0fb4c6e1c727d6e04308c5c0a /rootdir
parentd941ba256f638c42b0f5ff630699fb745bf926f7 (diff)
downloadsystem_core-1d85de658cdf882f367c485feb9d5ef5f87b14f0.tar.gz
system_core-1d85de658cdf882f367c485feb9d5ef5f87b14f0.tar.bz2
system_core-1d85de658cdf882f367c485feb9d5ef5f87b14f0.zip
Replace xargs with other shell command
Recently Android build team changed environment to use prebuilt toybox binaries for common tools (aosp/852849). However, as toybox xargs does not support -I option, update_and_install_ld_config.mk started to fail filtering out private vndk libraries from the list. To resolve this, xargs usages are replaced with other shell command (read). Bug: 137832162 Test: m -j && tested on Cuttlefish Change-Id: I218ce6272c781f826b87c8efc0d3c77bf6bc3af5 Merged-In: I218ce6272c781f826b87c8efc0d3c77bf6bc3af5 (cherry picked from commit 95d55818a46d793295db5e90fa55fd0b01bed059)
Diffstat (limited to 'rootdir')
-rw-r--r--rootdir/update_and_install_ld_config.mk7
1 files changed, 4 insertions, 3 deletions
diff --git a/rootdir/update_and_install_ld_config.mk b/rootdir/update_and_install_ld_config.mk
index f62c3df5b..12828683f 100644
--- a/rootdir/update_and_install_ld_config.mk
+++ b/rootdir/update_and_install_ld_config.mk
@@ -88,7 +88,7 @@ endif # ifneq ($(lib_list_from_prebuilts),true)
# $(2): output file with the filtered list of lib names
$(LOCAL_BUILT_MODULE): private-filter-out-private-libs = \
paste -sd ":" $(1) > $(2) && \
- cat $(PRIVATE_VNDK_PRIVATE_LIBRARIES_FILE) | xargs -n 1 -I privatelib bash -c "sed -i.bak 's/privatelib//' $(2)" && \
+ while read -r privatelib; do sed -i.bak "s/$$privatelib//" $(2) ; done < $(PRIVATE_VNDK_PRIVATE_LIBRARIES_FILE) && \
sed -i.bak -e 's/::\+/:/g ; s/^:\+// ; s/:\+$$//' $(2) && \
rm -f $(2).bak
$(LOCAL_BUILT_MODULE): PRIVATE_LLNDK_LIBRARIES_FILE := $(llndk_libraries_file)
@@ -139,8 +139,9 @@ else
endif
$(hide) echo -n > $(PRIVATE_INTERMEDIATES_DIR)/private_llndk && \
- cat $(PRIVATE_VNDK_PRIVATE_LIBRARIES_FILE) | \
- xargs -n 1 -I privatelib bash -c "(grep privatelib $(PRIVATE_LLNDK_LIBRARIES_FILE) || true) >> $(PRIVATE_INTERMEDIATES_DIR)/private_llndk" && \
+ while read -r privatelib; \
+ do (grep $$privatelib $(PRIVATE_LLNDK_LIBRARIES_FILE) || true) >> $(PRIVATE_INTERMEDIATES_DIR)/private_llndk ; \
+ done < $(PRIVATE_VNDK_PRIVATE_LIBRARIES_FILE) && \
paste -sd ":" $(PRIVATE_INTERMEDIATES_DIR)/private_llndk | \
sed -i.bak -e "s?%PRIVATE_LLNDK_LIBRARIES%?$$(cat -)?g" $@