From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6464921707679318016 X-Received: by 10.223.196.139 with SMTP id m11mr909915wrf.30.1505231883659; Tue, 12 Sep 2017 08:58:03 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 10.46.13.1 with SMTP id 1ls135137ljn.15.gmail; Tue, 12 Sep 2017 08:58:03 -0700 (PDT) X-Google-Smtp-Source: AOwi7QAPk+FbqTNHNVQpzrQPMaDYAq9bAtUUqUSaZZscPzyPOhGqOYq5GFUMKRmppugEe5d2HVBi X-Received: by 10.46.9.147 with SMTP id 141mr1196170ljj.38.1505231882334; Tue, 12 Sep 2017 08:58:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505231882; cv=none; d=google.com; s=arc-20160816; b=RSAQ8iKFVZ0pmz+m8Pkgw9zNX31iL6buO+3DQnceYozHnb4TrrOiUcAd2qOeCzEWSP 9+6LGMAj4jZWhirdNuJuEuT2zmrAREoRIAVbXHCB0xiNefjTl1zATV5KNU+HUQqruT/f gh6nwsfi6JHxYASik2KvkjCIWX74qMLeLgStX66OucprseM1RQ9PiI23BLj3OrZttStI JDp2kYvyiBw+GjZCOz4urMlIxuDopSTc1SrvOM5NkJ9LSaegb88o0dWSD+kN7SgdR/55 dHT50/pd3lpCPR83uJhbvTKh5eOInX1YwMYn0wqYbGjbge0VA/Cqno6uvFxZ0Wba/B7J e+qQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=uwE2jQdepWm3HSi/Kt3JInCp6gJPNVIqz2tu20mwh+M=; b=Ui4e3INSsEvlNOwSEgmalzcvMIaZpSAi+7UyRaG61+NMVBtWfrsTMS0pOprNQRjQ1/ 1iIw0dXM+3U+/aKZo9t0sNkJMOXaJXIby6vuvcICeA7eY0BbS5Qc1UWC5rx+i4si9fJw JdUidEDIxihsAR2wAapwrYNc1pLdA85W48Ob87exTm+pZCDJ10uDCsN2VkNSemJTmmkZ HfReo+3an6mzRVvA0i8THZqO6K1V/NJq8Ey3SkOVMN7RRnDBpKwvqU30ZE2QyhBDTO6S I7mp49dyHuTc1BT/SbkH7zCvoEp+XgS0LVmVFNPPHYwiRYVT+ZrgVU4oi2MomNdGbI7B +sMA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 192.35.17.2 is neither permitted nor denied by best guess record for domain of henning.schild@siemens.com) smtp.mailfrom=henning.schild@siemens.com Return-Path: Received: from thoth.sbs.de (thoth.sbs.de. [192.35.17.2]) by gmr-mx.google.com with ESMTPS id 7si562915wme.7.2017.09.12.08.58.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Sep 2017 08:58:02 -0700 (PDT) Received-SPF: neutral (google.com: 192.35.17.2 is neither permitted nor denied by best guess record for domain of henning.schild@siemens.com) client-ip=192.35.17.2; Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 192.35.17.2 is neither permitted nor denied by best guess record for domain of henning.schild@siemens.com) smtp.mailfrom=henning.schild@siemens.com Received: from mail2.siemens.de (mail2.siemens.de [139.25.208.11]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id v8CFw1xJ004041 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 12 Sep 2017 17:58:01 +0200 Received: from md1em3qc.ww002.siemens.net ([139.25.68.40]) by mail2.siemens.de (8.15.2/8.15.2) with ESMTP id v8CFw19I001102; Tue, 12 Sep 2017 17:58:01 +0200 From: Henning Schild To: isar-users@googlegroups.com Cc: Alexander Smirnov , Henning Schild , Claudius Heine Subject: [PATCH v2 1/6] meta: Move 'do_fetch' and 'do_unpack' to base-class Date: Tue, 12 Sep 2017 17:58:05 +0200 Message-Id: <20170912155810.9434-2-henning.schild@siemens.com> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170912155810.9434-1-henning.schild@siemens.com> References: <20170912155810.9434-1-henning.schild@siemens.com> X-TUID: KQfhIsxrnLZY Issues: unpack and fetch can only be used if you inherit dpkg, they should be available to others i.e. classes and images 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 | 37 +++++++++++++++++++++++++++++++++++++ meta/classes/dpkg.bbclass | 37 ------------------------------------- 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index 2179ba9..7d44f72 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass @@ -58,6 +58,43 @@ 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[dirs] = "${WORKDIR}" +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 c0c4499..504fd1b 100644 --- a/meta/classes/dpkg.bbclass +++ b/meta/classes/dpkg.bbclass @@ -9,43 +9,6 @@ do_build[deptask] = "do_build" # recipe name as identifier PP = "/home/builder/${PN}" -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] = "${WORKDIR}" -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 - BUILDROOT = "${BUILDCHROOT_DIR}/${PP}" do_build[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}" -- 2.13.5