From 55061a43926baf6ff0e17aed02efd299ebba3c24 Mon Sep 17 00:00:00 2001 From: Ross Burton Date: Thu, 18 Aug 2016 17:33:31 +0100 Subject: insane: improve package_qa_clean_path Instead of just removing TMPDIR from the path for display, optionally allow a package to be passed and remove PKGDEST/package too. This means that messages that specify a package name can pass that name and the resulting path will be absolute inside that package. Signed-off-by: Ross Burton --- meta/classes/insane.bbclass | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'meta/classes/insane.bbclass') diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass index 2cb8cc0abf..67729445a9 100644 --- a/meta/classes/insane.bbclass +++ b/meta/classes/insane.bbclass @@ -179,9 +179,14 @@ def package_qa_get_machine_dict(d): return machdata -def package_qa_clean_path(path,d): - """ Remove the common prefix from the path. In this case it is the TMPDIR""" - return path.replace(d.getVar("TMPDIR", True) + "/", "") +def package_qa_clean_path(path, d, pkg=None): + """ + Remove redundant paths from the path for display. If pkg isn't set then + TMPDIR is stripped, otherwise PKGDEST/pkg is stripped. + """ + if pkg: + path = path.replace(os.path.join(d.getVar("PKGDEST", True), pkg), "/") + return path.replace(d.getVar("TMPDIR", True), "/").replace("//", "/") def package_qa_write_error(type, error, d): logfile = d.getVar('QA_LOGFILE', True) -- cgit 1.2.3-korg