diff options
author | Kevin Strasser <kevin.strasser@linux.intel.com> | 2013-03-11 15:51:23 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-03-18 13:18:21 +0000 |
commit | 52026492c61cd51ee53852c8e353cb274c601c88 (patch) | |
tree | 1426cdfcabe8989ab545b67109823888e45237c9 /meta/classes | |
parent | 6b8ed0660fad4c4229bf991968ac98b8c715b3a8 (diff) | |
download | poky-52026492c61cd51ee53852c8e353cb274c601c88.tar.gz |
archiver: fix archive filtering behavior
With the addition of sstate, ensure that archiving tasks are only
added to the build if they produce output in the directory specified
by the 'sstate-inputdirs' flag.
Move calls to 'tar_filter' and 'not_tarball' out to
archive-*-source.bbclass in order to filter out packages before their
archiving tasks are added to the build.
Additionally, negate the return value of copyleft_should_include in
tar_filter, so that packages that do not pass are in turn filtered out.
(From OE-Core rev: 392562a21d9f2deb6fe6f8bb5378b09f4c5918d4)
Signed-off-by: Kevin Strasser <kevin.strasser@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/archive-configured-source.bbclass | 10 | ||||
-rw-r--r-- | meta/classes/archive-original-source.bbclass | 10 | ||||
-rw-r--r-- | meta/classes/archive-patched-source.bbclass | 10 | ||||
-rw-r--r-- | meta/classes/archiver.bbclass | 13 |
4 files changed, 25 insertions, 18 deletions
diff --git a/meta/classes/archive-configured-source.bbclass b/meta/classes/archive-configured-source.bbclass index 2738cab9a5..0f2c9ee329 100644 --- a/meta/classes/archive-configured-source.bbclass +++ b/meta/classes/archive-configured-source.bbclass | |||
@@ -14,11 +14,15 @@ addtask do_archive_configured_sources after do_configure | |||
14 | addtask do_archive_scripts_logs | 14 | addtask do_archive_scripts_logs |
15 | 15 | ||
16 | # Get dump date and create diff file | 16 | # Get dump date and create diff file |
17 | addtask do_dumpdata_create_diff_gz before do_build | 17 | addtask do_dumpdata_create_diff_gz |
18 | 18 | ||
19 | python () { | 19 | python () { |
20 | pn = d.getVar('PN', True) | 20 | pn = d.getVar('PN', True) |
21 | packaging = d.getVar('IMAGE_PKGTYPE', True) | 21 | packaging = d.getVar('IMAGE_PKGTYPE', True) |
22 | |||
23 | if tar_filter(d): | ||
24 | return | ||
25 | |||
22 | d.appendVarFlag('do_dumpdata_create_diff_gz', 'depends', ' %s:do_package_write_' %pn + packaging) | 26 | d.appendVarFlag('do_dumpdata_create_diff_gz', 'depends', ' %s:do_package_write_' %pn + packaging) |
23 | 27 | ||
24 | if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) != 'srpm': | 28 | if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) != 'srpm': |
@@ -27,7 +31,9 @@ python () { | |||
27 | configured sources and scripts/logs in ${DEPLOY_DIR}/sources. | 31 | configured sources and scripts/logs in ${DEPLOY_DIR}/sources. |
28 | """ | 32 | """ |
29 | d.appendVarFlag('do_compile', 'depends', ' %s:do_archive_configured_sources' %pn) | 33 | d.appendVarFlag('do_compile', 'depends', ' %s:do_archive_configured_sources' %pn) |
30 | build_deps = ' %s:do_archive_configured_sources' %pn | 34 | build_deps = ' %s:do_dumpdata_create_diff_gz' %pn |
35 | if not not_tarball(d): | ||
36 | build_deps += ' %s:do_archive_configured_sources' %pn | ||
31 | if d.getVar('SOURCE_ARCHIVE_LOG_WITH_SCRIPTS', True) == 'logs_with_scripts': | 37 | if d.getVar('SOURCE_ARCHIVE_LOG_WITH_SCRIPTS', True) == 'logs_with_scripts': |
32 | build_deps += ' %s:do_archive_scripts_logs' %pn | 38 | build_deps += ' %s:do_archive_scripts_logs' %pn |
33 | d.appendVarFlag('do_archive_scripts_logs', 'depends', ' %s:do_package_write_' %pn + packaging) | 39 | d.appendVarFlag('do_archive_scripts_logs', 'depends', ' %s:do_package_write_' %pn + packaging) |
diff --git a/meta/classes/archive-original-source.bbclass b/meta/classes/archive-original-source.bbclass index 2858d33876..1e138ce2fa 100644 --- a/meta/classes/archive-original-source.bbclass +++ b/meta/classes/archive-original-source.bbclass | |||
@@ -14,11 +14,15 @@ addtask do_archive_original_sources_patches after do_unpack | |||
14 | addtask do_archive_scripts_logs | 14 | addtask do_archive_scripts_logs |
15 | 15 | ||
16 | # Get dump date and create diff file | 16 | # Get dump date and create diff file |
17 | addtask do_dumpdata_create_diff_gz before do_build | 17 | addtask do_dumpdata_create_diff_gz |
18 | 18 | ||
19 | python () { | 19 | python () { |
20 | pn = d.getVar('PN', True) | 20 | pn = d.getVar('PN', True) |
21 | packaging = d.getVar('IMAGE_PKGTYPE', True) | 21 | packaging = d.getVar('IMAGE_PKGTYPE', True) |
22 | |||
23 | if tar_filter(d): | ||
24 | return | ||
25 | |||
22 | d.appendVarFlag('do_dumpdata_create_diff_gz', 'depends', ' %s:do_package_write_' %pn + packaging) | 26 | d.appendVarFlag('do_dumpdata_create_diff_gz', 'depends', ' %s:do_package_write_' %pn + packaging) |
23 | 27 | ||
24 | if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) != 'srpm': | 28 | if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) != 'srpm': |
@@ -27,7 +31,9 @@ python () { | |||
27 | original sources and scripts/logs in ${DEPLOY_DIR}/sources. | 31 | original sources and scripts/logs in ${DEPLOY_DIR}/sources. |
28 | """ | 32 | """ |
29 | d.appendVarFlag('do_patch', 'depends', ' %s:do_archive_original_sources_patches' %pn) | 33 | d.appendVarFlag('do_patch', 'depends', ' %s:do_archive_original_sources_patches' %pn) |
30 | build_deps = ' %s:do_archive_original_sources_patches' %pn | 34 | build_deps = ' %s:do_dumpdata_create_diff_gz' %pn |
35 | if not not_tarball(d): | ||
36 | build_deps += ' %s:do_archive_original_sources_patches' %pn | ||
31 | if d.getVar('SOURCE_ARCHIVE_LOG_WITH_SCRIPTS', True) == 'logs_with_scripts': | 37 | if d.getVar('SOURCE_ARCHIVE_LOG_WITH_SCRIPTS', True) == 'logs_with_scripts': |
32 | build_deps += ' %s:do_archive_scripts_logs' %pn | 38 | build_deps += ' %s:do_archive_scripts_logs' %pn |
33 | d.appendVarFlag('do_archive_scripts_logs', 'depends', ' %s:do_package_write_' %pn + packaging) | 39 | d.appendVarFlag('do_archive_scripts_logs', 'depends', ' %s:do_package_write_' %pn + packaging) |
diff --git a/meta/classes/archive-patched-source.bbclass b/meta/classes/archive-patched-source.bbclass index b47d36cb09..ac6d2c39f1 100644 --- a/meta/classes/archive-patched-source.bbclass +++ b/meta/classes/archive-patched-source.bbclass | |||
@@ -14,11 +14,15 @@ addtask do_archive_patched_sources after do_patch | |||
14 | addtask do_archive_scripts_logs | 14 | addtask do_archive_scripts_logs |
15 | 15 | ||
16 | # Get dump date and create diff file | 16 | # Get dump date and create diff file |
17 | addtask do_dumpdata_create_diff_gz before do_build | 17 | addtask do_dumpdata_create_diff_gz |
18 | 18 | ||
19 | python () { | 19 | python () { |
20 | pn = d.getVar('PN', True) | 20 | pn = d.getVar('PN', True) |
21 | packaging = d.getVar('IMAGE_PKGTYPE', True) | 21 | packaging = d.getVar('IMAGE_PKGTYPE', True) |
22 | |||
23 | if tar_filter(d): | ||
24 | return | ||
25 | |||
22 | d.appendVarFlag('do_dumpdata_create_diff_gz', 'depends', ' %s:do_package_write_' %pn + packaging) | 26 | d.appendVarFlag('do_dumpdata_create_diff_gz', 'depends', ' %s:do_package_write_' %pn + packaging) |
23 | 27 | ||
24 | if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) != 'srpm': | 28 | if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) != 'srpm': |
@@ -27,7 +31,9 @@ python () { | |||
27 | patched sources and scripts/logs in ${DEPLOY_DIR}/sources. | 31 | patched sources and scripts/logs in ${DEPLOY_DIR}/sources. |
28 | """ | 32 | """ |
29 | d.appendVarFlag('do_configure', 'depends', ' %s:do_archive_patched_sources' %pn) | 33 | d.appendVarFlag('do_configure', 'depends', ' %s:do_archive_patched_sources' %pn) |
30 | build_deps = ' %s:do_archive_patched_sources' %pn | 34 | build_deps = ' %s:do_dumpdata_create_diff_gz' %pn |
35 | if not not_tarball(d): | ||
36 | build_deps += ' %s:do_archive_patched_sources' %pn | ||
31 | if d.getVar('SOURCE_ARCHIVE_LOG_WITH_SCRIPTS', True) == 'logs_with_scripts': | 37 | if d.getVar('SOURCE_ARCHIVE_LOG_WITH_SCRIPTS', True) == 'logs_with_scripts': |
32 | build_deps += ' %s:do_archive_scripts_logs' %pn | 38 | build_deps += ' %s:do_archive_scripts_logs' %pn |
33 | d.appendVarFlag('do_archive_scripts_logs', 'depends', ' %s:do_package_write_' %pn + packaging) | 39 | d.appendVarFlag('do_archive_scripts_logs', 'depends', ' %s:do_package_write_' %pn + packaging) |
diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass index 43238272c5..ed07b2edb8 100644 --- a/meta/classes/archiver.bbclass +++ b/meta/classes/archiver.bbclass | |||
@@ -75,10 +75,7 @@ def tar_filter(d): | |||
75 | """ | 75 | """ |
76 | if d.getVar('FILTER', True) == "yes": | 76 | if d.getVar('FILTER', True) == "yes": |
77 | included, reason = copyleft_should_include(d) | 77 | included, reason = copyleft_should_include(d) |
78 | if not included: | 78 | return not included |
79 | return False | ||
80 | else: | ||
81 | return True | ||
82 | else: | 79 | else: |
83 | return False | 80 | return False |
84 | 81 | ||
@@ -400,8 +397,6 @@ def archive_sources_patches(d, stage_name): | |||
400 | import shutil | 397 | import shutil |
401 | 398 | ||
402 | check_archiving_type(d) | 399 | check_archiving_type(d) |
403 | if not_tarball(d) or tar_filter(d): | ||
404 | return | ||
405 | 400 | ||
406 | source_tar_name = archive_sources(d, stage_name) | 401 | source_tar_name = archive_sources(d, stage_name) |
407 | if stage_name == "prepatch": | 402 | if stage_name == "prepatch": |
@@ -431,8 +426,6 @@ def archive_scripts_logs(d): | |||
431 | """ | 426 | """ |
432 | import shutil | 427 | import shutil |
433 | 428 | ||
434 | if tar_filter(d): | ||
435 | return | ||
436 | work_dir = d.getVar('WORKDIR', True) | 429 | work_dir = d.getVar('WORKDIR', True) |
437 | temp_dir = os.path.join(work_dir, 'temp') | 430 | temp_dir = os.path.join(work_dir, 'temp') |
438 | source_archive_log_with_scripts = d.getVar('SOURCE_ARCHIVE_LOG_WITH_SCRIPTS', True) | 431 | source_archive_log_with_scripts = d.getVar('SOURCE_ARCHIVE_LOG_WITH_SCRIPTS', True) |
@@ -459,8 +452,6 @@ def dumpdata(d): | |||
459 | kinds of variables and functions when running a task | 452 | kinds of variables and functions when running a task |
460 | """ | 453 | """ |
461 | 454 | ||
462 | if tar_filter(d): | ||
463 | return | ||
464 | workdir = bb.data.getVar('WORKDIR', d, 1) | 455 | workdir = bb.data.getVar('WORKDIR', d, 1) |
465 | distro = bb.data.getVar('DISTRO', d, 1) | 456 | distro = bb.data.getVar('DISTRO', d, 1) |
466 | s = d.getVar('S', True) | 457 | s = d.getVar('S', True) |
@@ -491,8 +482,6 @@ def create_diff_gz(d): | |||
491 | import shutil | 482 | import shutil |
492 | import subprocess | 483 | import subprocess |
493 | 484 | ||
494 | if tar_filter(d): | ||
495 | return | ||
496 | work_dir = d.getVar('WORKDIR', True) | 485 | work_dir = d.getVar('WORKDIR', True) |
497 | exclude_from = d.getVar('ARCHIVE_EXCLUDE_FROM', True).split() | 486 | exclude_from = d.getVar('ARCHIVE_EXCLUDE_FROM', True).split() |
498 | pf = d.getVar('PF', True) | 487 | pf = d.getVar('PF', True) |