[OE-core] [PATCH 1/1] lib/oe/patch.py: Fix applying a directory as a patch

Tomasz Dziendzielski tomasz.dziendzielski at gmail.com
Sat Jan 26 10:47:39 UTC 2019


sob., 26 sty 2019 o 11:34 Richard Purdie
<richard.purdie at linuxfoundation.org> napisał(a):
>
> On Fri, 2019-01-25 at 20:55 +0100, Tomasz Dziendzielski wrote:
> > If a SRC_URI content ends with '.patch' bitbake is
> > trying to apply it as it's a patch file.
> >
> > It causes that if we use git repository for 'patch' package
> > the bare clone is extracted to a directory
> > (i.e. build/downloads/git2/git.mirror.org.patch/) which is considered
> > to be a patch file, so patch.py tries to apply that directory as a
> > patch
> > which ends up with a failure.
> >
> > Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski at gmail.com>
> > ---
> >  meta/lib/oe/patch.py | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py
> > index 07a40fc50e..3d0b7d7289 100644
> > --- a/meta/lib/oe/patch.py
> > +++ b/meta/lib/oe/patch.py
> > @@ -793,6 +793,8 @@ def patch_path(url, fetch, workdir, expand=True):
> >      """Return the local path of a patch, or None if this isn't a
> > patch"""
> >
> >      local = fetch.localpath(url)
> > +    if os.path.isdir(local):
> > +        return
>
> This doesn't match the comment above, "None if this isn't a patch"?
> Does the rest of the function use "return" or "return None"? It won't
> matter in practise to python but we should be consistent and fix the
> value or the comment.
>
> Cheers,
>
> Richard
>

The rest of the function use "return". You prefer me to change the
comment in a second commit to keep the changes separated or just do it
within this one?

Best regards,
Tomasz Dziendzielski


More information about the Openembedded-core mailing list