diff mbox

[v2,2/4] pkg-generic: prevent _SITE URLs with a trailing slash

Message ID 1443346764-7433-3-git-send-email-luca@lucaceresoli.net
State Superseded
Headers show

Commit Message

Luca Ceresoli Sept. 27, 2015, 9:39 a.m. UTC
This is the recommended form for URLs. Buildroot will add a slash between
FOO_SITE and FOO_SOURCE as appropriate.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
---
 package/pkg-generic.mk | 2 ++
 1 file changed, 2 insertions(+)
diff mbox

Patch

diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 6a7d97efdf02..5ec2f807b137 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -70,6 +70,8 @@  endif
 
 # Retrieve the archive
 $(BUILD_DIR)/%/.stamp_downloaded:
+	@(echo "$($(PKG)_SITE)" | grep -Eq "[^/]$$" && true || \
+		(echo "$(PKG)_SITE ($($(PKG)_SITE)) cannot have a trailing slash" && false))
 	$(foreach hook,$($(PKG)_PRE_DOWNLOAD_HOOKS),$(call $(hook))$(sep))
 # Only show the download message if it isn't already downloaded
 	$(Q)for p in $($(PKG)_ALL_DOWNLOADS); do \