]> code.ossystems Code Review - openembedded-core.git/commitdiff
package_manager.py: Avoid installing an empty package list
authorMark Hatle <mark.hatle@windriver.com>
Tue, 19 Jul 2016 07:42:32 +0000 (15:42 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 21 Jul 2016 06:45:01 +0000 (07:45 +0100)
It is possible in an attempt only install, that everything listed is not
available to be installed.  This will have the effect of clearing the
package list.  However, we only check for an empty package list at
the beginning of the function.  We need to also check before running the
install, otherwise we can fail due to 'error: no package(s) given".

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oe/package_manager.py

index 2004a42a01b44b8f029e3a21dca0ec8e749362d7..47f6831f98712972a2cbda0cd189f271fb0721fa 100644 (file)
@@ -1186,6 +1186,9 @@ class RpmPM(PackageManager):
                     new_depends[new_depend] = deps[depend]
                 pkgs = bb.utils.join_deps(new_depends, commasep=True).split(', ')
         pkgs = self._pkg_translate_oe_to_smart(pkgs, attempt_only)
+        if not pkgs:
+            bb.note("There are no packages to install")
+            return
         if not attempt_only:
             bb.note('to be installed: %s' % ' '.join(pkgs))
             cmd = "%s %s install -y %s" % \