diff options
author | Laurentiu Palcu <laurentiu.palcu@intel.com> | 2014-01-28 14:43:14 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-02-11 11:53:43 +0000 |
commit | ce12c1bf9f06299de0b09ca3e44e051f9928f030 (patch) | |
tree | 5e702b49aca96ab211164123847217cc5747c395 | |
parent | a150272845eaa5acdaa4981c1a826086c631fbca (diff) | |
download | poky-ce12c1bf9f06299de0b09ca3e44e051f9928f030.tar.gz |
lib/oe/package_manager.py: DpkgPM, use lock on deploy dir
Lock deploy directory against concurrent index creation.
(From OE-Core rev: 127d19b84e78b5e650d0e6d7eaf29a8b7d799e5e)
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oe/package_manager.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py index 8a58d611be..2e5aa82568 100644 --- a/meta/lib/oe/package_manager.py +++ b/meta/lib/oe/package_manager.py | |||
@@ -1086,6 +1086,8 @@ class DpkgPM(PackageManager): | |||
1086 | def update(self): | 1086 | def update(self): |
1087 | os.environ['APT_CONFIG'] = self.apt_conf_file | 1087 | os.environ['APT_CONFIG'] = self.apt_conf_file |
1088 | 1088 | ||
1089 | self.deploy_dir_lock() | ||
1090 | |||
1089 | cmd = "%s update" % self.apt_get_cmd | 1091 | cmd = "%s update" % self.apt_get_cmd |
1090 | 1092 | ||
1091 | try: | 1093 | try: |
@@ -1094,6 +1096,8 @@ class DpkgPM(PackageManager): | |||
1094 | bb.fatal("Unable to update the package index files. Command %s " | 1096 | bb.fatal("Unable to update the package index files. Command %s " |
1095 | "returned %d" % (e.cmd, e.returncode)) | 1097 | "returned %d" % (e.cmd, e.returncode)) |
1096 | 1098 | ||
1099 | self.deploy_dir_unlock() | ||
1100 | |||
1097 | def install(self, pkgs, attempt_only=False): | 1101 | def install(self, pkgs, attempt_only=False): |
1098 | os.environ['APT_CONFIG'] = self.apt_conf_file | 1102 | os.environ['APT_CONFIG'] = self.apt_conf_file |
1099 | 1103 | ||
@@ -1154,6 +1158,8 @@ class DpkgPM(PackageManager): | |||
1154 | dpkg_scanpackages = bb.utils.which(os.getenv('PATH'), "dpkg-scanpackages") | 1158 | dpkg_scanpackages = bb.utils.which(os.getenv('PATH'), "dpkg-scanpackages") |
1155 | gzip = bb.utils.which(os.getenv('PATH'), "gzip") | 1159 | gzip = bb.utils.which(os.getenv('PATH'), "gzip") |
1156 | 1160 | ||
1161 | self.deploy_dir_lock() | ||
1162 | |||
1157 | index_cmds = [] | 1163 | index_cmds = [] |
1158 | deb_dirs_found = False | 1164 | deb_dirs_found = False |
1159 | for arch in arch_list: | 1165 | for arch in arch_list: |
@@ -1178,6 +1184,8 @@ class DpkgPM(PackageManager): | |||
1178 | pool.close() | 1184 | pool.close() |
1179 | pool.join() | 1185 | pool.join() |
1180 | 1186 | ||
1187 | self.deploy_dir_unlock() | ||
1188 | |||
1181 | for result in results: | 1189 | for result in results: |
1182 | if result is not None: | 1190 | if result is not None: |
1183 | bb.fatal(result) | 1191 | bb.fatal(result) |