[PATCH 1/2] build: fix building with PKG_SOURCE_MIRROR=0

Raphaël Mélotte raphael.melotte at mind.be
Thu Jun 11 03:16:15 PDT 2026


Starting from commit 042996b46bd4 ("build: stricter hash validation on download"),
it is no longer possible to download some packages for
which a mirror is available but not used (i.e. when building such
packages with PKG_SOURCE_MIRROR=0).

The problem can be reproduced by using the ply package as an
example. It was previously possible to download ply with the following
command:
make PKG_SOURCE_MIRROR:=0 package/ply/{clean,download} V=sc

But this now fails in the following way:
SHELL= flock /openwrt/tmp/.ply-2023.05.16~1b57943d.tar.zst.flock -c '
bash: -c: line 1: unexpected EOF while looking for matching `''
bash: -c: line 2: syntax error: unexpected end of file

The reason for it is that the download shell command now ends up being
multiple lines instead of one, so make runs them in a separate shell.

To fix it, escape the offending newline so that the shell command is
on a single line again.

Note that this does not happen when PKG_SOURCE_MIRROR=1 (the default
value) as in that case MIRROR is set and the other branch of the if is
used.

Signed-off-by: Raphaël Mélotte <raphael.melotte at mind.be>
---
 include/download.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/download.mk b/include/download.mk
index 47af9227c3..b9d71f2c1a 100644
--- a/include/download.mk
+++ b/include/download.mk
@@ -161,7 +161,7 @@ $(if $(if $(MIRROR), \
 				echo "Hash mismatch for file $(FILE): expected $(MIRROR_HASH), got $$$$file_hash"; \
 				false; \
 			}; \
-		)),
+		)), \
 	$(3)) \
 $(if $(filter check,$(1)), \
 	$(call check_hash,$(FILE),$(MIRROR_HASH),$(2)MIRROR_$(call hash_var,$(MIRROR_MD5SUM))) \
-- 
2.52.0




More information about the openwrt-devel mailing list