From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7010292021791293440 X-Received: by 2002:a2e:5059:: with SMTP id v25mr28422480ljd.416.1632297258994; Wed, 22 Sep 2021 00:54:18 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6512:324d:: with SMTP id c13ls153898lfr.0.gmail; Wed, 22 Sep 2021 00:54:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwB1jcMr4Vth4iNPvQhALG5EKvoXD9aCSwcAsvB9JERMygpikDyR7DAF8c5InVLxj1fFiBH X-Received: by 2002:ac2:43b1:: with SMTP id t17mr25861267lfl.373.1632297257929; Wed, 22 Sep 2021 00:54:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632297257; cv=none; d=google.com; s=arc-20160816; b=Cn1fxzqd3IdoN0fTphtjsHRaPRL21E1/W8rdMmoZHwcGCTrkVOqFAnPOxtqFrguLLD rlikQMcpTdeu/dwTWjKXhN6rp4KSotTHH9FkwxRHYPpir0myjdkTzJUz2OwEAFQ6hGn5 uu1+b7n8zsXwTPoUKRdGV7SUUCORJHX9PkgD1k8xBGsdHln4nouozWE9zWKGkek0ykTF Q6YSvnLRdaqCe2eg7s0+KXPGXzvpTrdeeVth07YS2uMDJ13/jXjlkmSWZwSBSbF+xKIW /nuxmmi0rEO6IuK+MoZAL7ubRLZMpsB0gPAetheq5cZSg1Vn+0C6ddkfJg0D0Dg0xYUr /9aw== 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=Hm1duYMYELHdrJj38KtRpgAhwdXo1EAW2JjqokRAmAA=; b=GiEGYD1O1zCf3l96cocwVlfhdxbdXFGvhtc04p9ud/Vp6U5Pnua2p6Tv92WgZLmFhe ZdhtnMpm1oq/gdBmUoGVifYb1L3G7mfbBovGPjfsNSjYksri/oevZHjnqTW+zB+ISiIn WHJBwrtX7BdPANpNc0JqfW3cj3MNoNFk9KuI+x2fj8804V0mwvNSdzcudWnRKhd7k3Mw jGSJGOoaio3A+qQEPCb7GwCjcuUXLYplDILc/2ly+XI9pdU+niDdnkHZQqgCXobvtcsQ pXeeo9A0GMTEWdvW0pQk1B1mMoeq1aAztJzud/MI/P/PI8lFXgFj5i1Ca1gj64qFTtcj P7cg== 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 a3si89555lji.6.2021.09.22.00.54.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Sep 2021 00:54:17 -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 18M7sHAY006555 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 22 Sep 2021 09:54:17 +0200 Received: from md1za8fc.ad001.siemens.net ([167.87.35.234]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id 18M7sGqB006378; Wed, 22 Sep 2021 09:54:16 +0200 Date: Wed, 22 Sep 2021 09:54:16 +0200 From: Henning Schild To: Adriaan Schmidt Cc: isar-users@googlegroups.com Subject: Re: [PATCH] meta: add dpkg-prebuilt.bbclass Message-ID: <20210922095416.46f889d9@md1za8fc.ad001.siemens.net> In-Reply-To: <20210921075300.25327-1-adriaan.schmidt@siemens.com> References: <20210921075300.25327-1-adriaan.schmidt@siemens.com> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: 3omui27sDbQT I am not sure about the magic unpack prepend. I guess if someone want to download more stuff they will have to ";unpack=true" to get back to the global default. Not sure anyone would want to do that. But if you think about a recipe that maybe downloads multiple debs and drops a config file or license key with dpkg-raw ... that would be harder using that class. But i guess people could split such a recipe into multiple. In one layer i have a recipe that brings a prebuild deb and adds a dpkg-raw for configuration and license key. It used to be just "a pattern" that could be easily mixed. Being a class deleting tasks and messing with SRC_URI is problematic for such mix recipes. But in fact one can keep using the "pattern" and not use the class. I think it can be merged, even if i do not see too much value. But the value likely depends on the user ;). Henning Am Tue, 21 Sep 2021 09:53:00 +0200 schrieb Adriaan Schmidt : > This puts the existing example pattern to inject prebuilt deb packages > (prebuilt-deb recipe) into a class, and adds two new features: > * `unpack=false` is added automatically. > * dpkg_build is removed using `deltask` instead of replacing with > nop. This way also other dependent tasks (patch, prepare_build, ...) > are skipped. > > The existing example recipe is changed to use the new class. > > Signed-off-by: Adriaan Schmidt > --- > .../prebuilt-deb/prebuilt-deb_0.1.bb | 9 ++------- > meta/classes/dpkg-prebuilt.bbclass | 20 > +++++++++++++++++++ 2 files changed, 22 insertions(+), 7 deletions(-) > create mode 100644 meta/classes/dpkg-prebuilt.bbclass > > diff --git a/meta-isar/recipes-app/prebuilt-deb/prebuilt-deb_0.1.bb > b/meta-isar/recipes-app/prebuilt-deb/prebuilt-deb_0.1.bb index > 2f1b699..35a0da3 100644 --- > a/meta-isar/recipes-app/prebuilt-deb/prebuilt-deb_0.1.bb +++ > b/meta-isar/recipes-app/prebuilt-deb/prebuilt-deb_0.1.bb @@ -3,18 > +3,13 @@ # > # SPDX-License-Identifier: MIT > > -inherit dpkg-base > +inherit dpkg-prebuilt > > # NOTE: The deb packages should almost never be stored in the repo > itself but # rather fetched from a binary-serving location. For > this example, local # storage was just simpler to maintain > across all archs and distros. -# > -# 2nd NOTE: "unpack=false" is important, bitbake unpacks deb files > otherwise -SRC_URI = > "file://example-prebuilt_1.0.0-0_all.deb;unpack=false" +SRC_URI = > "file://example-prebuilt_1.0.0-0_all.deb" > # Only needed if recipe name != package name, as in this case. Or > multiple # packages are provided by a single recipe. > PROVIDES += "example-prebuilt" > - > -do_dpkg_build() { > -} > diff --git a/meta/classes/dpkg-prebuilt.bbclass > b/meta/classes/dpkg-prebuilt.bbclass new file mode 100644 > index 0000000..c32224b > --- /dev/null > +++ b/meta/classes/dpkg-prebuilt.bbclass > @@ -0,0 +1,20 @@ > +# This software is a part of ISAR. > +# Copyright (C) 2021 Siemens AG > +# > +# SPDX-License-Identifier: MIT > + > +inherit dpkg-base > + > +python do_unpack_prepend() { > + # enforce unpack=false > + src_uri = (d.getVar('SRC_URI', True) or '').split() > + if len(src_uri) == 0: > + return > + def ensure_unpack_false(uri): > + return ';'.join([x for x in uri.split(';') if not > x.startswith('unpack=')] + ['unpack=false']) > + src_uri = [ensure_unpack_false(uri) for uri in src_uri] > + d.setVar('SRC_URI', ' '.join(src_uri)) > +} > + > +deltask dpkg_build > +addtask unpack before do_deploy_deb