summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/archiver.bbclass26
-rw-r--r--meta/classes/package_rpm.bbclass12
2 files changed, 17 insertions, 21 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
9ARCHIVE_EXCLUDE_FROM ?= ".pc autom4te.cache" 9ARCHIVE_EXCLUDE_FROM ?= ".pc autom4te.cache"
10ARCHIVE_TYPE ?= "TAR SRPM" 10ARCHIVE_TYPE ?= "tar srpm"
11DISTRO ?= "poky" 11DISTRO ?= "poky"
12PATCHES_ARCHIVE_WITH_SERIES = 'TRUE' 12PATCHES_ARCHIVE_WITH_SERIES = 'yes'
13SOURCE_ARCHIVE_LOG_WITH_SCRIPTS ?= '${@d.getVarFlag('ARCHIVER_MODE', 'log_type') \ 13SOURCE_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'}'
15SOURCE_ARCHIVE_PACKAGE_TYPE ?= '${@d.getVarFlag('ARCHIVER_MODE', 'type') \ 15SOURCE_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
354def check_archiving_type(d): 353def 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
362def store_package(d, package_name): 358def 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}
562do_kernel_checkout[postfuncs] += "do_archive_linux_yocto " 558do_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.
565python do_remove_tarball(){ 561python 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()):
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index b999c28a9b..d44ab4c693 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -570,19 +570,19 @@ python write_specfile () {
570 570
571 # append information for logs and patches to %prep 571 # append information for logs and patches to %prep
572 def add_prep(d,spec_files_bottom): 572 def add_prep(d,spec_files_bottom):
573 if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) and d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True).upper() == 'SRPM': 573 if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) == 'srpm':
574 spec_files_bottom.append('%%prep -n %s' % d.getVar('PN', True) ) 574 spec_files_bottom.append('%%prep -n %s' % d.getVar('PN', True) )
575 spec_files_bottom.append('%s' % "echo \"include logs and patches, Please check them in SOURCES\"") 575 spec_files_bottom.append('%s' % "echo \"include logs and patches, Please check them in SOURCES\"")
576 spec_files_bottom.append('') 576 spec_files_bottom.append('')
577 577
578 # get the name of tarball for sources, patches and logs 578 # get the name of tarball for sources, patches and logs
579 def get_tarballs(d): 579 def get_tarballs(d):
580 if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) and d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True).upper() == 'SRPM': 580 if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) == 'srpm':
581 return get_package(d) 581 return get_package(d)
582 582
583 # append the name of tarball to key word 'SOURCE' in xxx.spec. 583 # append the name of tarball to key word 'SOURCE' in xxx.spec.
584 def tail_source(d,source_list=[],patch_list=None): 584 def tail_source(d,source_list=[],patch_list=None):
585 if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) and d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True).upper() == 'SRPM': 585 if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) == 'srpm':
586 source_number = 0 586 source_number = 0
587 patch_number = 0 587 patch_number = 0
588 workdir = d.getVar('WORKDIR', True) 588 workdir = d.getVar('WORKDIR', True)
@@ -1020,7 +1020,7 @@ python write_specfile () {
1020 1020
1021python do_package_rpm () { 1021python do_package_rpm () {
1022 def creat_srpm_dir(d): 1022 def creat_srpm_dir(d):
1023 if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) and d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True).upper() == 'SRPM': 1023 if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) == 'srpm':
1024 clean_licenses = get_licenses(d) 1024 clean_licenses = get_licenses(d)
1025 pkgwritesrpmdir = bb.data.expand('${PKGWRITEDIRSRPM}/${PACKAGE_ARCH_EXTEND}', d) 1025 pkgwritesrpmdir = bb.data.expand('${PKGWRITEDIRSRPM}/${PACKAGE_ARCH_EXTEND}', d)
1026 pkgwritesrpmdir = pkgwritesrpmdir + '/' + clean_licenses 1026 pkgwritesrpmdir = pkgwritesrpmdir + '/' + clean_licenses
@@ -1147,14 +1147,14 @@ python do_package_rpm () {
1147 cmd = cmd + " --define 'debug_package %{nil}'" 1147 cmd = cmd + " --define 'debug_package %{nil}'"
1148 cmd = cmd + " --define '_rpmfc_magic_path " + magicfile + "'" 1148 cmd = cmd + " --define '_rpmfc_magic_path " + magicfile + "'"
1149 cmd = cmd + " --define '_tmppath " + workdir + "'" 1149 cmd = cmd + " --define '_tmppath " + workdir + "'"
1150 if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) and d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True).upper() == 'SRPM': 1150 if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) == 'srpm':
1151 cmd = cmd + " --define '_sourcedir " + workdir + "'" 1151 cmd = cmd + " --define '_sourcedir " + workdir + "'"
1152 cmdsrpm = cmd + " --define '_srcrpmdir " + creat_srpm_dir(d) + "'" 1152 cmdsrpm = cmd + " --define '_srcrpmdir " + creat_srpm_dir(d) + "'"
1153 cmdsrpm = cmdsrpm + " -bs " + outspecfile 1153 cmdsrpm = cmdsrpm + " -bs " + outspecfile
1154 cmd = cmd + " -bb " + outspecfile 1154 cmd = cmd + " -bb " + outspecfile
1155 1155
1156 # Build the source rpm package ! 1156 # Build the source rpm package !
1157 if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) and d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True).upper() == 'SRPM': 1157 if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) == 'srpm':
1158 d.setVar('SBUILDSPEC', cmdsrpm + "\n") 1158 d.setVar('SBUILDSPEC', cmdsrpm + "\n")
1159 d.setVarFlag('SBUILDSPEC', 'func', '1') 1159 d.setVarFlag('SBUILDSPEC', 'func', '1')
1160 bb.build.exec_func('SBUILDSPEC', d) 1160 bb.build.exec_func('SBUILDSPEC', d)