aboutsummaryrefslogtreecommitdiffstats
path: root/classes
diff options
context:
space:
mode:
authorTom Rini <tom_rini@mentor.com>2011-02-25 13:23:44 -0700
committerTom Rini <tom_rini@mentor.com>2011-02-25 13:23:44 -0700
commitac9745f0fe92cae24c540c864f9a5c4bbff797f6 (patch)
treeff5ce7e44271941f4d07062f2214b661aa4e4507 /classes
parentb5d9ac7e30e95ae4e29aad997707d500047325ab (diff)
downloadopenembedded-ac9745f0fe92cae24c540c864f9a5c4bbff797f6.tar.gz
package.bbclass: Update locking now that pstaging is always on.
In a few functions we checked if pstagingactive was set and if so, grabbed the lock. But really, we should always be locking here. And inside of package_do_shlibs we need to keep the lock a little longer than we had been otherwise we can run into a race.. Signed-off-by: Tom Rini <tom_rini@mentor.com>
Diffstat (limited to 'classes')
-rw-r--r--classes/package.bbclass24
1 files changed, 7 insertions, 17 deletions
diff --git a/classes/package.bbclass b/classes/package.bbclass
index ce7ff869e4..901ad9d1c3 100644
--- a/classes/package.bbclass
+++ b/classes/package.bbclass
@@ -543,9 +543,7 @@ python emit_pkgdata() {
pkgdest = bb.data.getVar('PKGDEST', d, 1)
pkgdatadir = bb.data.getVar('PKGDATA_DIR', d, True)
- pstageactive = bb.data.getVar('PSTAGING_ACTIVE', d, True)
- if pstageactive == "1":
- lf = bb.utils.lockfile(bb.data.expand("${STAGING_DIR}/staging.lock", d))
+ lf = bb.utils.lockfile(bb.data.expand("${STAGING_DIR}/staging.lock", d))
data_file = pkgdatadir + bb.data.expand("/${PN}" , d)
f = open(data_file, 'w')
@@ -593,8 +591,7 @@ python emit_pkgdata() {
packagedfile = pkgdatadir + '/runtime/%s.packaged' % pkg
file(packagedfile, 'w').close()
package_stagefile(packagedfile, d)
- if pstageactive == "1":
- bb.utils.unlockfile(lf)
+ bb.utils.unlockfile(lf)
}
emit_pkgdata[dirs] = "${PKGDATA_DIR}/runtime"
@@ -634,10 +631,6 @@ python package_do_shlibs() {
shlibs_dir = bb.data.getVar('SHLIBSDIR', d, True)
bb.mkdirhier(shlibs_dir)
- pstageactive = bb.data.getVar('PSTAGING_ACTIVE', d, True)
- if pstageactive == "1":
- lf = bb.utils.lockfile(bb.data.expand("${STAGING_DIR}/staging.lock", d))
-
if bb.data.getVar('PACKAGE_SNAP_LIB_SYMLINKS', d, True) == "1":
snap_symlinks = True
else:
@@ -650,6 +643,8 @@ python package_do_shlibs() {
needed = {}
private_libs = bb.data.getVar('PRIVATE_LIBS', d, True)
+
+ lf = bb.utils.lockfile(bb.data.expand("${STAGING_DIR}/staging.lock", d))
for pkg in packages.split():
needs_ldconfig = False
bb.debug(2, "calculating shlib provides for %s" % pkg)
@@ -715,9 +710,6 @@ python package_do_shlibs() {
postinst += bb.data.getVar('ldconfig_postinst_fragment', d, True)
bb.data.setVar('pkg_postinst_%s' % pkg, postinst, d)
- if pstageactive == "1":
- bb.utils.unlockfile(lf)
-
shlib_provider = {}
list_re = re.compile('^(.*)\.list$')
for dir in [shlibs_dir]:
@@ -738,6 +730,7 @@ python package_do_shlibs() {
fd.close()
for l in lines:
shlib_provider[l.rstrip()] = (dep_pkg, lib_ver)
+ bb.utils.unlockfile(lf)
assumed_libs = bb.data.getVar('ASSUME_SHLIBS', d, True)
if assumed_libs:
@@ -831,9 +824,7 @@ python package_do_pkgconfig () {
if hdr == 'Requires':
pkgconfig_needed[pkg] += exp.replace(',', ' ').split()
- pstageactive = bb.data.getVar('PSTAGING_ACTIVE', d, True)
- if pstageactive == "1":
- lf = bb.utils.lockfile(bb.data.expand("${STAGING_DIR}/staging.lock", d))
+ lf = bb.utils.lockfile(bb.data.expand("${STAGING_DIR}/staging.lock", d))
for pkg in packages.split():
pkgs_file = os.path.join(shlibs_dir, pkg + ".pclist")
@@ -881,8 +872,7 @@ python package_do_pkgconfig () {
fd.close()
package_stagefile(deps_file, d)
- if pstageactive == "1":
- bb.utils.unlockfile(lf)
+ bb.utils.unlockfile(lf)
}
python read_shlibdeps () {