summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2025-09-11 20:33:25 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-09-15 17:57:24 +0100
commit8b48566f53760decc18490cd775c2193e65dbdcc (patch)
tree78a56d744352ac5419acbbc1be88e98287a2fe4d
parent83a7f0353554ab302920826c10a8b34b0ca4b595 (diff)
downloadpoky-8b48566f53760decc18490cd775c2193e65dbdcc.tar.gz
package_manager/ipk: give out useful reason about an unmatched package
Give out useful information when a package could not be matched. Before the change: error: opkg_solver_install: No candidates to install catch2 (null)! With this patch: error: opkg_solver_install: No candidates to install catch2 (null)! ... catch2 is a recipe. Its generated packages are: ['catch2-src', 'catch2-dbg', 'catch2-staticdev', 'catch2-dev', 'catch2-doc'] Either specify a generated package or set ALLOW_EMPTY:${PN} = "1" in catch2 recipe (From OE-Core rev: 4bcb97ab4d7622d04dbf71930ea1784c8d57c136) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oe/package_manager/ipk/__init__.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/meta/lib/oe/package_manager/ipk/__init__.py b/meta/lib/oe/package_manager/ipk/__init__.py
index 3d998e52ff..4794f31f88 100644
--- a/meta/lib/oe/package_manager/ipk/__init__.py
+++ b/meta/lib/oe/package_manager/ipk/__init__.py
@@ -307,9 +307,21 @@ class OpkgPM(OpkgDpkgPM):
307 if failed_pkgs: 307 if failed_pkgs:
308 failed_postinsts_abort(failed_pkgs, self.d.expand("${T}/log.do_${BB_CURRENTTASK}")) 308 failed_postinsts_abort(failed_pkgs, self.d.expand("${T}/log.do_${BB_CURRENTTASK}"))
309 except subprocess.CalledProcessError as e: 309 except subprocess.CalledProcessError as e:
310 e_output = e.output.decode("utf-8")
311 extra_info = ""
312 unmatched_pkgs = []
313 for e_line in e_output.split('\n'):
314 if "error: opkg_solver_install: No candidates to install" in e_line:
315 unmatched_pkg = re.search(r"error: opkg_solver_install: No candidates to install ([a-z0-9+\-\._]+)", e_line).group(1)
316 unmatched_pkgs.append(unmatched_pkg)
317 elif "error: opkg_prepare_url_for_install: Couldn't find anything to satisfy" in e_line:
318 unmatched_pkg = re.search(r"error: opkg_prepare_url_for_install: Couldn't find anything to satisfy '([a-z0-9+\-\._]+)'", e_line).group(1)
319 unmatched_pkgs.append(unmatched_pkg)
320 for pkg in unmatched_pkgs:
321 extra_info += self.get_missing_pkg_reason(pkg)
310 (bb.fatal, bb.warn)[attempt_only]("Unable to install packages. " 322 (bb.fatal, bb.warn)[attempt_only]("Unable to install packages. "
311 "Command '%s' returned %d:\n%s" % 323 "Command '%s' returned %d:\n%s%s" %
312 (cmd, e.returncode, e.output.decode("utf-8"))) 324 (cmd, e.returncode, e_output, extra_info))
313 325
314 def remove(self, pkgs, with_dependencies=True): 326 def remove(self, pkgs, with_dependencies=True):
315 if not pkgs: 327 if not pkgs: