]> code.ossystems Code Review - openembedded-core.git/commitdiff
package_rpm.bbclass: remove xx.spec before doing rpmbuild xx.src.rpm
authorBian Naimeng <biannm@cn.fujitsu.com>
Tue, 9 Jul 2013 08:27:43 +0000 (08:27 +0000)
committerSaul Wold <sgw@linux.intel.com>
Fri, 12 Jul 2013 17:12:10 +0000 (10:12 -0700)
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>
meta/classes/package_rpm.bbclass

index fa928ce0422a9fc72103e187e2597cb90b2d7d6d..1537079bb059e48aa48afc637992f79b0cd7e0fc 100644 (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)