Patchwork [2/2] Add $(PKG_NAME) in name of downloaded patches

login
register
mail settings
Submitter Jérôme Pouiller
Date Jan. 31, 2013, 8:18 a.m.
Message ID <1359620310-13640-2-git-send-email-jezz@sysmic.org>
Download mbox | patch
Permalink /patch/217123/
State Superseded
Headers show

Comments

Jérôme Pouiller - Jan. 31, 2013, 8:18 a.m.
Until now, patch was downloaded without be renamed. $(DL_DIR) quickly become a
mess. Downloaded patches are now named
$(PKG_NAME)-$(PKG_VERSION)-$(PKG_PATCH_FILENAME).

Signed-off-by: Jérôme Pouiller <jezz@sysmic.org>
---
 package/pkg-generic.mk |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
Arnout Vandecappelle - April 26, 2013, 6:18 a.m.
On 31/01/13 09:18, Jérôme Pouiller wrote:
> Until now, patch was downloaded without be renamed. $(DL_DIR) quickly become a
> mess.

  Not really... There is just a chance that the patch isn't named 
according to the package name, which could lead to conflicts between 
patch names. But currently there is not a single patch for which the 
patch name differs from the archive name.

> Downloaded patches are now named
> $(PKG_NAME)-$(PKG_VERSION)-$(PKG_PATCH_FILENAME).

  How about adding a new function, CLEAN_DOWNLOAD_NAME, that does

$($(PKG)_NAME)-$($(PKG)_VERSION)-$(patsubst \
   $($(PKG)_VERSION)-%,%,$(patsubst $($(PKG)_NAME)-%,%,$(1)))

  so that the names don't get too long in the usual case?

  The same could also be applied to the package archives.

  But really I think it's making things more complex without being 
necessary in practice. I don't expect this situation of conflicting names 
is likely to occur.

  Regards,
  Arnout

>
> Signed-off-by: Jérôme Pouiller <jezz@sysmic.org>
> ---
>   package/pkg-generic.mk |    7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> index fbc2bb9..f2bf40a 100644
> --- a/package/pkg-generic.mk
> +++ b/package/pkg-generic.mk
> @@ -42,8 +42,8 @@ endif
>   	$(if $($(PKG)_SOURCE),$(call DOWNLOAD,$($(PKG)_SITE)/$($(PKG)_SOURCE)))
>   	$(foreach p,$($(PKG)_PATCH),\
>   		$(if $(findstring ://,$(p)),\
> -			$(call DOWNLOAD,$(p)),\
> -			$(call DOWNLOAD,$($(PKG)_SITE)/$(p))\
> +			$(call DOWNLOAD,$(p),$($(PKG)_NAME)-$($(PKG)_VERSION)-$(notdir $(p))),\
> +			$(call DOWNLOAD,$($(PKG)_SITE)/$(p),$($(PKG)_NAME)-$($(PKG)_VERSION)-$(notdir $(p)))\
>   		)\
>   	$(sep))
>   	$(foreach hook,$($(PKG)_POST_DOWNLOAD_HOOKS),$(call $(hook))$(sep))
> @@ -90,7 +90,8 @@ $(BUILD_DIR)/%/.stamp_patched: NAMEVER = $(RAWNAME)-$($(PKG)_VERSION)
>   $(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) $(notdir $(p))$(sep))
> +	$(foreach p,$($(PKG)_PATCH),\
> +	  support/scripts/apply-patches.sh $(@D) $(DL_DIR) $($(PKG)_NAME)-$($(PKG)_VERSION)-$(notdir $(p))$(sep))
>   	$(Q)( \
>   	if test -d $($(PKG)_DIR_PREFIX)/$(RAWNAME); then \
>   	  if test "$(wildcard $($(PKG)_DIR_PREFIX)/$(RAWNAME)/$(NAMEVER)*.patch*)"; then \
>

Patch

diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index fbc2bb9..f2bf40a 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -42,8 +42,8 @@  endif
 	$(if $($(PKG)_SOURCE),$(call DOWNLOAD,$($(PKG)_SITE)/$($(PKG)_SOURCE)))
 	$(foreach p,$($(PKG)_PATCH),\
 		$(if $(findstring ://,$(p)),\
-			$(call DOWNLOAD,$(p)),\
-			$(call DOWNLOAD,$($(PKG)_SITE)/$(p))\
+			$(call DOWNLOAD,$(p),$($(PKG)_NAME)-$($(PKG)_VERSION)-$(notdir $(p))),\
+			$(call DOWNLOAD,$($(PKG)_SITE)/$(p),$($(PKG)_NAME)-$($(PKG)_VERSION)-$(notdir $(p)))\
 		)\
 	$(sep))
 	$(foreach hook,$($(PKG)_POST_DOWNLOAD_HOOKS),$(call $(hook))$(sep))
@@ -90,7 +90,8 @@  $(BUILD_DIR)/%/.stamp_patched: NAMEVER = $(RAWNAME)-$($(PKG)_VERSION)
 $(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) $(notdir $(p))$(sep))
+	$(foreach p,$($(PKG)_PATCH),\
+	  support/scripts/apply-patches.sh $(@D) $(DL_DIR) $($(PKG)_NAME)-$($(PKG)_VERSION)-$(notdir $(p))$(sep))
 	$(Q)( \
 	if test -d $($(PKG)_DIR_PREFIX)/$(RAWNAME); then \
 	  if test "$(wildcard $($(PKG)_DIR_PREFIX)/$(RAWNAME)/$(NAMEVER)*.patch*)"; then \