public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "Maxim Yu. Osipov" <mosipov@ilbers.de>
To: Jan Kiszka <jan.kiszka@siemens.com>,
	isar-users <isar-users@googlegroups.com>
Cc: "Su, Bao Cheng (RC-CN DF FA R&D)" <baocheng.su@siemens.com>
Subject: Re: [PATCH] patch: Add support for patches in sub-directories
Date: Tue, 14 May 2019 14:42:02 +0200	[thread overview]
Message-ID: <4a80e2a0-9e91-f1b4-e155-303f83aa4e3b@ilbers.de> (raw)
In-Reply-To: <529c6ca1-0270-1323-07a2-7f0827329abb@siemens.com>

On 4/29/19 10:37 AM, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
> 
> The patch class was assuming that the file is flat in the workdir after
> unpack. That may not be true. Enhance the logic and add a test case to
> hello-isar.

Applied to the 'next'.

Thanks,
Maxim.

> Reported-by: Su Bao Cheng <baocheng.su@siemens.com>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>   .../hello-isar/files/{ => subdir}/0001-Add-some-help.patch       | 0
>   meta-isar/recipes-app/hello-isar/hello-isar.bb                   | 2 +-
>   meta/classes/patch.bbclass                                       | 9 +++++----
>   3 files changed, 6 insertions(+), 5 deletions(-)
>   rename meta-isar/recipes-app/hello-isar/files/{ => subdir}/0001-Add-some-help.patch (100%)
> 
> diff --git a/meta-isar/recipes-app/hello-isar/files/0001-Add-some-help.patch b/meta-isar/recipes-app/hello-isar/files/subdir/0001-Add-some-help.patch
> similarity index 100%
> rename from meta-isar/recipes-app/hello-isar/files/0001-Add-some-help.patch
> rename to meta-isar/recipes-app/hello-isar/files/subdir/0001-Add-some-help.patch
> diff --git a/meta-isar/recipes-app/hello-isar/hello-isar.bb b/meta-isar/recipes-app/hello-isar/hello-isar.bb
> index 5806f9e..144a433 100644
> --- a/meta-isar/recipes-app/hello-isar/hello-isar.bb
> +++ b/meta-isar/recipes-app/hello-isar/hello-isar.bb
> @@ -16,7 +16,7 @@ DEPENDS += "libhello"
>   
>   SRC_URI = " \
>       git://github.com/ilbers/hello.git;protocol=https;destsuffix=${P} \
> -    file://0001-Add-some-help.patch \
> +    file://subdir/0001-Add-some-help.patch \
>       file://yet-another-change.txt;apply=yes;striplevel=0"
>   SRCREV = "a18c14cc11ce6b003f3469e89223cffb4016861d"
>   
> diff --git a/meta/classes/patch.bbclass b/meta/classes/patch.bbclass
> index bb203b7..2662702 100644
> --- a/meta/classes/patch.bbclass
> +++ b/meta/classes/patch.bbclass
> @@ -40,8 +40,8 @@ python do_patch() {
>               if apply == "no":
>                   continue
>   
> -            basename = fetcher.ud[src_uri].basename or ""
> -            if not (basename.endswith(".patch") or apply == "yes"):
> +            path = fetcher.ud[src_uri].path or ""
> +            if not (path.endswith(".patch") or apply == "yes"):
>                   continue
>   
>               patchdir = fetcher.ud[src_uri].parm.get("patchdir") or src_dir
> @@ -54,8 +54,9 @@ python do_patch() {
>   
>               cmds = open(applied_patches_dir + ".patch-commands", "a")
>   
> -            patch_file = applied_patches_dir + basename
> -            shutil.copyfile(workdir + basename, patch_file)
> +            patch_file = applied_patches_dir + path
> +            bb.utils.mkdirhier(os.path.dirname(patch_file))
> +            shutil.copyfile(workdir + path, patch_file)
>   
>               striplevel = fetcher.ud[src_uri].parm.get("striplevel") or "1"
>   
> 


-- 
Maxim Osipov
ilbers GmbH
Maria-Merian-Str. 8
85521 Ottobrunn
Germany
+49 (151) 6517 6917
mosipov@ilbers.de
http://ilbers.de/
Commercial register Munich, HRB 214197
General Manager: Baurzhan Ismagulov

      reply	other threads:[~2019-05-14 12:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-29  8:37 Jan Kiszka
2019-05-14 12:42 ` Maxim Yu. Osipov [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=4a80e2a0-9e91-f1b4-e155-303f83aa4e3b@ilbers.de \
    --to=mosipov@ilbers.de \
    --cc=baocheng.su@siemens.com \
    --cc=isar-users@googlegroups.com \
    --cc=jan.kiszka@siemens.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox