diff options
Diffstat (limited to 'meta/classes/archiver.bbclass')
-rw-r--r-- | meta/classes/archiver.bbclass | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass index 7056714bd7..19c5567714 100644 --- a/meta/classes/archiver.bbclass +++ b/meta/classes/archiver.bbclass | |||
@@ -7,9 +7,9 @@ | |||
7 | # | 7 | # |
8 | 8 | ||
9 | ARCHIVE_EXCLUDE_FROM ?= ".pc autom4te.cache" | 9 | ARCHIVE_EXCLUDE_FROM ?= ".pc autom4te.cache" |
10 | ARCHIVE_TYPE ?= "TAR SRPM" | 10 | ARCHIVE_TYPE ?= "tar srpm" |
11 | DISTRO ?= "poky" | 11 | DISTRO ?= "poky" |
12 | PATCHES_ARCHIVE_WITH_SERIES = 'TRUE' | 12 | PATCHES_ARCHIVE_WITH_SERIES = 'yes' |
13 | SOURCE_ARCHIVE_LOG_WITH_SCRIPTS ?= '${@d.getVarFlag('ARCHIVER_MODE', 'log_type') \ | 13 | SOURCE_ARCHIVE_LOG_WITH_SCRIPTS ?= '${@d.getVarFlag('ARCHIVER_MODE', 'log_type') \ |
14 | if d.getVarFlag('ARCHIVER_MODE', 'log_type') != 'none' else 'logs_with_scripts'}' | 14 | if d.getVarFlag('ARCHIVER_MODE', 'log_type') != 'none' else 'logs_with_scripts'}' |
15 | SOURCE_ARCHIVE_PACKAGE_TYPE ?= '${@d.getVarFlag('ARCHIVER_MODE', 'type') \ | 15 | SOURCE_ARCHIVE_PACKAGE_TYPE ?= '${@d.getVarFlag('ARCHIVER_MODE', 'type') \ |
@@ -74,7 +74,7 @@ def tar_filter(d): | |||
74 | and ignore the one in COPYLEFT_LICENSE_EXCLUDE. Don't exclude any | 74 | and ignore the one in COPYLEFT_LICENSE_EXCLUDE. Don't exclude any |
75 | packages when \"FILTER\" is \"no\" | 75 | packages when \"FILTER\" is \"no\" |
76 | """ | 76 | """ |
77 | if d.getVar('FILTER', True).upper() == "YES": | 77 | if d.getVar('FILTER', True) == "yes": |
78 | included, reason = copyleft_should_include(d) | 78 | included, reason = copyleft_should_include(d) |
79 | if not included: | 79 | if not included: |
80 | return False | 80 | return False |
@@ -235,7 +235,6 @@ def archive_sources_from_directory(d, stage_name): | |||
235 | archive sources codes tree to tarball when tarball of $P doesn't | 235 | archive sources codes tree to tarball when tarball of $P doesn't |
236 | exist in $DL_DIR | 236 | exist in $DL_DIR |
237 | """ | 237 | """ |
238 | import shutil | ||
239 | 238 | ||
240 | s = d.getVar('S', True) | 239 | s = d.getVar('S', True) |
241 | work_dir=d.getVar('WORKDIR', True) | 240 | work_dir=d.getVar('WORKDIR', True) |
@@ -353,10 +352,7 @@ def move_tarball_deploy(d, tarball_list): | |||
353 | 352 | ||
354 | def check_archiving_type(d): | 353 | def check_archiving_type(d): |
355 | """check the type for archiving package('tar' or 'srpm')""" | 354 | """check the type for archiving package('tar' or 'srpm')""" |
356 | try: | 355 | if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) not in d.getVar('ARCHIVE_TYPE', True).split(): |
357 | if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True).upper() not in d.getVar('ARCHIVE_TYPE', True).split(): | ||
358 | raise AttributeError | ||
359 | except AttributeError: | ||
360 | bb.fatal("\"SOURCE_ARCHIVE_PACKAGE_TYPE\" is \'tar\' or \'srpm\', no other types") | 356 | bb.fatal("\"SOURCE_ARCHIVE_PACKAGE_TYPE\" is \'tar\' or \'srpm\', no other types") |
361 | 357 | ||
362 | def store_package(d, package_name): | 358 | def store_package(d, package_name): |
@@ -399,16 +395,16 @@ def archive_sources_patches(d, stage_name): | |||
399 | 395 | ||
400 | source_tar_name = archive_sources(d, stage_name) | 396 | source_tar_name = archive_sources(d, stage_name) |
401 | if stage_name == "prepatch": | 397 | if stage_name == "prepatch": |
402 | if d.getVar('PATCHES_ARCHIVE_WITH_SERIES', True).upper() == 'TRUE': | 398 | if d.getVar('PATCHES_ARCHIVE_WITH_SERIES', True) == 'yes': |
403 | patch_tar_name = select_archive_patches(d, "all") | 399 | patch_tar_name = select_archive_patches(d, "all") |
404 | elif d.getVar('PATCHES_ARCHIVE_WITH_SERIES', True).upper() == 'FALSE': | 400 | elif d.getVar('PATCHES_ARCHIVE_WITH_SERIES', True) == 'no': |
405 | patch_tar_name = select_archive_patches(d, "applying") | 401 | patch_tar_name = select_archive_patches(d, "applying") |
406 | else: | 402 | else: |
407 | bb.fatal("Please define 'PATCHES_ARCHIVE_WITH_SERIES' is strings 'True' or 'False' ") | 403 | bb.fatal("Please define 'PATCHES_ARCHIVE_WITH_SERIES' to 'yes' or 'no' ") |
408 | else: | 404 | else: |
409 | patch_tar_name = '' | 405 | patch_tar_name = '' |
410 | 406 | ||
411 | if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True).upper() not in 'SRPM': | 407 | if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) != 'srpm': |
412 | move_tarball_deploy(d, [source_tar_name, patch_tar_name]) | 408 | move_tarball_deploy(d, [source_tar_name, patch_tar_name]) |
413 | else: | 409 | else: |
414 | tarpackage = os.path.join(d.getVar('WORKDIR', True), 'tar-package') | 410 | tarpackage = os.path.join(d.getVar('WORKDIR', True), 'tar-package') |
@@ -438,7 +434,7 @@ def archive_scripts_logs(d): | |||
438 | else: | 434 | else: |
439 | return | 435 | return |
440 | 436 | ||
441 | if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True).upper() not in 'SRPM': | 437 | if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) != 'srpm': |
442 | move_tarball_deploy(d, [tarlog]) | 438 | move_tarball_deploy(d, [tarlog]) |
443 | 439 | ||
444 | else: | 440 | else: |
@@ -556,14 +552,14 @@ python do_archive_linux_yocto(){ | |||
556 | s = d.getVar('S', True) | 552 | s = d.getVar('S', True) |
557 | if 'linux-yocto' in s: | 553 | if 'linux-yocto' in s: |
558 | source_tar_name = archive_sources(d, '') | 554 | source_tar_name = archive_sources(d, '') |
559 | if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True).upper() not in 'SRPM': | 555 | if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) != 'srpm': |
560 | move_tarball_deploy(d, [source_tar_name, '']) | 556 | move_tarball_deploy(d, [source_tar_name, '']) |
561 | } | 557 | } |
562 | do_kernel_checkout[postfuncs] += "do_archive_linux_yocto " | 558 | do_kernel_checkout[postfuncs] += "do_archive_linux_yocto " |
563 | 559 | ||
564 | # remove tarball for sources, patches and logs after creating srpm. | 560 | # remove tarball for sources, patches and logs after creating srpm. |
565 | python do_remove_tarball(){ | 561 | python do_remove_tarball(){ |
566 | if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True).upper() == 'SRPM': | 562 | if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) == 'srpm': |
567 | work_dir = d.getVar('WORKDIR', True) | 563 | work_dir = d.getVar('WORKDIR', True) |
568 | try: | 564 | try: |
569 | for file in os.listdir(os.getcwd()): | 565 | for file in os.listdir(os.getcwd()): |