All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Eggers <ceggers@arri.de>
To: <openembedded-core@lists.openembedded.org>,
	Pavel Zhukov <pavel@zhukoff.net>
Cc: <pavel@zhukoff.net>, Pavel Zhukov <pavel.zhukov@huawei.com>
Subject: Re: [PATCH v2] patch.py: Prevent git repo reinitialization
Date: Mon, 21 Feb 2022 18:29:09 +0100	[thread overview]
Message-ID: <21381279.EfDdHjke4D@localhost.localdomain> (raw)
In-Reply-To: <20220221142006.6501-1-pavel@zhukoff.net>

On Monday, 21 February 2022, 15:20:07 CET, Pavel Zhukov wrote:
> There were few bugs in the _isInitialized() function which might trigger
> git repo to be reinitialized and patches failing to apply.
> 
> Signed-off-by: Pavel Zhukov <pavel.zhukov@huawei.com>
> ---
>  .../net-tools/Add_missing_headers.patch       |  15 +++
>  .../net-tools/net-tools/net-tools-config.h    |  75 +++++++++++
>  .../net-tools/net-tools/net-tools-config.make |  36 ++++++
>  .../recipes-test/net-tools/net-tools_2.10.bb  | 121 ++++++++++++++++++
>  meta/lib/oe/patch.py                          |   6 +-
>  meta/lib/oeqa/selftest/cases/bbtests.py       |  20 ++-
>  6 files changed, 268 insertions(+), 5 deletions(-)
>  create mode 100644 meta-selftest/recipes-test/net-tools/net-tools/Add_missing_headers.patch
>  create mode 100644 meta-selftest/recipes-test/net-tools/net-tools/net-tools-config.h
>  create mode 100644 meta-selftest/recipes-test/net-tools/net-tools/net-tools-config.make
>  create mode 100644 meta-selftest/recipes-test/net-tools/net-tools_2.10.bb
> 
> [...]
>
> diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py
> index 950fe723dc..2163e336c2 100644
> --- a/meta/lib/oe/patch.py
> +++ b/meta/lib/oe/patch.py
> @@ -304,14 +304,14 @@ class GitApplyTree(PatchTree):
>  
>      def _isInitialized(self):
>          cmd = "git rev-parse --show-toplevel"
> -        (status, output) = subprocess.getstatusoutput(cmd.split())
> +        (status, output) = subprocess.getstatusoutput(cmd)
>          ## Make sure repo is in builddir to not break top-level git repos
> -        return status == 0 and os.path.samedir(output, self.dir)
> +        return status == 0 and os.path.samefile(output, self.dir)

I have the following variable values here:
- status: 0
- output: /home/eggers/<...>/yocto
- self.dir: /home/eggers/<...>/build/devel-kirkstone/tmp/work/orbiter-poky-linux-musleabi/linux-stable-rt/5.10.100-rt62-orbiter+gitAUTOINC+ca44e6dff2-r0/git

So os.path.samefile() returns false and the existing Git repository
is still reinitialized.

regards
Christian





      parent reply	other threads:[~2022-02-21 17:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-21 14:20 [PATCH v2] patch.py: Prevent git repo reinitialization Pavel Zhukov
2022-02-21 16:42 ` [OE-core] " Richard Purdie
2022-02-21 17:29 ` Christian Eggers [this message]

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=21381279.EfDdHjke4D@localhost.localdomain \
    --to=ceggers@arri.de \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=pavel.zhukov@huawei.com \
    --cc=pavel@zhukoff.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 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.