summaryrefslogtreecommitdiffstats
path: root/meta/classes/package_rpm.bbclass
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2012-08-24 14:06:59 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-08-29 16:02:09 -0700
commit44b8c1bb30883ebe71005b89b83ec7e43a957bad (patch)
tree8ee140f5d946b44a61e763ddc9436c31df5bb454 /meta/classes/package_rpm.bbclass
parent4396677ade349c01c8cd0d42b12618723099fbf8 (diff)
downloadpoky-44b8c1bb30883ebe71005b89b83ec7e43a957bad.tar.gz
archiver.bbclass: fix the remove error
* The "tar-package" is used for saving the "Source" list for rpmbuild, there is no such a file when "ARCHIVER_MODE[type] ?= srpm", and there would be errors, it hadn't happen before was becuase that the remove function didn't work. Let the "rpmbuild --rmsource" to remove the Sources, and the remove function will just remove the tar-package file. * Remove several unwanted "try ... exception" sentences, let the error raise rather than ignore them when the error happens. * Remove several un-needed code. [YOCTO #2619] (From OE-Core rev: 6ac3e8be0307ecaea5e92f8bda94f1cd2193a47a) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/package_rpm.bbclass')
-rw-r--r--meta/classes/package_rpm.bbclass25
1 files changed, 7 insertions, 18 deletions
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index d44ab4c693..2c4c89a256 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -575,16 +575,11 @@ python write_specfile () {
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
579 def get_tarballs(d):
580 if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) == 'srpm':
581 return get_package(d)
582
583 # append the name of tarball to key word 'SOURCE' in xxx.spec. 578 # append the name of tarball to key word 'SOURCE' in xxx.spec.
584 def tail_source(d,source_list=[],patch_list=None): 579 def tail_source(d):
585 if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) == 'srpm': 580 if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) == 'srpm':
581 source_list = get_package(d)
586 source_number = 0 582 source_number = 0
587 patch_number = 0
588 workdir = d.getVar('WORKDIR', True) 583 workdir = d.getVar('WORKDIR', True)
589 for source in source_list: 584 for source in source_list:
590 # The rpmbuild doesn't need the root permission, but it needs 585 # The rpmbuild doesn't need the root permission, but it needs
@@ -593,11 +588,6 @@ python write_specfile () {
593 os.chown("%s/%s" % (workdir, source), 0, 0) 588 os.chown("%s/%s" % (workdir, source), 0, 0)
594 spec_preamble_top.append('Source' + str(source_number) + ': %s' % source) 589 spec_preamble_top.append('Source' + str(source_number) + ': %s' % source)
595 source_number += 1 590 source_number += 1
596 if patch_list:
597 for patch in patch_list:
598 os.chown("%s/%s" % (workdir, patch), 0, 0)
599 print_deps(patch, "Patch" + str(patch_number), spec_preamble_top, d)
600 patch_number += 1
601 # We need a simple way to remove the MLPREFIX from the package name, 591 # We need a simple way to remove the MLPREFIX from the package name,
602 # and dependency information... 592 # and dependency information...
603 def strip_multilib(name, d): 593 def strip_multilib(name, d):
@@ -915,8 +905,7 @@ python write_specfile () {
915 spec_preamble_top.append('Group: %s' % srcsection) 905 spec_preamble_top.append('Group: %s' % srcsection)
916 spec_preamble_top.append('Packager: %s' % srcmaintainer) 906 spec_preamble_top.append('Packager: %s' % srcmaintainer)
917 spec_preamble_top.append('URL: %s' % srchomepage) 907 spec_preamble_top.append('URL: %s' % srchomepage)
918 source_list = get_tarballs(d) 908 tail_source(d)
919 tail_source(d,source_list,None)
920 909
921 # Replaces == Obsoletes && Provides 910 # Replaces == Obsoletes && Provides
922 if srcrreplaces and srcrreplaces.strip() != "": 911 if srcrreplaces and srcrreplaces.strip() != "":
@@ -1151,13 +1140,13 @@ python do_package_rpm () {
1151 cmd = cmd + " --define '_sourcedir " + workdir + "'" 1140 cmd = cmd + " --define '_sourcedir " + workdir + "'"
1152 cmdsrpm = cmd + " --define '_srcrpmdir " + creat_srpm_dir(d) + "'" 1141 cmdsrpm = cmd + " --define '_srcrpmdir " + creat_srpm_dir(d) + "'"
1153 cmdsrpm = cmdsrpm + " -bs " + outspecfile 1142 cmdsrpm = cmdsrpm + " -bs " + outspecfile
1154 cmd = cmd + " -bb " + outspecfile 1143 # Build the .src.rpm
1155
1156 # Build the source rpm package !
1157 if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) == 'srpm':
1158 d.setVar('SBUILDSPEC', cmdsrpm + "\n") 1144 d.setVar('SBUILDSPEC', cmdsrpm + "\n")
1159 d.setVarFlag('SBUILDSPEC', 'func', '1') 1145 d.setVarFlag('SBUILDSPEC', 'func', '1')
1160 bb.build.exec_func('SBUILDSPEC', d) 1146 bb.build.exec_func('SBUILDSPEC', d)
1147 # Remove the source (SOURCE0, SOURCE1 ...)
1148 cmd = cmd + " --rmsource "
1149 cmd = cmd + " -bb " + outspecfile
1161 1150
1162 # Build the rpm package! 1151 # Build the rpm package!
1163 d.setVar('BUILDSPEC', cmd + "\n") 1152 d.setVar('BUILDSPEC', cmd + "\n")