If the locks are not removed, the output of the next rpm command executed will contain the following string:
rpmdb: BDB1540 configured environment flags incompatible with existing environment And this will create various parsing issues. [YOCTO #6049] Signed-off-by: Laurentiu Palcu <laurentiu.pa...@intel.com> --- meta/lib/oe/package_manager.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py index 764ab72..0f22e46 100644 --- a/meta/lib/oe/package_manager.py +++ b/meta/lib/oe/package_manager.py @@ -242,6 +242,12 @@ class RpmPkgsList(PkgsList): self.ml_prefix_list, self.ml_os_list = \ RpmIndexer(d, rootfs_dir).get_ml_prefix_and_os_list(arch_var, os_var) + def _unlock_rpm_db(self): + # Remove rpm db lock files + rpm_db_locks = glob.glob('%s/var/lib/rpm/__db.*' % self.rootfs_dir) + for f in rpm_db_locks: + bb.utils.remove(f, True) + ''' Translate the RPM/Smart format names to the OE multilib format names ''' @@ -281,6 +287,8 @@ class RpmPkgsList(PkgsList): try: output = subprocess.check_output(cmd, stderr=subprocess.STDOUT).strip() + + self._unlock_rpm_db() except subprocess.CalledProcessError as e: bb.fatal("Cannot get the package dependencies. Command '%s' " "returned %d:\n%s" % (' '.join(cmd), e.returncode, e.output)) @@ -299,9 +307,7 @@ class RpmPkgsList(PkgsList): # bb.note(cmd) tmp_output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True).strip() - rpm_db_locks = glob.glob('%s/var/lib/rpm/__db.*' % self.rootfs_dir) - for f in rpm_db_locks: - bb.utils.remove(f, True) + self._unlock_rpm_db() except subprocess.CalledProcessError as e: bb.fatal("Cannot get the installed packages list. Command '%s' " "returned %d:\n%s" % (cmd, e.returncode, e.output)) -- 1.7.9.5 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core