From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6854631734520053760 X-Received: by 2002:a1c:964d:: with SMTP id y74mr5725141wmd.80.1595968318580; Tue, 28 Jul 2020 13:31:58 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a1c:48c1:: with SMTP id v184ls2092679wma.1.gmail; Tue, 28 Jul 2020 13:31:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwprL8n8FTrP9GaAGBHnWcSnXJqrq2SUI1CphDvdn8ouEhHIaslZOpHUZT9wNLnxURITf15 X-Received: by 2002:a7b:c8c9:: with SMTP id f9mr5845957wml.40.1595968318087; Tue, 28 Jul 2020 13:31:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595968318; cv=none; d=google.com; s=arc-20160816; b=gDJHhEJrtM6KOwdjoXI7Kq3K8L1gE1vSwsNG54bYN5vvLSbKqSrinzugIYijKoYQiv NGSX+kWXOBdVAfjNeNBSezz83iyF7PloxwxjsF8xqD4FYBFDp0rc52/41SOvUZ0zDUrD WSEZ8ZUF5FzSbDq6aAvb4hkKBtT0GJBnPfJrVnhENvNQeQlFKVkXDt3PLoAI3ONQVteX R8TwS56rEHAdiY69cMJLGejU/PSz8qxHK04YzqLvlqhmHQQ2Q9gcth0+J/0y+GE7KEoM fhsuLo+VWv/3WvTuua4c5SNfVSpKpSOjdhfV20lBmWCx/oh9kZE1f9GGz3ivnUhdNU/c RZnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from; bh=/+pgEH+mxZlXBsYBzHM6qgiuv8WdVEMJAkfVFT8zP/4=; b=G171Ss4909Ho+fMAFUwVQQ8Gv/S5QhNqyPywFGb2lT0IHz/vCAKR3a62nynVimIUKw OV0831PkODCPmZ7ElvhvRjc68wv+2huhhdS0rvApKwQwkFn05CmWa3H3V3/CRPL17iyN YN8Ad3Thh0dbbH6CQwOZobQLhHs/X1Mhc826lmHMI6Iq/KBnSl3k3uJJnhsXS2KxpQVi LIyII+iLZSfZeQMRCF4le05qCrY1RKnLswEKlqBGm0VG/iVnkb5+2D0XiHk6OlhIfoRy kyXRyPtH3gDcHfLYh2h2Bz/3ocjPt5Un1mVQ1dxnTl5/fmhAqc1xcyMeYYd6JBIxxV0n ktjw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.2 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 thoth.sbs.de (thoth.sbs.de. [192.35.17.2]) by gmr-mx.google.com with ESMTPS id m3si544wme.0.2020.07.28.13.31.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Jul 2020 13:31:58 -0700 (PDT) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.2 as permitted sender) client-ip=192.35.17.2; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=henning.schild@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 thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id 06SKVvqO011245 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 28 Jul 2020 22:31:57 +0200 Received: from localhost.localdomain ([158.92.8.82]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id 06SKVv8o000918; Tue, 28 Jul 2020 22:31:57 +0200 From: Henning Schild To: isar-users@googlegroups.com Cc: Henning Schild Subject: [PATCH 1/2] patch: special-case quilt in debian Date: Tue, 28 Jul 2020 22:31:52 +0200 Message-Id: <20200728203153.792-1-henning.schild@siemens.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUID: m6Nw69hQTbW0 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 -- 2.26.2