package_rpm.bbclass: remove xx.spec before doing rpmbuild xx.src.rpm

If the spec file already exist, and has not been stored into pseudo's files.db,
it maybe cause rpmbuild src.rpm fail, so remove it before doing rpmbuild src.rpm.

(From OE-Core rev: 760af902a98b350a2f1f3203fa0096965924a83d)

Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Bian Naimeng 2013-07-09 08:27:43 +00:00 committed by Richard Purdie
parent 2758fce801
commit 63645af528
1 changed files with 5 additions and 0 deletions

View File

@ -1079,8 +1079,13 @@ python do_package_rpm () {
return
# Construct the spec file...
# If the spec file already exist, and has not been stored into
# pseudo's files.db, it maybe cause rpmbuild src.rpm fail,
# so remove it before doing rpmbuild src.rpm.
srcname = strip_multilib(d.getVar('PN', True), d)
outspecfile = workdir + "/" + srcname + ".spec"
if os.path.isfile(outspecfile):
os.remove(outspecfile)
d.setVar('OUTSPECFILE', outspecfile)
bb.build.exec_func('write_specfile', d)