From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6460145516460113920 X-Received: by 10.223.164.206 with SMTP id h14mr104809wrb.2.1504538097077; Mon, 04 Sep 2017 08:14:57 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 10.28.214.213 with SMTP id n204ls1378396wmg.25.canary-gmail; Mon, 04 Sep 2017 08:14:56 -0700 (PDT) X-Google-Smtp-Source: ADKCNb6AFJn6zou1K2BOEuejZy4OX0itJmJgRfMne2v5nWpB6elRoH8gGDOe9IS8gUr0RKWkkzXe X-Received: by 10.28.142.201 with SMTP id q192mr97526wmd.23.1504538096701; Mon, 04 Sep 2017 08:14:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504538096; cv=none; d=google.com; s=arc-20160816; b=EkRpQiTBNiZzQe6abxrCx0zfWUX/hmPzW7ErJx0zLYSAk50M1m3jbA/CuwfEDRvGFf sgmmfL2UGgQ9UohB58sha5JwN00EeO3N3B77X33TNJ4QtmHSK3S6txJlk642Pu8PUZ8s XDh2LVpEAkJ40iEyyXQ5xPW1sdLexvCKGHT4FnMosRuc5+kAI++eTtLo35+nS20eg35v rq4SlWDMI1zKWv/pcFTUbifQWcefLEfde1jC13kxpQPNLjIP4CjTv4ieL7Hy/z6wKB34 //yURCWVy5NyKAUos4WHrsxYu0wt6KU9iDtQn6+rAfD2ZiM7rLQa+DZHRbUX4NLD9al0 Bt4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:to:subject :arc-authentication-results; bh=3RjaZzegO4xmWpUP136mcBlQr98kGFl4pAzOKn6h+Dc=; b=P1+rOLiX0k4G8fjtsmb0nK+/h98uYUJ4b32MOzNp/n4N8dHpuEDIe7v7/AAMNKwcgH RF7NcPI03XwwAXGRJKKQHI7zgDo7e3BnyW18H+chxgjqLhicrNYUIGqDkolZHQdDTrZK 93CCZKXJ1gXJhXB0tcsqvhJBDUw1Z6UaoHTkzvzXqnmk6rI40vJAciR9quyUJ0iWrlyH HlHkeVat8wqzVjM170vh4XrXqlN1TvtG24ShOG22Ra2aXcmEoYXrvlF/jJMZAJDPlVEP qlrGa+mN00qCyd9Q/aZMK1s16pjKLxWvXaDBjtsSqEW8fb8o45vDCO1qBwMLbRbe+7P+ hEAQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=asmirnov@ilbers.de Return-Path: Received: from aqmola.ilbers.de (aqmola.ilbers.de. [85.214.62.211]) by gmr-mx.google.com with ESMTPS id k201si43062wmg.9.2017.09.04.08.14.56 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Sep 2017 08:14:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) client-ip=85.214.62.211; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=asmirnov@ilbers.de Received: from [10.0.2.15] ([188.227.110.165]) (authenticated bits=0) by aqmola.ilbers.de (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP id v84FEr6R008948 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for ; Mon, 4 Sep 2017 17:14:55 +0200 Subject: Re: [PATCH 2/6] meta: Move 'do_fetch' and 'do_unpack' to base-class To: isar-users@googlegroups.com References: <1d3a315a8ac98ba02800168b6f8bc50d95a96bb4.1504119538.git.henning.schild@siemens.com> From: Alexander Smirnov Message-ID: Date: Mon, 4 Sep 2017 18:14:48 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <1d3a315a8ac98ba02800168b6f8bc50d95a96bb4.1504119538.git.henning.schild@siemens.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: k2VtAnKVX4JE On 08/30/2017 10:03 PM, Henning Schild wrote: > Issues: > unpack and fetch can only be used if you inherit dpkg, they should be > available to others i.e. classes and images For me it's ok to move fetch to base class. Unpack has dependency from dpkg class. -- With best regards, Alexander Smirnov > > Change: > Pull the code out of the dpdk-class and stick it into the base-class. It is the > same code, no changes to it. > > Impact: > This patch does not change the behaviour of Isar. It addresses the > issue, preparing for future patches. > > Signed-off-by: Henning Schild > --- > meta/classes/base.bbclass | 36 ++++++++++++++++++++++++++++++++++++ > meta/classes/dpkg.bbclass | 35 ----------------------------------- > 2 files changed, 36 insertions(+), 35 deletions(-) > > diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass > index 2179ba9..3cace37 100644 > --- a/meta/classes/base.bbclass > +++ b/meta/classes/base.bbclass > @@ -58,6 +58,42 @@ python do_listtasks() { > sys.__stdout__.write("%s\n" % e) > } > > +do_fetch[dirs] = "${DL_DIR}" > + > +# Fetch package from the source link > +python do_fetch() { > + src_uri = (d.getVar('SRC_URI', True) or "").split() > + if len(src_uri) == 0: > + return > + > + try: > + fetcher = bb.fetch2.Fetch(src_uri, d) > + fetcher.download() > + except bb.fetch2.BBFetchException as e: > + raise bb.build.FuncFailed(e) > +} > + > +addtask fetch before do_build > + > +do_unpack[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}" > + > +# Unpack package and put it into working directory > +python do_unpack() { > + src_uri = (d.getVar('SRC_URI', True) or "").split() > + if len(src_uri) == 0: > + return > + > + rootdir = d.getVar('WORKDIR', True) > + > + try: > + fetcher = bb.fetch2.Fetch(src_uri, d) > + fetcher.unpack(rootdir) > + except bb.fetch2.BBFetchException as e: > + raise bb.build.FuncFailed(e) > +} > + > +addtask unpack after do_fetch before do_build > + > addtask build > do_build[dirs] = "${TOPDIR}" > python base_do_build () { > diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass > index 81e21ce..0b8c7c4 100644 > --- a/meta/classes/dpkg.bbclass > +++ b/meta/classes/dpkg.bbclass > @@ -10,46 +10,11 @@ do_unpack[deptask] = "do_build" > PP = "/home/builder/${PN}" > BUILDROOT = "${BUILDCHROOT_DIR}/${PP}" > > -do_fetch[dirs] = "${DL_DIR}" > - > -# Fetch package from the source link > -python do_fetch() { > - src_uri = (d.getVar('SRC_URI', True) or "").split() > - if len(src_uri) == 0: > - return > - > - try: > - fetcher = bb.fetch2.Fetch(src_uri, d) > - fetcher.download() > - except bb.fetch2.BBFetchException as e: > - raise bb.build.FuncFailed(e) > -} > - > -addtask fetch before do_build > - > do_unpack[dirs] = "${BUILDROOT}" > -do_unpack[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}" > S ?= "${BUILDROOT}" > > WORKDIR_task-unpack = "${BUILDROOT}" > > -# Unpack package and put it into working directory > -python do_unpack() { > - src_uri = (d.getVar('SRC_URI', True) or "").split() > - if len(src_uri) == 0: > - return > - > - rootdir = d.getVar('WORKDIR', True) > - > - try: > - fetcher = bb.fetch2.Fetch(src_uri, d) > - fetcher.unpack(rootdir) > - except bb.fetch2.BBFetchException as e: > - raise bb.build.FuncFailed(e) > -} > - > -addtask unpack after do_fetch before do_build > - > do_build[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}" > > # Build package from sources using build script >