public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Henning Schild <henning.schild@siemens.com>
To: isar-users@googlegroups.com
Cc: Alexander Smirnov <asmirnov@ilbers.de>,
	Henning Schild <henning.schild@siemens.com>,
	Claudius Heine <ch@denx.de>
Subject: [PATCH v2 1/6] meta: Move 'do_fetch' and 'do_unpack' to base-class
Date: Tue, 12 Sep 2017 17:58:05 +0200	[thread overview]
Message-ID: <20170912155810.9434-2-henning.schild@siemens.com> (raw)
In-Reply-To: <20170912155810.9434-1-henning.schild@siemens.com>

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 <henning.schild@siemens.com>
---
 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


  reply	other threads:[~2017-09-12 15:58 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-12 15:58 [PATCH v2 0/6] v4 of the custom debian package Henning Schild
2017-09-12 15:58 ` Henning Schild [this message]
2017-09-12 15:58 ` [PATCH v2 2/6] meta/dpkg-debian: Move 'do_install' to new dpkg-base.bbclass Henning Schild
2017-09-12 15:58 ` [PATCH v2 3/6] meta/dpkg: pull out actual build command from 'do_build' Henning Schild
2017-09-13 12:44   ` Alexander Smirnov
2017-09-13 13:41     ` Henning Schild
2017-09-13 14:40       ` Claudius Heine
2017-09-13 15:27         ` Henning Schild
2017-09-12 15:58 ` [PATCH v2 4/6] meta/dpkg: Move 'do_build' and buildchroot stuff to dpkg-base.bbclass Henning Schild
2017-09-12 15:58 ` [PATCH v2 5/6] meta/dpkg: add dpkg-raw class Henning Schild
2017-09-12 15:58 ` [PATCH v2 6/6] recipes-app/example-raw: add an example on how to use dpkg-raw Henning Schild
2017-09-13 11:39   ` Andreas Reichel
2017-09-14  7:28     ` Alexander Smirnov
2017-09-14  8:11       ` Henning Schild
2017-09-13 13:13   ` Alexander Smirnov
2017-09-13 14:15     ` Henning Schild
2017-09-13 15:06       ` Alexander Smirnov
2017-09-13 15:28         ` Henning Schild
2017-09-13 15:38           ` Alexander Smirnov
2017-09-14  8:33             ` Henning Schild
2017-09-12 17:07 ` [PATCH v2 0/6] v4 of the custom debian package Henning Schild
2017-09-13 15:00 ` [PATCH][FYI] dpkg-raw: Allow multiconfig build Alexander Smirnov
2017-09-13 15:09   ` Alexander Smirnov
2017-09-14  8:31     ` Henning Schild
2017-09-14 17:18 ` [PATCH v2 0/6] v4 of the custom debian package Alexander Smirnov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170912155810.9434-2-henning.schild@siemens.com \
    --to=henning.schild@siemens.com \
    --cc=asmirnov@ilbers.de \
    --cc=ch@denx.de \
    --cc=isar-users@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox