Patchwork archive-*-source.bbclass: handle dependency in anonymous function

login
register
mail settings
Submitter Laurentiu Palcu
Date May 7, 2013, 12:31 p.m.
Message ID <1367929875-11118-1-git-send-email-laurentiu.palcu@intel.com>
Download mbox | patch
Permalink /patch/49439/
State Accepted
Commit 2400a74923e51e17ecfa94c2d63908b0b2aac76a
Headers show

Comments

Laurentiu Palcu - May 7, 2013, 12:31 p.m.
Using "before do_rootfs" would have this task added to do_rootfs
dependencies regardless of the filtering options. Instead, add this
dependency in the anonymous python function.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
---
 meta/classes/archive-configured-source.bbclass |    7 +++++--
 meta/classes/archive-original-source.bbclass   |    7 +++++--
 meta/classes/archive-patched-source.bbclass    |    7 +++++--
 3 files changed, 15 insertions(+), 6 deletions(-)

Patch

diff --git a/meta/classes/archive-configured-source.bbclass b/meta/classes/archive-configured-source.bbclass
index a481b14..33c7956 100644
--- a/meta/classes/archive-configured-source.bbclass
+++ b/meta/classes/archive-configured-source.bbclass
@@ -14,7 +14,7 @@  addtask do_archive_configured_sources after do_configure
 addtask do_archive_scripts_logs
 
 # Get dump date and create diff file 
-addtask do_dumpdata_create_diff_gz before do_rootfs
+addtask do_dumpdata_create_diff_gz
 
 python () {
     pn = d.getVar('PN', True)
@@ -34,7 +34,10 @@  python () {
         d.appendVarFlag('do_compile', 'depends', ' %s:do_archive_configured_sources' %pn)
         build_deps += ' %s:do_archive_configured_sources' %pn
 
-    d.appendVarFlag('do_build', 'depends', build_deps)
+    if bb.data.inherits_class('image', d):
+        d.appendVarFlag('do_rootfs', 'depends', build_deps)
+    else:
+        d.appendVarFlag('do_build', 'depends', build_deps)
 }
 
 ARCHIVE_SSTATE_OUTDIR = "${DEPLOY_DIR}/sources/"
diff --git a/meta/classes/archive-original-source.bbclass b/meta/classes/archive-original-source.bbclass
index 2796ff9..a3e36d9 100644
--- a/meta/classes/archive-original-source.bbclass
+++ b/meta/classes/archive-original-source.bbclass
@@ -14,7 +14,7 @@  addtask do_archive_original_sources_patches after do_unpack
 addtask do_archive_scripts_logs
 
 # Get dump date and create diff file 
-addtask do_dumpdata_create_diff_gz before do_rootfs
+addtask do_dumpdata_create_diff_gz
 
 python () {
     pn = d.getVar('PN', True)
@@ -34,7 +34,10 @@  python () {
         d.appendVarFlag('do_patch', 'depends', ' %s:do_archive_original_sources_patches' %pn)
         build_deps += ' %s:do_archive_original_sources_patches' %pn
 
-    d.appendVarFlag('do_build', 'depends', build_deps)
+    if bb.data.inherits_class('image', d):
+        d.appendVarFlag('do_rootfs', 'depends', build_deps)
+    else:
+        d.appendVarFlag('do_build', 'depends', build_deps)
 }
 
 ARCHIVE_SSTATE_OUTDIR = "${DEPLOY_DIR}/sources/"
diff --git a/meta/classes/archive-patched-source.bbclass b/meta/classes/archive-patched-source.bbclass
index 995a259..0d4305d 100644
--- a/meta/classes/archive-patched-source.bbclass
+++ b/meta/classes/archive-patched-source.bbclass
@@ -14,7 +14,7 @@  addtask do_archive_patched_sources after do_patch
 addtask do_archive_scripts_logs
 
 # Get dump date and create diff file 
-addtask do_dumpdata_create_diff_gz before do_rootfs
+addtask do_dumpdata_create_diff_gz
 
 python () {
     pn = d.getVar('PN', True)
@@ -34,7 +34,10 @@  python () {
         d.appendVarFlag('do_configure', 'depends', ' %s:do_archive_patched_sources' %pn)
         build_deps += ' %s:do_archive_patched_sources' %pn
 
-    d.appendVarFlag('do_build', 'depends', build_deps)
+    if bb.data.inherits_class('image', d):
+        d.appendVarFlag('do_rootfs', 'depends', build_deps)
+    else:
+        d.appendVarFlag('do_build', 'depends', build_deps)
 }
 
 ARCHIVE_SSTATE_OUTDIR = "${DEPLOY_DIR}/sources/"