]> code.ossystems Code Review - openembedded-core.git/commitdiff
package_rpm: Fix rootfs generation
authorMark Hatle <mark.hatle@windriver.com>
Thu, 10 Mar 2011 17:58:15 +0000 (11:58 -0600)
committerSaul Wold <sgw@linux.intel.com>
Fri, 11 Mar 2011 02:11:53 +0000 (18:11 -0800)
[YOCTO #797]

During rootfs generation, if other RPM packages are being wrtten
this could cause a failure during the solvedb generation.  We
add a shared lock around the RPM package building.  This will allow
multiple RPM packages to continue to be written at the same time, but
prevent rootfs generation and RPM package generation at the same time.

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
meta/classes/package_rpm.bbclass

index 60127d2ef4035aaa628b0a5020915f8cbc6e3c64..4647116eed51ef4c761b2d9f803a8da01aec6a6e 100644 (file)
@@ -777,10 +777,16 @@ python do_package_rpm () {
        cmd = cmd + " --define 'debug_package %{nil}'"
        cmd = cmd + " -bb " + outspecfile
 
-       # Build the spec file!
+       # Take a shared lock, we can write multiple packages at the same time...
+       # but we need to stop the rootfs/solver from running while we do...
+       lf = bb.utils.lockfile(bb.data.expand("${DEPLOY_DIR_RPM}/rpm.lock", d), True)
+
+       # Build the rpm package!
        bb.data.setVar('BUILDSPEC', cmd + "\n", d)
        bb.data.setVarFlag('BUILDSPEC', 'func', '1', d)
        bb.build.exec_func('BUILDSPEC', d)
+
+       bb.utils.unlockfile(lf)
 }
 
 python () {