summaryrefslogtreecommitdiff
path: root/meta/classes/archive-patched-source.bbclass
diff options
context:
space:
mode:
authorMuhammad Shakeel <muhammad_shakeel@mentor.com>2013-02-20 18:50:22 +0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-02-28 23:14:04 +0000
commit959e2ae23ccbc6955a28996d4538e457cd8cfa5e (patch)
tree6f19283a856f451ef686b24dfaa7c42854ae14c7 /meta/classes/archive-patched-source.bbclass
parent2e79110e31da940728d42411cad3d019d570fc31 (diff)
downloadopenembedded-core-959e2ae23ccbc6955a28996d4538e457cd8cfa5e.tar.gz
openembedded-core-959e2ae23ccbc6955a28996d4538e457cd8cfa5e.tar.bz2
openembedded-core-959e2ae23ccbc6955a28996d4538e457cd8cfa5e.zip
archiver class: Use tasks with sstate instead of pre/post funcs
* Add tasks to move sources, script/logs and diff/env files in deploy directory. * Enable SSTATE for 'do_archive_scripts_logs' task * Enable SSTATE for 'do_dumpdata_create_diff_gz' task * SSTATE is not used for sources/patches archiver task because source archive package can result into a very large file. It will be an unnecessary overhead to keep sources in DL_DIR and cached-binaries. * If 'SOURCE_ARCHIVE_PACKAGE_TYPE' is 'srpm' then use pre/post functions because in this case we do not want to use tasks to move sources/logs in DEPLOY_DIR. 'do_package_write_rpm' is responsible for handling archiver packages. [YOCTO #3449] Signed-off-by: Muhammad Shakeel <muhammad_shakeel@mentor.com> Signed-off-by: Noor Ahsan <noor_ahsan@mentor.com> Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
Diffstat (limited to 'meta/classes/archive-patched-source.bbclass')
-rw-r--r--meta/classes/archive-patched-source.bbclass49
1 files changed, 46 insertions, 3 deletions
diff --git a/meta/classes/archive-patched-source.bbclass b/meta/classes/archive-patched-source.bbclass
index 40b2dcb0ea..f9f558e652 100644
--- a/meta/classes/archive-patched-source.bbclass
+++ b/meta/classes/archive-patched-source.bbclass
@@ -8,10 +8,53 @@
inherit archiver
# Get archiving package with patched sources including patches
-do_patch[postfuncs] += "do_archive_patched_sources "
+addtask do_archive_patched_sources after do_patch
# Get archiving package with logs(temp) and scripts(.bb and .inc files)
-do_package_write_rpm[prefuncs] += "do_archive_scripts_logs "
+addtask do_archive_scripts_logs after do_package_write_rpm
# Get dump date and create diff file
-do_package_write_rpm[postfuncs] += "do_dumpdata_create_diff_gz "
+addtask do_dumpdata_create_diff_gz after do_package_write_rpm before do_build
+
+python () {
+ if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) != 'srpm':
+ """
+ If package type is not 'srpm' then add tasks to move archive packages of
+ patched sources and scripts/logs in ${DEPLOY_DIR}/sources.
+ """
+ pn = d.getVar('PN', True)
+ d.appendVarFlag('do_configure', 'depends', ' %s:do_archive_patched_sources' %pn)
+ build_deps = ' %s:do_archive_patched_sources' %pn
+ build_deps += ' %s:do_archive_scripts_logs' %pn
+ d.appendVarFlag('do_build', 'depends', build_deps)
+
+ else:
+ d.prependVarFlag('do_patch', 'postfuncs', "do_archive_patched_sources")
+ d.prependVarFlag('do_package_write_rpm', 'prefuncs', "do_archive_scripts_logs")
+}
+
+ARCHIVE_SSTATE_OUTDIR = "${DEPLOY_DIR}/sources/"
+ARCHIVE_SSTATE_SCRIPTS_LOGS_INDIR = "${WORKDIR}/script-logs/"
+ARCHIVE_SSTATE_DIFFGZ_ENVDATA_INDIR = "${WORKDIR}/diffgz-envdata/"
+
+SSTATETASKS += "do_archive_scripts_logs"
+do_archive_scripts_logs[sstate-name] = "archive_scripts_logs"
+do_archive_scripts_logs[sstate-inputdirs] = "${ARCHIVE_SSTATE_SCRIPTS_LOGS_INDIR}"
+do_archive_scripts_logs[sstate-outputdirs] = "${ARCHIVE_SSTATE_OUTDIR}"
+
+python do_archive_scripts_logs_setscene () {
+ sstate_setscene(d)
+}
+
+addtask do_archive_scripts_logs_setscene
+
+SSTATETASKS += "do_dumpdata_create_diff_gz"
+do_dumpdata_create_diff_gz[sstate-name] = "dumpdata_create_diff_gz"
+do_dumpdata_create_diff_gz[sstate-inputdirs] = "${ARCHIVE_SSTATE_DIFFGZ_ENVDATA_INDIR}"
+do_dumpdata_create_diff_gz[sstate-outputdirs] = "${ARCHIVE_SSTATE_OUTDIR}"
+
+python do_dumpdata_create_diff_gz_setscene () {
+ sstate_setscene(d)
+}
+
+addtask do_dumpdata_create_diff_gz_setscene