From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6520143438976909312 X-Received: by 10.28.237.21 with SMTP id l21mr412634wmh.32.1518204824377; Fri, 09 Feb 2018 11:33:44 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 10.28.167.75 with SMTP id q72ls1695427wme.0.gmail; Fri, 09 Feb 2018 11:33:43 -0800 (PST) X-Google-Smtp-Source: AH8x2258jFcHBGC7mlrhLhTrkaRZ3ZC2Ol6F2dwUIXwmrdqIDIFPiVniNuYyFZwXITWbrEVR3PNk X-Received: by 10.28.94.200 with SMTP id s191mr399960wmb.14.1518204823820; Fri, 09 Feb 2018 11:33:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518204823; cv=none; d=google.com; s=arc-20160816; b=n5M7OjAh8TJogmwHKn4KdVcZCe7wsygJcnXiep42hFVhPqZBYimmujAoJp69ljUNEQ SR8XNqiCbskmEYa4B0Bnv8/jnn/CWjkwrtnrxMdj0DDlwgywWqxOS29R1e+yPtOKM/5H nH1Q8joucinbcbhq6gcIkUWpv/E5e9vJEzFLRs52ZReBiEMOSS884T9ItakxcR5ecS4w eIdXsKUjTVvqENGvbrg12BSZUF+ouUFZD5e7sh5C0qhTW25vtA9W2Vdmycrqa4C9MIWh cC78fIhSp8tuoHUFumZPwVMqpbq9bjqsf8OnacwfWGVzzKDbkf0yj0j2BcMcQuEpj2nQ UEVw== 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:arc-authentication-results; bh=L/2/ocL/27tsU64gIErhpU3LVe0RFOYnlweB+e3lVbk=; b=sdh0/RjK0grKduAAtAakNY6RHuZMyjnpCgF0NQuhFAxzAJ7WsYRHWQByWhkrXJRZdN UZM1s9d5Cxq3kGow1c9mM9rlj0B9JapDCV+kCCUVxqoVJfm5nNVAcJkteH5LdVEfwLpT gTqC9bRkBPNq7tgEv6i92SLfDlgw93Nst6fLwrhu/liqSKutf6YxUCIuhsDscvpEdAkd gKTtmB4Nja6MFq2M5AJPtqYMepu9Ue5uUhaPCefJajLB0oNktjgzXAZW5QjOi+RXIcqg aqPzGDzfjaoQKCc9NeH8FxtABmQAuENN2ybDSaH5gyeJaDd46OMlkgt0or8ScKtltK+k Va5A== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Return-Path: Received: from goliath.siemens.de (goliath.siemens.de. [192.35.17.28]) by gmr-mx.google.com with ESMTPS id c11si200892wrb.0.2018.02.09.11.33.43 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Feb 2018 11:33:43 -0800 (PST) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 as permitted sender) client-ip=192.35.17.28; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Received: from mail1.siemens.de (mail1.siemens.de [139.23.33.14]) by goliath.siemens.de (8.15.2/8.15.2) with ESMTPS id w19JXg4e005780 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 9 Feb 2018 20:33:42 +0100 Received: from mmd1pvb1c.ad001.siemens.net ([167.87.31.179]) by mail1.siemens.de (8.15.2/8.15.2) with ESMTP id w19JXfwx032059; Fri, 9 Feb 2018 20:33:42 +0100 Date: Fri, 9 Feb 2018 20:33:39 +0100 From: Henning Schild To: Alexander Smirnov Cc: , Claudius Heine Subject: Re: [PATCH v2] meta/classes/base: Fix showdata and liststasks after bitbake update Message-ID: <20180209203339.5752c103@mmd1pvb1c.ad001.siemens.net> In-Reply-To: <1617bdffba0.27ac.034a6b0541ed39b7fb4e17f4ac219eaa@ilbers.de> References: <20180209172850.28852-1-asmirnov@ilbers.de> <20180209191610.161916ad@mmd1pvb1c.ad001.siemens.net> <1617bdffba0.27ac.034a6b0541ed39b7fb4e17f4ac219eaa@ilbers.de> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-TUID: Qf0hDA/w0h9o Am Fri, 9 Feb 2018 21:42:12 +0300 schrieb Alexander Smirnov : > Henning Schild 9 =D1=84=D0=B5=D0=B2=D1=80=D0= =B0=D0=BB=D1=8F 2018 =D0=B3. > 21:16:17 =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB: >=20 > > Mhh this one rings a bell ;) > > > > https://groups.google.com/d/msg/isar-users/Raq3ayrqtnc/oqTt6_sSBQAJ > > > > Someone has to reread that and check whether my symlink approach was > > rejected rightfully, or whether it was just one of the many > > misunderstandings we had in the past. =20 >=20 > This approach was rejected due to several reasons: >=20 > - According to the bitbake documentation, you need to create your > own base.bbclass. I consider this as a signal - do not reply on > default one. >=20 > https://www.yoctoproject.org/docs/1.6/bitbake-user-manual/bitbake-user-ma= nual.html#hello-world-example >=20 > - Default base.bbclass provides inevitable default settings that > should be overwritten in custom class. Moreover this class should be > included to *all* the Isar recipes manually. Inherit something to > overwrite it immediately still doesn't look reasonable for me. >=20 > In addition: >=20 > - do_listtasks in this patch seems to be taken from oe-core, not > from bitbake, so inheritance doesn't help here. Ok, thanks for summing it up again. It might be a good idea to write a developer doc on how to upgrade bitbake (and wic) and what to test when doing so. Otherwise we risk introducing the same problems over and over again. But that could also be a testcase. Henning > Alex >=20 > > > > Henning > > > > Am Fri, 9 Feb 2018 20:28:50 +0300 > > schrieb Alexander Smirnov : > > =20 > >> From: Claudius Heine > >> > >> 8<-- > >> > >> Just added references to origin code in comment. Didn't touch the > >> code. > >> > >> 8<-- > >> > >> Those tasks were broken, this patchs fixes by implementing them > >> similar to how openembedded-core does it. > >> > >> Signed-off-by: Claudius Heine > >> --- > >> meta/classes/base.bbclass | 30 +++++++++++++++++++----------- > >> 1 file changed, 19 insertions(+), 11 deletions(-) > >> > >> diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass > >> index 7d44f72..ae84677 100644 > >> --- a/meta/classes/base.bbclass > >> +++ b/meta/classes/base.bbclass > >> @@ -37,25 +37,33 @@ bbfatal() { > >> exit 1 > >> } > >> > >> +# Derived from bitbake: bitbake/classes/base.bbclass > >> addtask showdata > >> do_showdata[nostamp] =3D "1" > >> python do_showdata() { > >> - import sys > >> - # emit variables and shell functions > >> - bb.data.emit_env(sys.__stdout__, d, True) > >> - # emit the metadata which isnt valid shell > >> - for e in bb.data.keys(d): > >> - if bb.data.getVarFlag(e, 'python', d): > >> - sys.__stdout__.write("\npython %s () > >> {\n%s}\n" % (e, bb.data.getVar(e, d, 1))) > >> + for e in d.keys(): > >> + if d.getVarFlag(e, 'python'): > >> + bb.plain("\npython %s () {\n%s}\n" % (e, d.getVar(e, > >> True))) } > >> > >> +# Derived from Open Embedded: > >> openembedded-core/meta/classes/utility-tasks.bbclass addtask > >> listtasks do_listtasks[nostamp] =3D "1" > >> python do_listtasks() { > >> - import sys > >> - for e in bb.data.keys(d): > >> - if bb.data.getVarFlag(e, 'task', d): > >> - sys.__stdout__.write("%s\n" % e) > >> + taskdescs =3D {} > >> + maxlen =3D 0 > >> + for e in d.keys(): > >> + if d.getVarFlag(e, 'task'): > >> + maxlen =3D max(maxlen, len(e)) > >> + if e.endswith('_setscene'): > >> + desc =3D "%s (setscene version)" % > >> (d.getVarFlag(e[:-9], 'doc') or '') > >> + else: > >> + desc =3D d.getVarFlag(e, 'doc') or '' > >> + taskdescs[e] =3D desc > >> + > >> + tasks =3D sorted(taskdescs.keys()) > >> + for taskname in tasks: > >> + bb.plain("%s %s" % (taskname.ljust(maxlen), > >> taskdescs[taskname])) } > >> > >> do_fetch[dirs] =3D "${DL_DIR}" =20 > > =20 > -- > With best regards, > Alexander Smirnov >=20 > ilbers GmbH > Baierbrunner Str. 28c > D-81379 Munich > +49 (89) 122 67 24-0 > http://ilbers.de/ > Commercial register Munich, HRB 214197 > General manager: Baurzhan Ismagulov >=20 >=20