From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6854631734520053760 X-Received: by 2002:a2e:89cc:: with SMTP id c12mr15619160ljk.187.1596033561206; Wed, 29 Jul 2020 07:39:21 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a19:4f43:: with SMTP id a3ls871397lfk.3.gmail; Wed, 29 Jul 2020 07:39:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvo0J3im8/m0lp40OoxGpTZqISj8YLuDVkx6dP5eHJNAHQgubTBWoGtv1dKVjasO9z9Z3q X-Received: by 2002:a19:848d:: with SMTP id g135mr17619618lfd.1.1596033560589; Wed, 29 Jul 2020 07:39:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596033560; cv=none; d=google.com; s=arc-20160816; b=0T8xolPiXczGTl7c7/+P9I2rFg3Dov7jNIYSm+pxTC0h5DTV7rQPRZ1/tjkagYWxi8 XiYFBF8ECbnS39TQCAfJthY78ZxNx9j2imER8uDojCh3LCOYXleAKAkmkr+PseN/mRDW OZeLwQDeo11oULCiid1VKYNUO2aUgspip/MOZvty8GwxVg6NS4hwwC6zFW8DtjH6i6Ie y4PXsEUjXmsm3/XBptLmtAdp4MkUVLXmcAGzCIClBMM1PmaGysoZIWV82359DX/Wq671 dL43FzJ9B/4gjN+pymdbvoFYIateVYkPrPVeSrv2E4VokEIs+/r6clgc7rGcTcbvMxHJ t8ww== 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:cc:to:from:date; bh=e35S40B77JDajMQ4LaAPSa5YTWz/aBu3SeccXu6fjlU=; b=CaRfzwrx5ahN1PK8aOLCDBWCut2V27tVdBm6fJTKcu8xt6NP7kCwGFaBhIDHNGzHGG OMTAReL0tBKDnHD0ZVn84Ue6O+z6tcv8h9I+YZHVHWnVmSp44S6LhUAb+O6kTfebCmOV M8NCfeaTPb6QrEpFpe8fR5wftrAErFQoUiViTk+oPHFdKOK3D5hBIyV+Pu9GAh2nqSoQ CacBpOETlK5k66szu35Ws7PzcIANdqc1p/qJOO39IxLV4NtkzuN53gqjzEQybEeYAEeG ta19Yk1GTFruOWzS74Q3oa4MPHCAkIqR+VFY8/vhQu7+BRzf91urAWYufx1p2jqaS14T +beg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.14 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 david.siemens.de (david.siemens.de. [192.35.17.14]) by gmr-mx.google.com with ESMTPS id k9si86192ljj.5.2020.07.29.07.39.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Jul 2020 07:39:20 -0700 (PDT) Received-SPF: pass (google.com: domain of henning.schild@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 henning.schild@siemens.com designates 192.35.17.14 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 david.siemens.de (8.15.2/8.15.2) with ESMTPS id 06TEdJgY004098 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 29 Jul 2020 16:39:19 +0200 Received: from md1za8fc.ad001.siemens.net ([158.92.8.82]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id 06TEdJ8p026655; Wed, 29 Jul 2020 16:39:19 +0200 Date: Wed, 29 Jul 2020 16:39:18 +0200 From: Henning Schild To: Cc: "Schmidt, Adriaan (CT RDA IOT SES-DE)" Subject: Re: [PATCH 1/2] patch: special-case quilt in debian Message-ID: <20200729163918.29183eeb@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: FVoeQI56frir 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) We might actually find ourselves in a situation where the debian quilt series is already pushed. That happens when using an "apt://" SRC_URI. While i already have a mitigation patch i think the whole thing needs more discussion and i will send another mail. Henning > + 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