diff options
author | Ross Burton <ross.burton@intel.com> | 2016-08-18 17:33:31 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-08-23 17:44:17 +0100 |
commit | 55061a43926baf6ff0e17aed02efd299ebba3c24 (patch) | |
tree | ff0c546724d40561837148c0e70dcadf54237f05 /meta/classes/insane.bbclass | |
parent | 17e7eb96e5446821ad81977ac9ccac26b05e67a7 (diff) | |
download | openembedded-core-55061a43926baf6ff0e17aed02efd299ebba3c24.tar.gz openembedded-core-55061a43926baf6ff0e17aed02efd299ebba3c24.tar.bz2 openembedded-core-55061a43926baf6ff0e17aed02efd299ebba3c24.zip |
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 <ross.burton@intel.com>
Diffstat (limited to 'meta/classes/insane.bbclass')
-rw-r--r-- | meta/classes/insane.bbclass | 11 |
1 files changed, 8 insertions, 3 deletions
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) |