[oe-commits] [openembedded-core] 01/14: package_manager: handle remove() with no packages
git at git.openembedded.org
git at git.openembedded.org
Thu Oct 18 10:06:15 UTC 2018
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master-next
in repository openembedded-core.
commit 715ec20c433cb4ed5fde938c33a42b2a296e4e56
Author: Ross Burton <ross.burton at intel.com>
AuthorDate: Tue Oct 16 14:32:04 2018 +0100
package_manager: handle remove() with no packages
If remove() is called with an empty package list, ensure we do nothing instead
of calling the underlying package manager with an invalid command line.
[ YOCTO #12900 ]
Signed-off-by: Ross Burton <ross.burton at intel.com>
---
meta/lib/oe/package_manager.py | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 5964c61..2cc1c75 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -864,8 +864,9 @@ class RpmPM(PackageManager):
failed_postinsts_abort(list(failed_scriptlets_pkgnames.keys()), self.d.expand("${T}/log.do_${BB_CURRENTTASK}"))
def remove(self, pkgs, with_dependencies = True):
- if len(pkgs) == 0:
+ if not pkgs:
return
+
self._prepare_pkg_transaction()
if with_dependencies:
@@ -1353,6 +1354,9 @@ class OpkgPM(OpkgDpkgPM):
(cmd, e.returncode, e.output.decode("utf-8")))
def remove(self, pkgs, with_dependencies=True):
+ if not pkgs:
+ return
+
if with_dependencies:
cmd = "%s %s --force-remove --force-removal-of-dependent-packages remove %s" % \
(self.opkg_cmd, self.opkg_args, ' '.join(pkgs))
@@ -1663,6 +1667,9 @@ class DpkgPM(OpkgDpkgPM):
def remove(self, pkgs, with_dependencies=True):
+ if not pkgs:
+ return
+
if with_dependencies:
os.environ['APT_CONFIG'] = self.apt_conf_file
cmd = "%s purge %s" % (self.apt_get_cmd, ' '.join(pkgs))
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list