All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Quentin Schulz" <foss@0leil.net>
To: openembedded-core@lists.openembedded.org,
	Jose Quaresma <quaresma.jose@gmail.com>
Subject: Re: [OE-core] [PATCH v3] patch.bbclass: check if patchdir exist
Date: Thu, 19 Aug 2021 11:53:39 +0200	[thread overview]
Message-ID: <BE9AF7EF-C06C-4F6B-A1D0-DDB3A6C21D3E@0leil.net> (raw)
In-Reply-To: <20210819082934.10907-1-quaresma.jose@gmail.com>

Hi Jose,

On August 19, 2021 10:29:34 AM GMT+02:00, Jose Quaresma <quaresma.jose@gmail.com> wrote:
>if the user specifies path on 'patchdir' that don't exist,
>the patch will fail and there are no message that indicates the real cause.
>
>Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
>---
> meta/classes/patch.bbclass | 2 ++
> 1 file changed, 2 insertions(+)
>
>diff --git a/meta/classes/patch.bbclass b/meta/classes/patch.bbclass
>index 559c6f45bd..1e9a024bf9 100644
>--- a/meta/classes/patch.bbclass
>+++ b/meta/classes/patch.bbclass
>@@ -131,6 +131,8 @@ python patch_do_patch() {
>             patchdir = parm["patchdir"]
>             if not os.path.isabs(patchdir):
>                 patchdir = os.path.join(s, patchdir)
>+            if not os.path.isdir(patchdir):
>+                bb.fatal("Patch source directory don't found '%s'" % patchdir)

In your text, it should be "not" and not "don't".

I could suggest also:

patchdir '%s' not found

Or explicit in the message that "Patch source directory" not found means "patchdir" is incorrect somewhere in SRC_URI.

I think you could even tell which patch file has its patchdir incorrect by printing the "local" variable. Not sure it brings anything, just thinking out loud 😁

Anyway, I like this patch, but it does not have the same purpose as the earlier version of this patch series. I think it is also important to print the patchdir when the patch tool fails to apply the patch. It might be because the path exists but is incorrect.

So it'd be awesome if we can get the patchdir in the fatal message when the patch fails to apply. My understanding of patch.bbclass and lib/oe/patch.py is that resolver.Resolve() is doing the patching so in that except thr patchdir could be printed.

Many thanks!
Quentin

  reply	other threads:[~2021-08-19  9:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-19  8:29 [PATCH v3] patch.bbclass: check if patchdir exist Jose Quaresma
2021-08-19  9:53 ` Quentin Schulz [this message]
2021-08-20  8:29   ` [OE-core] " Jose Quaresma

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=BE9AF7EF-C06C-4F6B-A1D0-DDB3A6C21D3E@0leil.net \
    --to=foss@0leil.net \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=quaresma.jose@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.