Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 08/35] packages: apply custom patches using *.patch instead of <pkg>-*.patch
Date: Sun, 29 Mar 2015 23:35:51 +0200	[thread overview]
Message-ID: <20150329213551.GI4093@free.fr> (raw)
In-Reply-To: <1427650429-9293-9-git-send-email-thomas.petazzoni@free-electrons.com>

Thomas, All,

On 2015-03-29 19:33 +0200, Thomas Petazzoni spake thusly:
> Several packages have some logic to apply custom patches that existed
> before the BR2_GLOBAL_PATCH_DIR mechanism: at91bootstrap,
> at91bootstrap3, barebox, uboot and linux. Currently, the logic of
> those packages to apply custom patches is to match
> <package-name>-*.patch, which is not consistent with what we've done
> for patches stored in the package directory, and for patches stored in
> BR2_GLOBAL_PATCH_DIR: in such cases, we simply apply *.patch.
> 
> Therefore, for consistency reasons, this commit changes these packages
> to also apply *.patch.

At first, I was wondering if we could not simply get rid of al those
custom hooks, and do something like:

    BR2_GLOBAL_PATCH_DIR += $(BR2_TARGET_AT91BOOTSTRAP_CUSTOM_PATCH_DIR)

and so on for the others.

But it turns out that we're only looking into sub-directories of
BR2_GLOBAL_PATCH_DIR, so the above sould not work.

Second, I'm afraid this would break the case where someone has all the
patches in a single directory, and use the 'package' prefix to
differentiate what package a patch would apply, like so:

    /path/to/my/patches/at91bootstrap-patch-1.patch
    /path/to/my/patches/at91bootstrap3-patch-1.patch
    /path/to/my/patches/barebox-patch-1.patch
    /path/to/my/patches/linux-patch-1.patch
    ...

This change would break that setup, would it not?

Still, I think the change is a good and sound improvement in principle,
so I would not care much about the use-case above.

> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Regards,
Yann E. MORIN.

> ---
>  boot/at91bootstrap/at91bootstrap.mk   | 3 +--
>  boot/at91bootstrap3/at91bootstrap3.mk | 3 +--
>  boot/barebox/barebox.mk               | 5 ++---
>  boot/uboot/uboot.mk                   | 3 +--
>  linux/Config.in                       | 2 +-
>  linux/linux.mk                        | 2 +-
>  6 files changed, 7 insertions(+), 11 deletions(-)
> 
> diff --git a/boot/at91bootstrap/at91bootstrap.mk b/boot/at91bootstrap/at91bootstrap.mk
> index 50bbc26..802e85e 100644
> --- a/boot/at91bootstrap/at91bootstrap.mk
> +++ b/boot/at91bootstrap/at91bootstrap.mk
> @@ -24,8 +24,7 @@ endef
>  
>  ifneq ($(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP_CUSTOM_PATCH_DIR)),)
>  define AT91BOOTSTRAP_APPLY_CUSTOM_PATCHES
> -	$(APPLY_PATCHES) $(@D) $(BR2_TARGET_AT91BOOTSTRAP_CUSTOM_PATCH_DIR) \
> -		at91bootstrap-$(AT91BOOTSTRAP_VERSION)-\*.patch
> +	$(APPLY_PATCHES) $(@D) $(BR2_TARGET_AT91BOOTSTRAP_CUSTOM_PATCH_DIR) \*.patch
>  endef
>  
>  AT91BOOTSTRAP_POST_PATCH_HOOKS += AT91BOOTSTRAP_APPLY_CUSTOM_PATCHES
> diff --git a/boot/at91bootstrap3/at91bootstrap3.mk b/boot/at91bootstrap3/at91bootstrap3.mk
> index 098e7bf..b780617 100644
> --- a/boot/at91bootstrap3/at91bootstrap3.mk
> +++ b/boot/at91bootstrap3/at91bootstrap3.mk
> @@ -21,8 +21,7 @@ AT91BOOTSTRAP3_MAKE_OPTS = CROSS_COMPILE=$(TARGET_CROSS) DESTDIR=$(BINARIES_DIR)
>  
>  ifneq ($(AT91BOOTSTRAP3_CUSTOM_PATCH_DIR),)
>  define AT91BOOTSTRAP3_APPLY_CUSTOM_PATCHES
> -	$(APPLY_PATCHES) $(@D) $(AT91BOOTSTRAP3_CUSTOM_PATCH_DIR) \
> -		at91bootstrap3-\*.patch
> +	$(APPLY_PATCHES) $(@D) $(AT91BOOTSTRAP3_CUSTOM_PATCH_DIR) \*.patch
>  endef
>  
>  AT91BOOTSTRAP3_POST_PATCH_HOOKS += AT91BOOTSTRAP3_APPLY_CUSTOM_PATCHES
> diff --git a/boot/barebox/barebox.mk b/boot/barebox/barebox.mk
> index 5809fb0..98cb04e 100644
> --- a/boot/barebox/barebox.mk
> +++ b/boot/barebox/barebox.mk
> @@ -26,9 +26,8 @@ BAREBOX_LICENSE_FILES = COPYING
>  
>  ifneq ($(call qstrip,$(BR2_TARGET_BAREBOX_CUSTOM_PATCH_DIR)),)
>  define BAREBOX_APPLY_CUSTOM_PATCHES
> -	$(APPLY_PATCHES) $(@D) \
> -		$(BR2_TARGET_BAREBOX_CUSTOM_PATCH_DIR) \
> -		barebox-$(BAREBOX_VERSION)-\*.patch
> +	$(APPLY_PATCHES) $(@D)
> +		$(BR2_TARGET_BAREBOX_CUSTOM_PATCH_DIR) \*.patch
>  endef
>  
>  BAREBOX_POST_PATCH_HOOKS += BAREBOX_APPLY_CUSTOM_PATCHES
> diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
> index a9ba054..8da2272 100644
> --- a/boot/uboot/uboot.mk
> +++ b/boot/uboot/uboot.mk
> @@ -86,8 +86,7 @@ UBOOT_POST_EXTRACT_HOOKS += UBOOT_COPY_OLD_LICENSE_FILE
>  
>  ifneq ($(call qstrip,$(BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR)),)
>  define UBOOT_APPLY_CUSTOM_PATCHES
> -	$(APPLY_PATCHES) $(@D) $(BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR) \
> -		uboot-\*.patch
> +	$(APPLY_PATCHES) $(@D) $(BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR) \*.patch
>  endef
>  
>  UBOOT_POST_PATCH_HOOKS += UBOOT_APPLY_CUSTOM_PATCHES
> diff --git a/linux/Config.in b/linux/Config.in
> index a1113dd..c83a3f5 100644
> --- a/linux/Config.in
> +++ b/linux/Config.in
> @@ -129,7 +129,7 @@ config BR2_LINUX_KERNEL_PATCH
>  	  A space-separated list of patches to apply to the
>  	  kernel. Each patch can be described as an URL, a local file
>  	  path, or a directory. In the case of a directory, all files
> -	  matching linux-*.patch in the directory will be applied.
> +	  matching *.patch in the directory will be applied.
>  
>  #
>  # Configuration selection
> diff --git a/linux/linux.mk b/linux/linux.mk
> index c25d106..e239ff7 100644
> --- a/linux/linux.mk
> +++ b/linux/linux.mk
> @@ -158,7 +158,7 @@ endif # BR2_LINUX_KERNEL_VMLINUX
>  define LINUX_APPLY_LOCAL_PATCHES
>  	for p in $(filter-out ftp://% http://% https://%,$(LINUX_PATCHES)) ; do \
>  		if test -d $$p ; then \
> -			$(APPLY_PATCHES) $(@D) $$p linux-\*.patch || exit 1 ; \
> +			$(APPLY_PATCHES) $(@D) $$p \*.patch || exit 1 ; \
>  		else \
>  			$(APPLY_PATCHES) $(@D) `dirname $$p` `basename $$p` || exit 1; \
>  		fi \
> -- 
> 2.1.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

  reply	other threads:[~2015-03-29 21:35 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-29 17:33 [Buildroot] [PATCH 00/35] Package based 'source', 'legal-info', 'source-check' and 'external-deps' Thomas Petazzoni
2015-03-29 17:33 ` [Buildroot] [PATCH 01/35] linux: use the package infrastructure to download patches Thomas Petazzoni
2015-03-29 20:47   ` Yann E. MORIN
2015-03-29 17:33 ` [Buildroot] [PATCH 02/35] pkg-generic: fix the logic showing the "Downloading" message Thomas Petazzoni
2015-03-29 20:48   ` Yann E. MORIN
2015-03-29 17:33 ` [Buildroot] [PATCH 03/35] pkg-generic: take into account <pkg>_EXTRA_DOWNLOADS to display " Thomas Petazzoni
2015-03-29 20:49   ` Yann E. MORIN
2015-03-29 17:33 ` [Buildroot] [PATCH 04/35] pkg-generic: refactor the "Downloading" message logic Thomas Petazzoni
2015-03-29 20:50   ` Yann E. MORIN
2015-03-29 17:33 ` [Buildroot] [PATCH 05/35] pkg-generic: allow full URLs for <pkg>_EXTRA_DOWNLOADS Thomas Petazzoni
2015-03-29 21:08   ` Yann E. MORIN
2015-03-30  7:26     ` Thomas Petazzoni
2015-05-10 18:42   ` Bernd Kuhls
2015-03-29 17:33 ` [Buildroot] [PATCH 06/35] docs/manual: update documentation about <pkg>_SOURCE, <pkg>_PATCH and <pkg>_EXTRA_DOWNLOADS Thomas Petazzoni
2015-03-29 21:10   ` Yann E. MORIN
2015-03-29 17:33 ` [Buildroot] [PATCH 07/35] perl: use <pkg>_EXTRA_DOWNLOADS Thomas Petazzoni
2015-03-29 21:15   ` Yann E. MORIN
2015-03-29 17:33 ` [Buildroot] [PATCH 08/35] packages: apply custom patches using *.patch instead of <pkg>-*.patch Thomas Petazzoni
2015-03-29 21:35   ` Yann E. MORIN [this message]
2015-03-30  7:29     ` Thomas Petazzoni
2015-03-30 16:22       ` Yann E. MORIN
2015-03-29 17:33 ` [Buildroot] [PATCH 09/35] docs/manual: update documentation about applying patches Thomas Petazzoni
2015-03-29 21:40   ` Yann E. MORIN
2015-04-06  9:06     ` Thomas Petazzoni
2015-03-29 17:33 ` [Buildroot] [PATCH 10/35] pkg-generic: implement a <pkg>-external-deps target Thomas Petazzoni
2015-03-29 21:44   ` Yann E. MORIN
2015-03-29 17:33 ` [Buildroot] [PATCH 11/35] pkg-generic: implement <pkg>-all-{source, legal-info, external-deps} targets Thomas Petazzoni
2015-03-29 21:47   ` Yann E. MORIN
2015-03-30 17:45     ` Yann E. MORIN
2015-03-30 18:56       ` Thomas Petazzoni
2015-04-06  9:14       ` Yann E. MORIN
2015-03-29 17:33 ` [Buildroot] [PATCH 12/35] Makefile: remove dubious comment Thomas Petazzoni
2015-03-29 21:50   ` Yann E. MORIN
2015-03-29 17:33 ` [Buildroot] [PATCH 13/35] Makefile: directories are not PHONY targets Thomas Petazzoni
2015-03-29 21:56   ` Yann E. MORIN
2015-03-29 17:33 ` [Buildroot] [PATCH 14/35] pkg-generic: declare phony targets as such Thomas Petazzoni
2015-03-29 22:05   ` Yann E. MORIN
2015-03-29 17:33 ` [Buildroot] [PATCH 15/35] pkg-kconfig: " Thomas Petazzoni
2015-03-29 22:08   ` Yann E. MORIN
2015-03-29 17:33 ` [Buildroot] [PATCH 16/35] fs: " Thomas Petazzoni
2015-03-29 22:16   ` Yann E. MORIN
2015-03-29 17:33 ` [Buildroot] [PATCH 17/35] Makefile: targets are now declared phony by the appropriate infrastructures Thomas Petazzoni
2015-03-29 22:22   ` Yann E. MORIN
2015-03-29 17:33 ` [Buildroot] [PATCH 18/35] Makefile: rename TARGETS to PACKAGES Thomas Petazzoni
2015-03-30 16:31   ` Yann E. MORIN
2015-03-29 17:33 ` [Buildroot] [PATCH 19/35] fs: add rootfs dependencies " Thomas Petazzoni
2015-03-30 16:33   ` Yann E. MORIN
2015-03-29 17:33 ` [Buildroot] [PATCH 20/35] Makefile: use <pkg>-all-legal-info to implement the legal-info target Thomas Petazzoni
2015-03-30 20:59   ` Yann E. MORIN
2015-03-29 17:33 ` [Buildroot] [PATCH 21/35] Makefile: simplify show-targets Thomas Petazzoni
2015-03-30 21:21   ` Yann E. MORIN
2015-03-30 21:40     ` Yann E. MORIN
2015-04-06  9:40     ` Thomas Petazzoni
2015-04-06  9:44   ` Yann E. MORIN
2015-03-29 17:33 ` [Buildroot] [PATCH 22/35] Makefile: use the package infra based external-deps Thomas Petazzoni
2015-03-30 21:43   ` Yann E. MORIN
2015-03-29 17:33 ` [Buildroot] [PATCH 23/35] pkg-download: remove support for the SHOW_EXTERNAL_DEPS DL_MODE Thomas Petazzoni
2015-03-29 17:33 ` [Buildroot] [PATCH 24/35] Makefile: move source-check outside of noconfig_targets Thomas Petazzoni
2015-03-29 17:33 ` [Buildroot] [PATCH 25/35] pkg-download: extend DOWNLOAD_INNER, add a SOURCE_CHECK macro Thomas Petazzoni
2015-03-29 17:33 ` [Buildroot] [PATCH 26/35] pkg-generic: implement source-check targets Thomas Petazzoni
2015-03-29 17:33 ` [Buildroot] [PATCH 27/35] Makefile: implement a package based source-check target Thomas Petazzoni
2015-03-29 17:33 ` [Buildroot] [PATCH 28/35] pkg-generic: remove the .stamp_rsync_sourced fake stamp file Thomas Petazzoni
2015-03-29 17:33 ` [Buildroot] [PATCH 29/35] pkg-generic: don't use DL_MODE in .stamp_downloaded Thomas Petazzoni
2015-03-29 17:33 ` [Buildroot] [PATCH 30/35] pkg-download: get rid of DL_MODE Thomas Petazzoni
2015-03-29 17:33 ` [Buildroot] [PATCH 31/35] pkg-download: fix indentation for SOURCE_CHECK_* macros Thomas Petazzoni
2015-03-29 17:33 ` [Buildroot] [PATCH 32/35] pkg-generic: propagate <pkg>_EXTRA_DOWNLOADS from target to host package Thomas Petazzoni
2015-03-29 17:33 ` [Buildroot] [PATCH 33/35] pkg-generic: introduce a <pkg>_ALL_DOWNLOADS variable and factorize code Thomas Petazzoni
2015-03-29 17:33 ` [Buildroot] [PATCH 34/35] Makefile: implement the 'source' target using the package infrastructure Thomas Petazzoni
2015-03-29 17:33 ` [Buildroot] [PATCH 35/35] Makefile: remove unneeded variables Thomas Petazzoni
2015-03-29 22:28 ` [Buildroot] [PATCH 00/35] Package based 'source', 'legal-info', 'source-check' and 'external-deps' Yann E. MORIN
2015-03-30  7:23   ` Thomas Petazzoni
2015-03-30 21:42 ` Thomas Petazzoni
2015-04-06  9:33 ` Thomas Petazzoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150329213551.GI4093@free.fr \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox