From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6854631734520053760 X-Received: by 2002:a1c:1d92:: with SMTP id d140mr9286214wmd.143.1596035216858; Wed, 29 Jul 2020 08:06:56 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:adf:b1cf:: with SMTP id r15ls1518134wra.3.gmail; Wed, 29 Jul 2020 08:06:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyODXDGDSoGlPVLYmw7U3uyaXQ9tD4+lIeRb7DZLf3zPDBV9Ak2AU9tN8LirfSUIh0cMmzL X-Received: by 2002:adf:ed48:: with SMTP id u8mr31749705wro.64.1596035216170; Wed, 29 Jul 2020 08:06:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596035216; cv=none; d=google.com; s=arc-20160816; b=iavj+iu8Jn3tiI9MrE9PnP4pAd3yAiw5zIzA8O/1cKcqTCa/BZJk2GLKOhqk8au218 q3jPNiMQt0qSqu418k8SD1DlOwa/iCvgZcAhIaet0tFtRe8CqDRCES+NE1CxSwkqupeU /HhdWAKT727AywISMcbejluMbD/8o0NZv5gMj2mFp5+uayRE5CphR7pURFXv/pwhDl/v 2YdAgbNcFyAGrtl+1SnEUorkAop8WfqtXqyRmSg7cLYIl+AjJQAhxhuutQ2vIIpz65Em XFZ5sbXKxRYh9T04AJqDs9BBaBLi5XdlPO3+gujUj3wIRopONGFg2jU+kOSJDJ3ACSgU Mqsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject; bh=jL3E6NjGb2ucYpSCbMDL/tYcvfG7xNKDwCfNr4qI2UU=; b=vBWmqWMJ0Ods/55DbZLBjG9numZRgqIqqkadbxs4xXNEqGrcXtV/919IK5V3WeRSs0 VSbkwsupZvFpAKDfXLSnFXbxUmg3sy+ZL14UTbK5JKy9jmg0T7JJuRYR3nvRcyCk0XJM h7Xyq4DBuogvUK5R6laIOOaPj59CdL+h8kZZQUyrX+P4EWlE2mmm0H0GbVUPqr2o8Mll Md03fdW+FtApCswEyp36glkt6IQZi4J61E3GeUCyRAelDkf9vp6YAGBvnFaMOjwNvQiI 16+UVuyVeSeJAwWNvBExNmIhyDxdIyVUjXv3JKkFGl0HUPNYNAD6EVwsPs2jUYo48Im7 zohg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from david.siemens.de (david.siemens.de. [192.35.17.14]) by gmr-mx.google.com with ESMTPS id b191si74398wme.1.2020.07.29.08.06.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Jul 2020 08:06:56 -0700 (PDT) Received-SPF: pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.14 as permitted sender) client-ip=192.35.17.14; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by david.siemens.de (8.15.2/8.15.2) with ESMTPS id 06TF6th6025690 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 29 Jul 2020 17:06:55 +0200 Received: from [167.87.13.2] ([167.87.13.2]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id 06TF6sC7029142; Wed, 29 Jul 2020 17:06:55 +0200 Subject: Re: [PATCH 1/2] patch: special-case quilt in debian To: Henning Schild Cc: isar-users@googlegroups.com References: <20200728203153.792-1-henning.schild@siemens.com> <20200729163630.2e9cab45@md1za8fc.ad001.siemens.net> From: Jan Kiszka Message-ID: <1f3a959a-ed20-911f-dea0-9af5687188e3@siemens.com> Date: Wed, 29 Jul 2020 17:06:54 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200729163630.2e9cab45@md1za8fc.ad001.siemens.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: FWWro0EzkPE4 On 29.07.20 16:36, Henning Schild wrote: > On Wed, 29 Jul 2020 16:06:03 +0200 > Jan Kiszka wrote: > >> On 28.07.20 22:31, [ext] Henning Schild wrote: >>> From: Henning Schild >>> >>> 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 >>> --- >>> 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