public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Alberto Pianon <alberto@pianon.eu>
To: Openembedded Core <openembedded-core@lists.openembedded.org>
Subject: getPatchedFiles in oe.patch doesn't correctly handle filenames with spaces
Date: Wed, 19 Oct 2022 17:40:51 +0200	[thread overview]
Message-ID: <9b185ae6cf064eacc0f7c4b2d5d12e5d@pianon.eu> (raw)

Hi All,

by using Tinfoil together with methods found in oe.* to do software 
composition analysis, I encountered an error: when parsing python3 
recipe, I found patch file 
[0001-gh-92036-Fix-gc_fini_untrack-GH-92037.patch](https://git.yoctoproject.org/poky/tree/meta/recipes-devtools/python/python3/0001-gh-92036-Fix-gc_fini_untrack-GH-92037.patch?h=kirkstone) 
which refers to a filename with spaces:

+++ b/Misc/NEWS.d/next/Core and 
Builtins/2022-04-28-23-37-30.gh-issue-92036.GZJAC9.rst

when using function oe.recipeutils.get_recipe_patched_files(d), the file 
above is returned as "b/Misc/NEWS.d/next/Core", missing the whole part 
after the space.

The problem lies in [function 
patchedpath]((https://git.yoctoproject.org/poky/tree/meta/lib/oe/patch.py?h=kirkstone#n126) 
within the static method getPatchedFiles in poky/meta/lib/oe/patch.py, 
which assumes that there are no spaces in filenames

filepth = patchline.split()[1]

Even if spaces in filenames are bad practice, my understanding is that 
they are allowed by git diff and should be supported.

To solve this issue, the above line may be modified as follows

filepth = patchline[4:]

Should I submit a patch for that?

Regards,

Alberto




             reply	other threads:[~2022-10-19 15:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-19 15:40 Alberto Pianon [this message]
2022-10-19 16:20 ` [OE-core] getPatchedFiles in oe.patch doesn't correctly handle filenames with spaces Ross Burton

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=9b185ae6cf064eacc0f7c4b2d5d12e5d@pianon.eu \
    --to=alberto@pianon.eu \
    --cc=openembedded-core@lists.openembedded.org \
    /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