summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2014-01-04 21:02:30 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-03-21 17:15:26 +0000
commitf0714d1128f27429485cace56d89bf6f0a170a29 (patch)
tree4559f1d7d67d2ce8396685c60626fbcd9dbb7ed4 /meta
parent3175653fe06452f0a29de3068fa49632a9c68e4b (diff)
downloadpoky-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')
-rw-r--r--meta/classes/archive-configured-source.bbclass65
-rw-r--r--meta/classes/archive-original-source.bbclass65
-rw-r--r--meta/classes/archive-patched-source.bbclass65
-rw-r--r--meta/classes/archiver.bbclass63
4 files changed, 62 insertions, 196 deletions
diff --git a/meta/classes/archive-configured-source.bbclass b/meta/classes/archive-configured-source.bbclass
deleted file mode 100644
index 961a53282a..0000000000
--- a/meta/classes/archive-configured-source.bbclass
+++ /dev/null
@@ -1,65 +0,0 @@
1# This file is for getting archiving packages with configured
2# sources(archive ${S} after configure stage), logs(archive 'temp' after
3# package_write_rpm), dump data and creating diff file(get all
4# environment variables and functions in building and mapping all
5# content in ${S} including patches to xxx.diff.gz. All archived
6# packages will be deployed in ${DEPLOY_DIR}/sources
7
8inherit archiver
9
10# Get archiving package with configured sources including patches
11addtask do_archive_configured_sources after do_configure
12
13# Get archiving package with temp(logs) and scripts(.bb and inc files)
14addtask do_archive_scripts_logs
15
16# Get dump date and create diff file
17addtask do_dumpdata_create_diff_gz
18
19python () {
20 pn = d.getVar('PN', True)
21 packaging = d.getVar('IMAGE_PKGTYPE', True)
22
23 if tar_filter(d):
24 return
25
26 d.appendVarFlag('do_dumpdata_create_diff_gz', 'depends', ' %s:do_package_write_' %pn + packaging)
27 build_deps = ' %s:do_dumpdata_create_diff_gz' %pn
28
29 if d.getVar('SOURCE_ARCHIVE_LOG_WITH_SCRIPTS', True) == 'logs_with_scripts':
30 d.appendVarFlag('do_archive_scripts_logs', 'depends', ' %s:do_package_write_' %pn + packaging)
31 build_deps += ' %s:do_archive_scripts_logs' %pn
32
33 if not not_tarball(d):
34 d.appendVarFlag('do_compile', 'depends', ' %s:do_archive_configured_sources' %pn)
35 build_deps += ' %s:do_archive_configured_sources' %pn
36
37 if bb.data.inherits_class('image', d):
38 d.appendVarFlag('do_rootfs', 'depends', build_deps)
39 else:
40 d.appendVarFlag('do_build', 'depends', build_deps)
41}
42
43ARCHIVE_SSTATE_OUTDIR = "${DEPLOY_DIR}/sources/"
44ARCHIVE_SSTATE_SCRIPTS_LOGS_INDIR = "${WORKDIR}/script-logs/"
45ARCHIVE_SSTATE_DIFFGZ_ENVDATA_INDIR = "${WORKDIR}/diffgz-envdata/"
46
47SSTATETASKS += "do_archive_scripts_logs"
48do_archive_scripts_logs[sstate-inputdirs] = "${ARCHIVE_SSTATE_SCRIPTS_LOGS_INDIR}"
49do_archive_scripts_logs[sstate-outputdirs] = "${ARCHIVE_SSTATE_OUTDIR}"
50
51python do_archive_scripts_logs_setscene () {
52 sstate_setscene(d)
53}
54
55addtask do_archive_scripts_logs_setscene
56
57SSTATETASKS += "do_dumpdata_create_diff_gz"
58do_dumpdata_create_diff_gz[sstate-inputdirs] = "${ARCHIVE_SSTATE_DIFFGZ_ENVDATA_INDIR}"
59do_dumpdata_create_diff_gz[sstate-outputdirs] = "${ARCHIVE_SSTATE_OUTDIR}"
60
61python do_dumpdata_create_diff_gz_setscene () {
62 sstate_setscene(d)
63}
64
65addtask do_dumpdata_create_diff_gz_setscene
diff --git a/meta/classes/archive-original-source.bbclass b/meta/classes/archive-original-source.bbclass
deleted file mode 100644
index e271a08146..0000000000
--- a/meta/classes/archive-original-source.bbclass
+++ /dev/null
@@ -1,65 +0,0 @@
1# This file is for getting archiving packages with original
2# sources(archive ${S} after unpack stage), patches, logs(archive 'temp'
3# after package_write_rpm), dump data and creating diff file(get all
4# environment variables and functions in building and mapping all
5# content in ${S} including patches to xxx.diff.gz. All archived packages
6# will be deployed in ${DEPLOY_DIR}/sources
7
8inherit archiver
9
10# Get original sources archiving package with patches
11addtask do_archive_original_sources_patches after do_unpack
12
13# Get archiving package with temp(logs) and scripts(.bb and inc files)
14addtask do_archive_scripts_logs
15
16# Get dump date and create diff file
17addtask do_dumpdata_create_diff_gz
18
19python () {
20 pn = d.getVar('PN', True)
21 packaging = d.getVar('IMAGE_PKGTYPE', True)
22
23 if tar_filter(d):
24 return
25
26 d.appendVarFlag('do_dumpdata_create_diff_gz', 'depends', ' %s:do_package_write_' %pn + packaging)
27 build_deps = ' %s:do_dumpdata_create_diff_gz' %pn
28
29 if d.getVar('SOURCE_ARCHIVE_LOG_WITH_SCRIPTS', True) == 'logs_with_scripts':
30 d.appendVarFlag('do_archive_scripts_logs', 'depends', ' %s:do_package_write_' %pn + packaging)
31 build_deps += ' %s:do_archive_scripts_logs' %pn
32
33 if not not_tarball(d):
34 d.appendVarFlag('do_patch', 'depends', ' %s:do_archive_original_sources_patches' %pn)
35 build_deps += ' %s:do_archive_original_sources_patches' %pn
36
37 if bb.data.inherits_class('image', d):
38 d.appendVarFlag('do_rootfs', 'depends', build_deps)
39 else:
40 d.appendVarFlag('do_build', 'depends', build_deps)
41}
42
43ARCHIVE_SSTATE_OUTDIR = "${DEPLOY_DIR}/sources/"
44ARCHIVE_SSTATE_SCRIPTS_LOGS_INDIR = "${WORKDIR}/script-logs/"
45ARCHIVE_SSTATE_DIFFGZ_ENVDATA_INDIR = "${WORKDIR}/diffgz-envdata/"
46
47SSTATETASKS += "do_archive_scripts_logs"
48do_archive_scripts_logs[sstate-inputdirs] = "${ARCHIVE_SSTATE_SCRIPTS_LOGS_INDIR}"
49do_archive_scripts_logs[sstate-outputdirs] = "${ARCHIVE_SSTATE_OUTDIR}"
50
51python do_archive_scripts_logs_setscene () {
52 sstate_setscene(d)
53}
54
55addtask do_archive_scripts_logs_setscene
56
57SSTATETASKS += "do_dumpdata_create_diff_gz"
58do_dumpdata_create_diff_gz[sstate-inputdirs] = "${ARCHIVE_SSTATE_DIFFGZ_ENVDATA_INDIR}"
59do_dumpdata_create_diff_gz[sstate-outputdirs] = "${ARCHIVE_SSTATE_OUTDIR}"
60
61python do_dumpdata_create_diff_gz_setscene () {
62 sstate_setscene(d)
63}
64
65addtask do_dumpdata_create_diff_gz_setscene
diff --git a/meta/classes/archive-patched-source.bbclass b/meta/classes/archive-patched-source.bbclass
deleted file mode 100644
index c5f5cca382..0000000000
--- a/meta/classes/archive-patched-source.bbclass
+++ /dev/null
@@ -1,65 +0,0 @@
1# This file is for getting archiving packages with patched
2# sources(archive ${S} before do_patch stage), logs(archive 'temp' after
3# package_write_rpm), dump data and creating diff file(get all
4# environment variables and functions in building and mapping all
5# content in ${S} including patches to xxx.diff.gz. All archived
6# packages will be deployed in ${DEPLOY_DIR}/sources
7
8inherit archiver
9
10# Get archiving package with patched sources including patches
11addtask do_archive_patched_sources after do_patch
12
13# Get archiving package with logs(temp) and scripts(.bb and .inc files)
14addtask do_archive_scripts_logs
15
16# Get dump date and create diff file
17addtask do_dumpdata_create_diff_gz
18
19python () {
20 pn = d.getVar('PN', True)
21 packaging = d.getVar('IMAGE_PKGTYPE', True)
22
23 if tar_filter(d):
24 return
25
26 d.appendVarFlag('do_dumpdata_create_diff_gz', 'depends', ' %s:do_package_write_' %pn + packaging)
27 build_deps = ' %s:do_dumpdata_create_diff_gz' %pn
28
29 if d.getVar('SOURCE_ARCHIVE_LOG_WITH_SCRIPTS', True) == 'logs_with_scripts':
30 d.appendVarFlag('do_archive_scripts_logs', 'depends', ' %s:do_package_write_' %pn + packaging)
31 build_deps += ' %s:do_archive_scripts_logs' %pn
32
33 if not not_tarball(d):
34 d.appendVarFlag('do_configure', 'depends', ' %s:do_archive_patched_sources' %pn)
35 build_deps += ' %s:do_archive_patched_sources' %pn
36
37 if bb.data.inherits_class('image', d):
38 d.appendVarFlag('do_rootfs', 'depends', build_deps)
39 else:
40 d.appendVarFlag('do_build', 'depends', build_deps)
41}
42
43ARCHIVE_SSTATE_OUTDIR = "${DEPLOY_DIR}/sources/"
44ARCHIVE_SSTATE_SCRIPTS_LOGS_INDIR = "${WORKDIR}/script-logs/"
45ARCHIVE_SSTATE_DIFFGZ_ENVDATA_INDIR = "${WORKDIR}/diffgz-envdata/"
46
47SSTATETASKS += "do_archive_scripts_logs"
48do_archive_scripts_logs[sstate-inputdirs] = "${ARCHIVE_SSTATE_SCRIPTS_LOGS_INDIR}"
49do_archive_scripts_logs[sstate-outputdirs] = "${ARCHIVE_SSTATE_OUTDIR}"
50
51python do_archive_scripts_logs_setscene () {
52 sstate_setscene(d)
53}
54
55addtask do_archive_scripts_logs_setscene
56
57SSTATETASKS += "do_dumpdata_create_diff_gz"
58do_dumpdata_create_diff_gz[sstate-inputdirs] = "${ARCHIVE_SSTATE_DIFFGZ_ENVDATA_INDIR}"
59do_dumpdata_create_diff_gz[sstate-outputdirs] = "${ARCHIVE_SSTATE_OUTDIR}"
60
61python do_dumpdata_create_diff_gz_setscene () {
62 sstate_setscene(d)
63}
64
65addtask do_dumpdata_create_diff_gz_setscene
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-
36COPYLEFT_AVAILABLE_RECIPE_TYPES[type] = 'list' 36COPYLEFT_AVAILABLE_RECIPE_TYPES[type] = 'list'
37COPYLEFT_AVAILABLE_RECIPE_TYPES[doc] = 'Space separated list of available recipe types' 37COPYLEFT_AVAILABLE_RECIPE_TYPES[doc] = 'Space separated list of available recipe types'
38 38
39python () {
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
39def copyleft_recipe_type(d): 66def 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
519python do_archive_original_sources_patches(){ 546python 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}
568do_delete_tarlist[deptask] = "do_archive_scripts_logs" 595do_delete_tarlist[deptask] = "do_archive_scripts_logs"
569do_package_write_rpm[postfuncs] += "do_delete_tarlist " 596do_package_write_rpm[postfuncs] += "do_delete_tarlist "
597
598# Get archiving package with temp(logs) and scripts(.bb and .inc files)
599addtask do_archive_scripts_logs
600
601# Get dump date and create diff file
602addtask do_dumpdata_create_diff_gz
603
604ARCHIVE_SSTATE_OUTDIR = "${DEPLOY_DIR}/sources/"
605ARCHIVE_SSTATE_SCRIPTS_LOGS_INDIR = "${WORKDIR}/script-logs/"
606ARCHIVE_SSTATE_DIFFGZ_ENVDATA_INDIR = "${WORKDIR}/diffgz-envdata/"
607
608SSTATETASKS += "do_archive_scripts_logs"
609do_archive_scripts_logs[sstate-inputdirs] = "${ARCHIVE_SSTATE_SCRIPTS_LOGS_INDIR}"
610do_archive_scripts_logs[sstate-outputdirs] = "${ARCHIVE_SSTATE_OUTDIR}"
611
612python do_archive_scripts_logs_setscene () {
613 sstate_setscene(d)
614}
615
616addtask do_archive_scripts_logs_setscene
617
618SSTATETASKS += "do_dumpdata_create_diff_gz"
619do_dumpdata_create_diff_gz[sstate-inputdirs] = "${ARCHIVE_SSTATE_DIFFGZ_ENVDATA_INDIR}"
620do_dumpdata_create_diff_gz[sstate-outputdirs] = "${ARCHIVE_SSTATE_OUTDIR}"
621
622python do_dumpdata_create_diff_gz_setscene () {
623 sstate_setscene(d)
624}
625
626addtask do_dumpdata_create_diff_gz_setscene
627
628addtask do_archive_original_sources after do_unpack
629addtask do_archive_patched_sources after do_patch
630addtask do_archive_configured_sources after do_configure