[oe-commits] [openembedded-core] 09/32: insane: improve package_qa_clean_path

git at git.openembedded.org git at git.openembedded.org
Tue Aug 23 09:12:24 UTC 2016


rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 711da7f37fb2cc04d1657eda0657cdb4105d8738
Author: Ross Burton <ross.burton at intel.com>
AuthorDate: Thu Aug 18 17:33:31 2016 +0100

    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 at intel.com>
---
 meta/classes/insane.bbclass | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index 2cb8cc0..6772944 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)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list