summaryrefslogtreecommitdiff
path: root/meta/classes/package_rpm.bbclass
diff options
context:
space:
mode:
authorBian Naimeng <biannm@cn.fujitsu.com>2013-07-09 08:27:43 +0000
committerSaul Wold <sgw@linux.intel.com>2013-07-12 10:12:10 -0700
commit760af902a98b350a2f1f3203fa0096965924a83d (patch)
treee79147f6f5aa470ed624d9db5e369594fba38a48 /meta/classes/package_rpm.bbclass
parent04568c35c989f0b28769d3b00ee902cb3a6ef2bc (diff)
downloadopenembedded-core-760af902a98b350a2f1f3203fa0096965924a83d.tar.gz
openembedded-core-760af902a98b350a2f1f3203fa0096965924a83d.tar.bz2
openembedded-core-760af902a98b350a2f1f3203fa0096965924a83d.zip
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. Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
Diffstat (limited to 'meta/classes/package_rpm.bbclass')
-rw-r--r--meta/classes/package_rpm.bbclass5
1 files changed, 5 insertions, 0 deletions
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index fa928ce042..1537079bb0 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -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)