From 3e2d828c0a5c69a4b2929f330426d93e47ec5d25 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Pouiller?= Date: Mon, 13 May 2013 17:51:52 +0200 Subject: [PATCH] Add support for plain URL in $(PKG)_PATCH variable MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Until now, $(PKG)_PATCH allow only to download patches from same URL than tarball. This patch allow to detect when plain URL are used in $(PKG)_PATCH and correctly handle them. Signed-off-by: Jérôme Pouiller Reviewed-by: "Yann E. MORIN" Reviewed-by: Markos Chandras Signed-off-by: Peter Korsgaard --- package/pkg-generic.mk | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index 00f1cb31d2..4dd395b6ea 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -40,7 +40,12 @@ ifeq ($(DL_MODE),DOWNLOAD) fi endif $(if $($(PKG)_SOURCE),$(call DOWNLOAD,$($(PKG)_SITE:/=)/$($(PKG)_SOURCE))) - $(foreach p,$($(PKG)_PATCH),$(call DOWNLOAD,$($(PKG)_SITE:/=)/$(p))$(sep)) + $(foreach p,$($(PKG)_PATCH),\ + $(if $(findstring ://,$(p)),\ + $(call DOWNLOAD,$(p)),\ + $(call DOWNLOAD,$($(PKG)_SITE:/=)/$(p))\ + )\ + $(sep)) $(foreach hook,$($(PKG)_POST_DOWNLOAD_HOOKS),$(call $(hook))$(sep)) ifeq ($(DL_MODE),DOWNLOAD) $(Q)mkdir -p $(@D) @@ -86,7 +91,7 @@ $(BUILD_DIR)/%/.stamp_patched: PATCH_BASE_DIRS = $($(PKG)_DIR_PREFIX)/$(RAWNAME) $(BUILD_DIR)/%/.stamp_patched: @$(call MESSAGE,"Patching $($(PKG)_DIR_PREFIX)/$(RAWNAME)") $(foreach hook,$($(PKG)_PRE_PATCH_HOOKS),$(call $(hook))$(sep)) - $(foreach p,$($(PKG)_PATCH),support/scripts/apply-patches.sh $(@D) $(DL_DIR) $(p)$(sep)) + $(foreach p,$($(PKG)_PATCH),support/scripts/apply-patches.sh $(@D) $(DL_DIR) $(notdir $(p))$(sep)) $(Q)( \ for D in $(PATCH_BASE_DIRS); do \ if test -d $${D}; then \ -- 2.30.2