diff options
author | Laurentiu Palcu <laurentiu.palcu@intel.com> | 2014-01-13 10:01:53 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-02-11 11:50:26 +0000 |
commit | cb03d15482569c2e56232c921526938dcecfdb68 (patch) | |
tree | d16158aef52ca099a27d5bae2d61e49d5002745c /meta/lib/oe | |
parent | bac2e279005b601daff4d53549612ceb76a6a857 (diff) | |
download | openembedded-core-cb03d15482569c2e56232c921526938dcecfdb68.tar.gz openembedded-core-cb03d15482569c2e56232c921526938dcecfdb68.tar.bz2 openembedded-core-cb03d15482569c2e56232c921526938dcecfdb68.zip |
lib/oe/package_manager.py: add deploy dir locking mechanism
This is needed in order to serialize the index file creation when
multiple do_rootfs tasks are running in the same time.
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Diffstat (limited to 'meta/lib/oe')
-rw-r--r-- | meta/lib/oe/package_manager.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py index 93ca78acb2..f84644c62d 100644 --- a/meta/lib/oe/package_manager.py +++ b/meta/lib/oe/package_manager.py @@ -27,6 +27,8 @@ class PackageManager(object): def __init__(self, d): self.d = d + self.deploy_dir = None + self.deploy_lock = None """ Update the package manager package database. @@ -110,6 +112,21 @@ class PackageManager(object): self.install(complementary_pkgs.split(), attempt_only=True) + def deploy_dir_lock(self): + if self.deploy_dir is None: + raise RuntimeError("deploy_dir is not set!") + + lock_file_name = os.path.join(self.deploy_dir, "deploy.lock") + + self.deploy_lock = bb.utils.lockfile(lock_file_name) + + def deploy_dir_unlock(self): + if self.deploy_lock is None: + return + + bb.utils.unlockfile(self.deploy_lock) + + self.deploy_lock = None class RpmPM(PackageManager): def __init__(self): |