]> code.ossystems Code Review - openembedded-core.git/commitdiff
insane: improve package_qa_clean_path
authorRoss Burton <ross.burton@intel.com>
Thu, 18 Aug 2016 16:33:31 +0000 (17:33 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 23 Aug 2016 16:44:17 +0000 (17:44 +0100)
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>
meta/classes/insane.bbclass

index 2cb8cc0abfbb53ccfb86b60b86c62bac525b6b85..67729445a941a1e71436360750f8a8a3cb2988f9 100644 (file)
@@ -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)