diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2014-01-04 21:02:30 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-03-21 17:15:26 +0000 |
commit | f0714d1128f27429485cace56d89bf6f0a170a29 (patch) | |
tree | 4559f1d7d67d2ce8396685c60626fbcd9dbb7ed4 /meta/classes/archiver.bbclass | |
parent | 3175653fe06452f0a29de3068fa49632a9c68e4b (diff) | |
download | poky-f0714d1128f27429485cace56d89bf6f0a170a29.tar.gz |
classes/archive*.bbclass: remove archive-*-source.bbclass
Nearly all of the codes in the following 3 files are the same, we can
move the code to archiver.bbclass and remove them:
archive-configured-source.bbclass
archive-original-source.bbclass
archive-patched-source.bbclass
[YOCTO #5113]
(From OE-Core rev: d2d3428a0fc746e56c0a0046bd12a393dedb4dda)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/archiver.bbclass')
-rw-r--r-- | meta/classes/archiver.bbclass | 63 |
1 files changed, 62 insertions, 1 deletions
diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass index 66efe7d54b..43373ae4f1 100644 --- a/meta/classes/archiver.bbclass +++ b/meta/classes/archiver.bbclass | |||
@@ -36,6 +36,33 @@ COPYLEFT_AVAILABLE_RECIPE_TYPES = 'target native nativesdk cross crosssdk cross- | |||
36 | COPYLEFT_AVAILABLE_RECIPE_TYPES[type] = 'list' | 36 | COPYLEFT_AVAILABLE_RECIPE_TYPES[type] = 'list' |
37 | COPYLEFT_AVAILABLE_RECIPE_TYPES[doc] = 'Space separated list of available recipe types' | 37 | COPYLEFT_AVAILABLE_RECIPE_TYPES[doc] = 'Space separated list of available recipe types' |
38 | 38 | ||
39 | python () { | ||
40 | pn = d.getVar('PN', True) | ||
41 | packaging = d.getVar('IMAGE_PKGTYPE', True) | ||
42 | |||
43 | if tar_filter(d): | ||
44 | return | ||
45 | |||
46 | if d.getVar('PACKAGES', True) != '': | ||
47 | d.appendVarFlag('do_dumpdata_create_diff_gz', 'depends', ' %s:do_package_write_%s' % (pn, packaging)) | ||
48 | |||
49 | build_deps = ' %s:do_dumpdata_create_diff_gz' % pn | ||
50 | |||
51 | if d.getVar('SOURCE_ARCHIVE_LOG_WITH_SCRIPTS', True) == 'logs_with_scripts': | ||
52 | d.appendVarFlag('do_archive_scripts_logs', 'depends', ' %s:do_package_write_%s' % (pn, packaging)) | ||
53 | build_deps += ' %s:do_archive_scripts_logs' % pn | ||
54 | |||
55 | if not not_tarball(d): | ||
56 | archiver_mode = d.getVar('ARCHIVER_MODE') | ||
57 | d.appendVarFlag('do_compile', 'depends', ' %s:do_archive_%s_sources' % (pn, archiver_mode)) | ||
58 | build_deps += ' %s:do_archive_%s_sources' % (pn, archiver_mode) | ||
59 | |||
60 | if bb.data.inherits_class('image', d): | ||
61 | d.appendVarFlag('do_rootfs', 'depends', build_deps) | ||
62 | else: | ||
63 | d.appendVarFlag('do_build', 'depends', build_deps) | ||
64 | } | ||
65 | |||
39 | def copyleft_recipe_type(d): | 66 | def copyleft_recipe_type(d): |
40 | for recipe_type in oe.data.typed_value('COPYLEFT_AVAILABLE_RECIPE_TYPES', d): | 67 | for recipe_type in oe.data.typed_value('COPYLEFT_AVAILABLE_RECIPE_TYPES', d): |
41 | if oe.utils.inherits(d, recipe_type): | 68 | if oe.utils.inherits(d, recipe_type): |
@@ -516,7 +543,7 @@ def create_diff_gz(d): | |||
516 | 543 | ||
517 | # This function will run when user want to get tarball for sources and | 544 | # This function will run when user want to get tarball for sources and |
518 | # patches after do_unpack | 545 | # patches after do_unpack |
519 | python do_archive_original_sources_patches(){ | 546 | python do_archive_original_sources(){ |
520 | archive_sources_patches(d, 'prepatch') | 547 | archive_sources_patches(d, 'prepatch') |
521 | } | 548 | } |
522 | 549 | ||
@@ -567,3 +594,37 @@ python do_delete_tarlist(){ | |||
567 | } | 594 | } |
568 | do_delete_tarlist[deptask] = "do_archive_scripts_logs" | 595 | do_delete_tarlist[deptask] = "do_archive_scripts_logs" |
569 | do_package_write_rpm[postfuncs] += "do_delete_tarlist " | 596 | do_package_write_rpm[postfuncs] += "do_delete_tarlist " |
597 | |||
598 | # Get archiving package with temp(logs) and scripts(.bb and .inc files) | ||
599 | addtask do_archive_scripts_logs | ||
600 | |||
601 | # Get dump date and create diff file | ||
602 | addtask do_dumpdata_create_diff_gz | ||
603 | |||
604 | ARCHIVE_SSTATE_OUTDIR = "${DEPLOY_DIR}/sources/" | ||
605 | ARCHIVE_SSTATE_SCRIPTS_LOGS_INDIR = "${WORKDIR}/script-logs/" | ||
606 | ARCHIVE_SSTATE_DIFFGZ_ENVDATA_INDIR = "${WORKDIR}/diffgz-envdata/" | ||
607 | |||
608 | SSTATETASKS += "do_archive_scripts_logs" | ||
609 | do_archive_scripts_logs[sstate-inputdirs] = "${ARCHIVE_SSTATE_SCRIPTS_LOGS_INDIR}" | ||
610 | do_archive_scripts_logs[sstate-outputdirs] = "${ARCHIVE_SSTATE_OUTDIR}" | ||
611 | |||
612 | python do_archive_scripts_logs_setscene () { | ||
613 | sstate_setscene(d) | ||
614 | } | ||
615 | |||
616 | addtask do_archive_scripts_logs_setscene | ||
617 | |||
618 | SSTATETASKS += "do_dumpdata_create_diff_gz" | ||
619 | do_dumpdata_create_diff_gz[sstate-inputdirs] = "${ARCHIVE_SSTATE_DIFFGZ_ENVDATA_INDIR}" | ||
620 | do_dumpdata_create_diff_gz[sstate-outputdirs] = "${ARCHIVE_SSTATE_OUTDIR}" | ||
621 | |||
622 | python do_dumpdata_create_diff_gz_setscene () { | ||
623 | sstate_setscene(d) | ||
624 | } | ||
625 | |||
626 | addtask do_dumpdata_create_diff_gz_setscene | ||
627 | |||
628 | addtask do_archive_original_sources after do_unpack | ||
629 | addtask do_archive_patched_sources after do_patch | ||
630 | addtask do_archive_configured_sources after do_configure | ||