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

Commit 37b3074a authored by Brint E. Kriebel's avatar Brint E. Kriebel Committed by Ricardo Cerqueira
Browse files

build: Use newline at the end of echo to apkcerts file

Revert "core/Makefile: avoid exceeding MAX_ARG_STRLEN"
This reverts commit 2eb4ca0f.

If a newline is not used, the echo commands are strung
together in one large command. In environments with long
pathnames, this can cause the error:
  "make: execvp: /bin/bash: Argument list too long"

This splits the echo commands up into individual commands
to avoid the argument limit.

Change-Id: Id2e5033ad51a9746e2b6cd88f9d53d5b7c93bc1b
parent 359a0d63
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -250,6 +250,11 @@ $(PACKAGE_STATS_FILE): $(PACKAGES_TO_STAT)
.PHONY: package-stats
package-stats: $(PACKAGE_STATS_FILE)

# makefile workaround to allow the insert of a newline
define \n


endef
# -----------------------------------------------------------------
# Cert-to-package mapping.  Used by the post-build signing tools.
name := $(TARGET_PRODUCT)
@@ -266,12 +271,12 @@ $(APKCERTS_FILE):
	@echo APK certs list: $@
	@mkdir -p $(dir $@)
	@rm -f $@
	$(hide) cd $(dir $@) && $(foreach p,$(PACKAGES),\
	$(hide) $(foreach p,$(PACKAGES),\
          $(if $(PACKAGES.$(p).EXTERNAL_KEY),\
	    echo 'name="$(p).apk" certificate="EXTERNAL" \
	         private_key=""' >> $(notdir $@);,\
	         private_key=""' >> $@;${\n},\
	    echo 'name="$(p).apk" certificate="$(PACKAGES.$(p).CERTIFICATE)" \
	         private_key="$(PACKAGES.$(p).PRIVATE_KEY)"' >> $(notdir $@);))
	         private_key="$(PACKAGES.$(p).PRIVATE_KEY)"' >> $@;${\n}))
	# In case $(PACKAGES) is empty.
	$(hide) touch $@