That way we can use the fetchers in images and future classes/recipes
without having to "inherit dpdk".
Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
meta/classes/dpkg.bbclass | 38 ++------------------------------------
meta/classes/isar-base.bbclass | 33 +++++++++++++++++++++++++++++++++
2 files changed, 35 insertions(+), 36 deletions(-)
diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index 3d7aafb..e334dda 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -11,44 +11,10 @@ do_unpack[deptask] = "do_build"
# recipe name as identifier
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}"
S ?= "${BUILDROOT}"
-# Unpack package and put it into working directory in buildchroot
-python do_unpack() {
- src_uri = (d.getVar('SRC_URI', True) or "").split()
- if len(src_uri) == 0:
- return
-
- rootdir = d.getVar('BUILDROOT', 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
+# make the unpacker extract to BUILDROOT
+WORKDIR_task-unpack = "${BUILDROOT}"
do_build[stamp-extra-info] = "${DISTRO}"
diff --git a/meta/classes/isar-base.bbclass b/meta/classes/isar-base. bbclass
index d860937..ec4272f 100644
--- a/meta/classes/isar-base.bbclass
+++ b/meta/classes/isar-base.bbclass
@@ -20,3 +20,36 @@
# OTHER DEALINGS IN THE SOFTWARE.
do_build[nostamp] = "0"
+
+# 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_fetch[dirs] = "${DL_DIR}"
+
+# Unpack package and put it into working directory in buildchroot
+python do_unpack() {
+ src_uri = (d.getVar('SRC_URI', True) or "").split()
+ if len(src_uri) == 0:
+ return
+
+ try:
+ fetcher = bb.fetch2.Fetch(src_uri, d)
+ fetcher.unpack(d.getVar('WORKDIR', True))
+ except bb.fetch2.BBFetchException as e:
+ raise bb.build.FuncFailed(e)
+}
+
+addtask unpack after do_fetch before do_build
+do_unpack[dirs] = "${WORKDIR}"
+do_unpack[stamp-extra-info] = "${DISTRO}"
--
2.13.0
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com .
To post to this group, send email to isar-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/ .7c03d914f33ef0563cb7af2951f56e 8cd5fd20bc.1501760818.git. henning.schild%40siemens.com
For more options, visit https://groups.google.com/d/optout .