diff options
author | Muhammad Shakeel <muhammad_shakeel@mentor.com> | 2013-02-20 18:50:22 +0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-02-28 23:15:45 +0000 |
commit | 2b1afa10bc633c8153881921c181d0ad9b7060f0 (patch) | |
tree | 936fac1976dcd187d24e00a983e77ebbb7e9a6c8 /meta/classes/archive-original-source.bbclass | |
parent | 8e849a23e9ce83fd8e855e8971f8e4803447ee65 (diff) | |
download | poky-2b1afa10bc633c8153881921c181d0ad9b7060f0.tar.gz |
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]
(From OE-Core rev: 959e2ae23ccbc6955a28996d4538e457cd8cfa5e)
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>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/archive-original-source.bbclass')
-rw-r--r-- | meta/classes/archive-original-source.bbclass | 49 |
1 files changed, 46 insertions, 3 deletions
diff --git a/meta/classes/archive-original-source.bbclass b/meta/classes/archive-original-source.bbclass index 1b3f8d0b34..f123cafcb0 100644 --- a/meta/classes/archive-original-source.bbclass +++ b/meta/classes/archive-original-source.bbclass | |||
@@ -8,10 +8,53 @@ | |||
8 | inherit archiver | 8 | inherit archiver |
9 | 9 | ||
10 | # Get original sources archiving package with patches | 10 | # Get original sources archiving package with patches |
11 | do_unpack[postfuncs] += "do_archive_original_sources_patches " | 11 | addtask do_archive_original_sources_patches after do_unpack |
12 | 12 | ||
13 | # Get archiving package with temp(logs) and scripts(.bb and inc files) | 13 | # Get archiving package with temp(logs) and scripts(.bb and inc files) |
14 | do_package_write_rpm[prefuncs] += "do_archive_scripts_logs " | 14 | addtask do_archive_scripts_logs after do_package_write_rpm |
15 | 15 | ||
16 | # Get dump date and create diff file | 16 | # Get dump date and create diff file |
17 | do_package_write_rpm[postfuncs] += "do_dumpdata_create_diff_gz " | 17 | addtask do_dumpdata_create_diff_gz after do_package_write_rpm before do_build |
18 | |||
19 | python () { | ||
20 | if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) != 'srpm': | ||
21 | """ | ||
22 | If package type is not 'srpm' then add tasks to move archive packages of | ||
23 | original sources and scripts/logs in ${DEPLOY_DIR}/sources. | ||
24 | """ | ||
25 | pn = d.getVar('PN', True) | ||
26 | d.appendVarFlag('do_patch', 'depends', ' %s:do_archive_original_sources_patches' %pn) | ||
27 | build_deps = ' %s:do_archive_original_sources_patches' %pn | ||
28 | build_deps += ' %s:do_archive_scripts_logs' %pn | ||
29 | d.appendVarFlag('do_build', 'depends', build_deps) | ||
30 | |||
31 | else: | ||
32 | d.prependVarFlag('do_unpack', 'postfuncs', "do_archive_original_sources_patches") | ||
33 | d.prependVarFlag('do_package_write_rpm', 'prefuncs', "do_archive_scripts_logs") | ||
34 | } | ||
35 | |||
36 | ARCHIVE_SSTATE_OUTDIR = "${DEPLOY_DIR}/sources/" | ||
37 | ARCHIVE_SSTATE_SCRIPTS_LOGS_INDIR = "${WORKDIR}/script-logs/" | ||
38 | ARCHIVE_SSTATE_DIFFGZ_ENVDATA_INDIR = "${WORKDIR}/diffgz-envdata/" | ||
39 | |||
40 | SSTATETASKS += "do_archive_scripts_logs" | ||
41 | do_archive_scripts_logs[sstate-name] = "archive_scripts_logs" | ||
42 | do_archive_scripts_logs[sstate-inputdirs] = "${ARCHIVE_SSTATE_SCRIPTS_LOGS_INDIR}" | ||
43 | do_archive_scripts_logs[sstate-outputdirs] = "${ARCHIVE_SSTATE_OUTDIR}" | ||
44 | |||
45 | python do_archive_scripts_logs_setscene () { | ||
46 | sstate_setscene(d) | ||
47 | } | ||
48 | |||
49 | addtask do_archive_scripts_logs_setscene | ||
50 | |||
51 | SSTATETASKS += "do_dumpdata_create_diff_gz" | ||
52 | do_dumpdata_create_diff_gz[sstate-name] = "dumpdata_create_diff_gz" | ||
53 | do_dumpdata_create_diff_gz[sstate-inputdirs] = "${ARCHIVE_SSTATE_DIFFGZ_ENVDATA_INDIR}" | ||
54 | do_dumpdata_create_diff_gz[sstate-outputdirs] = "${ARCHIVE_SSTATE_OUTDIR}" | ||
55 | |||
56 | python do_dumpdata_create_diff_gz_setscene () { | ||
57 | sstate_setscene(d) | ||
58 | } | ||
59 | |||
60 | addtask do_dumpdata_create_diff_gz_setscene | ||