Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] apply-patches.sh: handle any file name as *.patch
Date: Thu, 10 Mar 2016 14:37:25 +0100	[thread overview]
Message-ID: <20160310143725.7a1ac7aa@free-electrons.com> (raw)
In-Reply-To: <1457608789-32336-1-git-send-email-yegorslists@googlemail.com>

Hello,

On Thu, 10 Mar 2016 12:19:49 +0100, yegorslists at googlemail.com wrote:
> From: Yegor Yefremov <yegorslists@googlemail.com>
> 
> Handle both *.patch and default cases as *.patch. This is needed
> in order to handle downloaded patches generated by for example
> cgit, that have no file name extension.
> 
> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
> ---
>  support/scripts/apply-patches.sh | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/support/scripts/apply-patches.sh b/support/scripts/apply-patches.sh
> index 201278d..e4cccf5 100755
> --- a/support/scripts/apply-patches.sh
> +++ b/support/scripts/apply-patches.sh
> @@ -83,12 +83,8 @@ function apply_patch {
>              type="compress"; uncomp="uncompress -c"; ;;
>              *.diff*)
>              type="diff"; uncomp="cat"; ;;
> -            *.patch*)
> +            *.patch*|*)
>              type="patch"; uncomp="cat"; ;;
> -            *)
> -            echo "Unsupported file type for ${path}/${patch}, skipping";
> -            return 0
> -            ;;

Unfortunately, this might break some existing use cases. Today, you can
point to a directory of patches, and only the *.patch* or *.diff* files
will be applied, other files will be ignored and not applied.

With your change, if there is any other file in the directory, it will
also attempt to apply it.

Maybe we need to have a different behavior depending on whether we pass
a directory to apply-patches.sh, or a file. If we specify a file, then
we really want that file to be applied, regardless of its extension.
However, if it's a directory, then we don't want to apply all files.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

  reply	other threads:[~2016-03-10 13:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-10 11:19 [Buildroot] [PATCH] apply-patches.sh: handle any file name as *.patch yegorslists at googlemail.com
2016-03-10 13:37 ` Thomas Petazzoni [this message]
2016-03-10 22:44   ` Arnout Vandecappelle
2016-03-12 23:22   ` Yann E. MORIN
2016-03-13 21:48     ` Arnout Vandecappelle

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=20160310143725.7a1ac7aa@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.com \
    --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