diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2012-08-24 14:06:59 +0800 |
---|---|---|
committer | Saul Wold <sgw@linux.intel.com> | 2012-08-28 08:03:40 -0700 |
commit | 6ac3e8be0307ecaea5e92f8bda94f1cd2193a47a (patch) | |
tree | 92e8d3d1a6641fa817070da8c6aaed96b433fc7a /meta/classes/package_rpm.bbclass | |
parent | 731e1171d6c35ed086b36c081f48dba2015319f8 (diff) | |
download | openembedded-core-6ac3e8be0307ecaea5e92f8bda94f1cd2193a47a.tar.gz openembedded-core-6ac3e8be0307ecaea5e92f8bda94f1cd2193a47a.tar.bz2 openembedded-core-6ac3e8be0307ecaea5e92f8bda94f1cd2193a47a.zip |
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]
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Diffstat (limited to 'meta/classes/package_rpm.bbclass')
-rw-r--r-- | meta/classes/package_rpm.bbclass | 25 |
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 () { spec_files_bottom.append('%s' % "echo \"include logs and patches, Please check them in SOURCES\"") spec_files_bottom.append('') - # get the name of tarball for sources, patches and logs - def get_tarballs(d): - if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) == 'srpm': - return get_package(d) - # append the name of tarball to key word 'SOURCE' in xxx.spec. - def tail_source(d,source_list=[],patch_list=None): + def tail_source(d): if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) == 'srpm': + source_list = get_package(d) source_number = 0 - patch_number = 0 workdir = d.getVar('WORKDIR', True) for source in source_list: # The rpmbuild doesn't need the root permission, but it needs @@ -593,11 +588,6 @@ python write_specfile () { os.chown("%s/%s" % (workdir, source), 0, 0) spec_preamble_top.append('Source' + str(source_number) + ': %s' % source) source_number += 1 - if patch_list: - for patch in patch_list: - os.chown("%s/%s" % (workdir, patch), 0, 0) - print_deps(patch, "Patch" + str(patch_number), spec_preamble_top, d) - patch_number += 1 # We need a simple way to remove the MLPREFIX from the package name, # and dependency information... def strip_multilib(name, d): @@ -915,8 +905,7 @@ python write_specfile () { spec_preamble_top.append('Group: %s' % srcsection) spec_preamble_top.append('Packager: %s' % srcmaintainer) spec_preamble_top.append('URL: %s' % srchomepage) - source_list = get_tarballs(d) - tail_source(d,source_list,None) + tail_source(d) # Replaces == Obsoletes && Provides if srcrreplaces and srcrreplaces.strip() != "": @@ -1151,13 +1140,13 @@ python do_package_rpm () { cmd = cmd + " --define '_sourcedir " + workdir + "'" cmdsrpm = cmd + " --define '_srcrpmdir " + creat_srpm_dir(d) + "'" cmdsrpm = cmdsrpm + " -bs " + outspecfile - cmd = cmd + " -bb " + outspecfile - - # Build the source rpm package ! - if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) == 'srpm': + # Build the .src.rpm d.setVar('SBUILDSPEC', cmdsrpm + "\n") d.setVarFlag('SBUILDSPEC', 'func', '1') bb.build.exec_func('SBUILDSPEC', d) + # Remove the source (SOURCE0, SOURCE1 ...) + cmd = cmd + " --rmsource " + cmd = cmd + " -bb " + outspecfile # Build the rpm package! d.setVar('BUILDSPEC', cmd + "\n") |