summaryrefslogtreecommitdiff
path: root/classes/package_deb.bbclass
diff options
context:
space:
mode:
authorLeon Woestenberg <leon.woestenberg@gmail.com>2007-09-06 17:57:09 +0000
committerLeon Woestenberg <leon.woestenberg@gmail.com>2007-09-06 17:57:09 +0000
commitd39ad541854182c47c70071aa6c883ba3480b994 (patch)
tree068ca2b589703211ec9b130e84aa3ffe8cdb81ea /classes/package_deb.bbclass
parentee94da8a579022c9654f3e3659b8f2f243c57bb4 (diff)
parentc5cc423a2ce2c5a1659c171aefcbcec22b768c56 (diff)
merge of '4a859de905afc30ec35cf91dcd1dd6c18307c1f8'
and '9c6ceb61576fa98453a24fedb60c9d2b23d79c72'
Diffstat (limited to 'classes/package_deb.bbclass')
-rw-r--r--classes/package_deb.bbclass36
1 files changed, 29 insertions, 7 deletions
diff --git a/classes/package_deb.bbclass b/classes/package_deb.bbclass
index c322af1f15..2ab537f174 100644
--- a/classes/package_deb.bbclass
+++ b/classes/package_deb.bbclass
@@ -4,11 +4,8 @@
inherit package
-PACKAGE_EXTRA_DEPENDS += "dpkg-native fakeroot-native"
-
BOOTSTRAP_EXTRA_RDEPENDS += "dpkg"
DISTRO_EXTRA_RDEPENDS += "dpkg"
-PACKAGE_WRITE_FUNCS += "do_package_deb"
IMAGE_PKGTYPE ?= "deb"
python package_deb_fn () {
@@ -64,9 +61,7 @@ python do_package_deb_install () {
}
python do_package_deb () {
- import copy # to back up env data
- import sys
- import re
+ import sys, re, fcntl, copy
workdir = bb.data.getVar('WORKDIR', d, 1)
if not workdir:
@@ -99,10 +94,21 @@ python do_package_deb () {
bb.debug(1, "No packages; nothing to do")
return
+ def lockfile(name):
+ lf = open(name, "a+")
+ fcntl.flock(lf.fileno(), fcntl.LOCK_EX)
+ return lf
+
+ def unlockfile(lf):
+ fcntl.flock(lf.fileno(), fcntl.LOCK_UN)
+ lf.close
+
for pkg in packages.split():
localdata = bb.data.createCopy(d)
root = "%s/install/%s" % (workdir, pkg)
+ lf = lockfile(root + ".lock")
+
bb.data.setVar('ROOT', '', localdata)
bb.data.setVar('ROOT_%s' % pkg, root, localdata)
pkgname = bb.data.getVar('PKG_%s' % pkg, localdata, 1)
@@ -133,6 +139,7 @@ python do_package_deb () {
if not g and bb.data.getVar('ALLOW_EMPTY', localdata) != "1":
from bb import note
note("Not creating empty archive for %s-%s-%s" % (pkg, bb.data.getVar('PV', localdata, 1), bb.data.getVar('PR', localdata, 1)))
+ unlockfile(lf)
continue
controldir = os.path.join(root, 'DEBIAN')
bb.mkdirhier(controldir)
@@ -246,5 +253,20 @@ python do_package_deb () {
os.rmdir(controldir)
except OSError:
pass
- del localdata
+
+ unlockfile(lf)
}
+
+python () {
+ import bb
+ if bb.data.getVar('PACKAGES', d, True) != '':
+ bb.data.setVarFlag('do_package_write_deb', 'depends', 'dpkg-native:do_populate_staging fakeroot-native:do_populate_staging', d)
+}
+
+python do_package_write_deb () {
+ bb.build.exec_func("read_subpackage_metadata", d)
+ bb.build.exec_func("do_package_deb", d)
+}
+do_package_write_deb[dirs] = "${D}"
+addtask package_write_deb before do_package_write after do_package
+