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 <[email protected]>
> ---
>  .../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



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#162061): 
https://lists.openembedded.org/g/openembedded-core/message/162061
Mute This Topic: https://lists.openembedded.org/mt/89294279/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to