public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Henning Schild <henning.schild@siemens.com>
Cc: isar-users@googlegroups.com
Subject: Re: [PATCH 1/2] patch: special-case quilt in debian
Date: Wed, 29 Jul 2020 17:06:54 +0200	[thread overview]
Message-ID: <1f3a959a-ed20-911f-dea0-9af5687188e3@siemens.com> (raw)
In-Reply-To: <20200729163630.2e9cab45@md1za8fc.ad001.siemens.net>

On 29.07.20 16:36, Henning Schild wrote:
> On Wed, 29 Jul 2020 16:06:03 +0200
> Jan Kiszka <jan.kiszka@siemens.com> wrote:
> 
>> On 28.07.20 22:31, [ext] Henning Schild wrote:
>>> From: Henning Schild <henning.schild@siemens.com>
>>>
>>> The OE patch lib uses quilt and so do many debian packages as well.
>>> Those two do not work well together, it is really hard to create a
>>> patch that will apply and not break what debian does later. debian
>>> is very pedantic about unexpected changes so even if patching
>>> works, building might not.
>>>
>>> Introduce a special-case where we detect quilt usage of a debian
>>> package and hook in there. Also make sure we are on top of debian
>>> so we do not risk breaking patches we inherit from there.
>>>
>>> If anyone ever managed to create a patch that works well in the
>>> face of two quilts, that might break with this change. You can set
>>> PATCHTOOL to "quilt" in your recipe to disable the magic.
>>>
>>> Signed-off-by: Henning Schild <henning.schild@siemens.com>
>>> ---
>>>    meta/classes/patch.bbclass | 28 ++++++++++++++++++++++++++++
>>>    1 file changed, 28 insertions(+)
>>>
>>> diff --git a/meta/classes/patch.bbclass b/meta/classes/patch.bbclass
>>> index 3060755a5c..06f32a2197 100644
>>> --- a/meta/classes/patch.bbclass
>>> +++ b/meta/classes/patch.bbclass
>>> @@ -91,6 +91,28 @@ def should_apply(parm, d):
>>>    
>>>    should_apply[vardepsexclude] = "DATE SRCDATE"
>>>    
>>> +def patch_do_debian_quilt(patchdir, d):
>>> +    import oe.patch
>>> +    class DummyPatchSet(oe.patch.PatchSet):
>>> +        def Clean(self):
>>> +            True
>>> +
>>> +        def Import(self, patch, force):
>>> +            os.putenv('QUILT_PATCHES', 'debian/patches')
>>> +            # push all so we are on top of debian
>>> +            pushed = False
>>> +            if os.path.exists(os.path.join(self.dir,
>>> 'debian/patches/series')):
>>> +                oe.patch.runcmd(["quilt", "push", "-a"], self.dir)
>>> +                pushed = True
>>> +            oe.patch.runcmd(["quilt", "import", "-f",
>>> os.path.join(d.getVar('WORKDIR'),
>>> os.path.basename(patch['file']))], self.dir)
>>> +            if pushed:
>>> +                oe.patch.runcmd(["quilt", "pop", "-a"], self.dir)
>>> +
>>> +        def Push(self, force = False):
>>> +            True
>>> +
>>> +    return DummyPatchSet(patchdir, d)
>>> +
>>>    python patch_do_patch() {
>>>        import sys
>>>    
>>> @@ -118,6 +140,12 @@ python patch_do_patch() {
>>>    
>>>        s = d.getVar('S')
>>>    
>>> +    debianformat = os.path.join(s, 'debian/source/format')
>>> +    if os.path.exists(debianformat) and d.getVar('PATCHTOOL') !=
>>> 'quilt':
>>> +        with open(debianformat, 'r+') as f:
>>> +            if f.readline() == '3.0 (quilt)\n':
>>> +                cls = patch_do_debian_quilt
>>> +
>>>        os.putenv('PATH', d.getVar('PATH'))
>>>    
>>>        # We must use one TMPDIR per process so that the "patch"
>>> processes
>>
>> I'm not yet sure I understand the use case of this. Does it obsolete
>> something like
>>
>> https://github.com/siemens/meta-iot2050/blob/master/recipes-security/openssl/openssl_1.1.1d.bb#L22
>>
>> ie. the quilt import and push? Or where does it help?
> 
> With the proposed patch your example could drop all but
> deb_add_changelog together with the apply=no.
> 

That would be nice.

But it seems for your other reply you need another round to address 
apt:// as well. Now you know where to find a test case ;).

Jan

-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux

  reply	other threads:[~2020-07-29 15:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-28 20:31 Henning Schild
2020-07-28 20:31 ` [PATCH 2/2] meta-isar: make sure to quilt patch a debian package Henning Schild
2020-07-28 20:40   ` Henning Schild
2020-07-28 20:33 ` [PATCH 1/2] patch: special-case quilt in debian Henning Schild
2020-07-29 14:06 ` Jan Kiszka
2020-07-29 14:36   ` Henning Schild
2020-07-29 15:06     ` Jan Kiszka [this message]
2020-07-29 14:39 ` Henning Schild
2020-07-29 15:08 ` Henning Schild
2020-07-29 15:31   ` Jan Kiszka
2020-07-29 19:48     ` Henning Schild
2021-02-08 15:50       ` Anton Mikanovich
2021-02-08 16:18         ` Henning Schild

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=1f3a959a-ed20-911f-dea0-9af5687188e3@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=henning.schild@siemens.com \
    --cc=isar-users@googlegroups.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