From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6854631734520053760 X-Received: by 2002:a1c:9901:: with SMTP id b1mr6034736wme.68.1595968433802; Tue, 28 Jul 2020 13:33:53 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a5d:6407:: with SMTP id z7ls3499wru.0.gmail; Tue, 28 Jul 2020 13:33:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwieaUeWvsGqtc6NLH60ZTMw2H5zuA9BWaOSdbnqycZUCgDyXUK3kM6RUisLAD/b6OisOfV X-Received: by 2002:a5d:45c9:: with SMTP id b9mr26000214wrs.283.1595968433294; Tue, 28 Jul 2020 13:33:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595968433; cv=none; d=google.com; s=arc-20160816; b=HxJQiPsIvsQ/rfiwTH75YQJuRXTDzzmsqqFNEXPDCCEqfQJrs/zRMLORxsZUoD5KT9 CWiMAIZWJkw2NrIwO7aV5HM+V2uGbnkKHuzeNTzAMmU45MtzfxYaLmG9NJ7KlbEjhqTk IJMeJOflf9h4C6tpBTTI6LriqLcrlpnpfCmTtKyW6pQQf3zgYaPJqtLHvSK1WT8VSBBm jVoj0GleioZRmqT+mPQY7HvYQHt0kb2KDEj4pXc/TTZRug7S8iS9u9rXcvLjauG0WLsM R36zDqEpK59ln6QZBuX1j4cE66bypMuwXXL6cDrtOWyTnj3iJo9HfJ+h7Xru6WwRBdUC sSuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:to:from:date; bh=Mt+ZU28BP13A0evTILajifhr059lHYIiqozZcOVmnB8=; b=Jng/2d4vc/NsaFx3V8DsPPtB6h1Rh1NW3EO6VVky59QPXxgjAi9uCebcO6G7U5l3hb TTMhxIQ2af4OHIYPVqXgXgKyza8YGd5zLnwN85PTK3Yf+2fTKffAWrVjZu3Z8/dS+J5D emWWOKkdVqkh6+gzVj9BFCg+tk9zneiYyOP/vksxESntLhVGbz7K8Oelrx+pUPPM+Lfn wwODezvOnEdEn1UaJAH0h2ggZ9s1Pl0oMyZYAYNR0azcbgiZFIEFLy5QXFiWPtSqRAJd Fr1o85+C/AevPClLr05dq2ceHwJkA9pS0MBLV+ymrH0SVI/eEzff5rPkEhQNGENioe+X ydgg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.39 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from lizzard.sbs.de (lizzard.sbs.de. [194.138.37.39]) by gmr-mx.google.com with ESMTPS id s79si161978wme.4.2020.07.28.13.33.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Jul 2020 13:33:53 -0700 (PDT) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.39 as permitted sender) client-ip=194.138.37.39; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.39 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by lizzard.sbs.de (8.15.2/8.15.2) with ESMTPS id 06SKXqLR002625 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 28 Jul 2020 22:33:53 +0200 Received: from md1za8fc.ad001.siemens.net ([158.92.8.82]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id 06SKXqjf026677 for ; Tue, 28 Jul 2020 22:33:52 +0200 Date: Tue, 28 Jul 2020 22:33:51 +0200 From: Henning Schild To: Subject: Re: [PATCH 1/2] patch: special-case quilt in debian Message-ID: <20200728223351.395ca93a@md1za8fc.ad001.siemens.net> In-Reply-To: <20200728203153.792-1-henning.schild@siemens.com> References: <20200728203153.792-1-henning.schild@siemens.com> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: N5gngVPmn85J Patching has always been a huge pain, please test this and let me know if it works for your layers. Henning On Tue, 28 Jul 2020 22:31:52 +0200 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