Skip to contentSkip to conversation

Robert Yang : insane.bbclass: make package_qa_clean_path return a relative path

oe-commits Martin Jansa 1 participant 1 message Sep 24, 2015 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 26 lines · On Wed, Sep 23, 2015 at 09:12:59PM +0000, [email protected] wrote:
Module: openembedded-core.git
Branch: master-next
Commit: 67a1e4b087a39db04370685616d5b439b0f2b505
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=67a1e4b087a39db04370685616d5b439b0f2b505
Author: Robert Yang <[email protected]>
Date:   Tue Sep 15 19:28:48 2015 -0700

insane.bbclass: make package_qa_clean_path return a relative path

Make package_qa_clean_path() return something like "work/path/to/file" rather than "/work/path/to/file", the relative path is a little clear.

---

 meta/classes/insane.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/insane.bbclass +0 -0
index 72120f5..05e31a7 100644

meta/classes/insane.bbclass def package_qa_get_machine_dict(): · line 170

Quoted 5 lines
meta/classes/insane.bbclass +1 -1
@@ -167,7 +167,7 @@ def package_qa_get_machine_dict():
 
 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),"")
+    return path.replace(d.getVar("TMPDIR", True) + "/", "")

Isn't path[len(d.getVar("TMPDIR", True))+1:] a bit faster and safer in cases where the TMPDIR path is included multiple times?

Or is this function meant to be used also for path which doesn't start with TMPDIR? Then I agree it should stay replace, but maybe with maxreplace parameter set to 1.

Same problem with "absolute" path is other QA check I was recently changing (and I've kept leading / after seeing it somewhere else :)).

Regards,

Quoted 9 lines
meta/classes/insane.bbclass +0 -0
 def package_qa_write_error(type, error, d):
     logfile = d.getVar('QA_LOGFILE', True)
 
Signature · 4 lines
_______________________________________________
Openembedded-commits mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-commits
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]