summaryrefslogtreecommitdiffstats
path: root/package/pkg-generic.mk
diff options
context:
space:
mode:
authorSimon Dawson <spdawson@gmail.com>2013-03-17 23:13:47 +0000
committerPeter Korsgaard <jacmet@sunsite.dk>2013-03-19 23:10:49 +0100
commit5538e4766201aa0c1c23721cfc99cbbde595964b (patch)
tree27adb945477693e075b5b2eb4f6e1cc639eeaa69 /package/pkg-generic.mk
parent424d69bc9b48e08398fce3adafd0c5c94edc7281 (diff)
downloadbuildroot-novena-5538e4766201aa0c1c23721cfc99cbbde595964b.tar.gz
buildroot-novena-5538e4766201aa0c1c23721cfc99cbbde595964b.zip
rework patch model
At the Buildroot Developers Meeting (4-5 February 2013, in Brussels) a change to the patch logic was discussed. See http://elinux.org/Buildroot:DeveloperDaysFOSDEM2013 for details. In summary: * For patches stored in the package directory, if package/<pkg>/<version>/ does exist, apply package/<pkg>/<version>/*.patch, otherwise, apply package/<pkg>/*.patch * For patches stored in the global patches directory, if $(GLOBAL_PATCH_DIR)/<pkg>/<version>/ does exist, apply $(GLOBAL_PATCH_DIR)/<pkg>/<version>/*.patch, otherwise, apply $(GLOBAL_PATCH_DIR)/<pkg>/*.patch This patch adds the new BR2_GLOBAL_PATCH_DIR configuration item, and reworks the generic package infrastructure to implement the new patch logic. [Peter: fixup doc nits as pointed out by Thomas] Signed-off-by: Simon Dawson <spdawson@gmail.com> Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Acked-by: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'package/pkg-generic.mk')
-rw-r--r--package/pkg-generic.mk16
1 files changed, 8 insertions, 8 deletions
diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 8d964a18c..afb90bf79 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -82,21 +82,21 @@ endif
# find the package directory (typically package/<pkgname>) and the
# prefix of the patches
$(BUILD_DIR)/%/.stamp_patched: NAMEVER = $(RAWNAME)-$($(PKG)_VERSION)
+$(BUILD_DIR)/%/.stamp_patched: PATCH_BASE_DIRS = $($(PKG)_DIR_PREFIX)/$(RAWNAME) $(call qstrip,$(BR2_GLOBAL_PATCH_DIR))/$(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))
$(Q)( \
- if test -d $($(PKG)_DIR_PREFIX)/$(RAWNAME); then \
- if test "$(wildcard $($(PKG)_DIR_PREFIX)/$(RAWNAME)/$(NAMEVER)*.patch*)"; then \
- support/scripts/apply-patches.sh $(@D) $($(PKG)_DIR_PREFIX)/$(RAWNAME) $(NAMEVER)\*.patch $(NAMEVER)\*.patch.$(ARCH) || exit 1; \
- else \
- support/scripts/apply-patches.sh $(@D) $($(PKG)_DIR_PREFIX)/$(RAWNAME) $(RAWNAME)\*.patch $(RAWNAME)\*.patch.$(ARCH) || exit 1; \
- if test -d $($(PKG)_DIR_PREFIX)/$(RAWNAME)/$(NAMEVER); then \
- support/scripts/apply-patches.sh $(@D) $($(PKG)_DIR_PREFIX)/$(RAWNAME)/$(NAMEVER) \*.patch \*.patch.$(ARCH) || exit 1; \
+ for D in $(PATCH_BASE_DIRS); do \
+ if test -d $${D}; then \
+ if test -d $${D}/$($(PKG)_VERSION); then \
+ support/scripts/apply-patches.sh $(@D) $${D}/$($(PKG)_VERSION) \*.patch \*.patch.$(ARCH) || exit 1; \
+ else \
+ support/scripts/apply-patches.sh $(@D) $${D} \*.patch \*.patch.$(ARCH) || exit 1; \
fi; \
fi; \
- fi; \
+ done; \
)
$(foreach hook,$($(PKG)_POST_PATCH_HOOKS),$(call $(hook))$(sep))
$(Q)touch $@