Openembedded Bitbake Development
 help / color / mirror / Atom feed
* [PATCH] bitbake/utils.py: Ensure utils.which() returns full paths
@ 2012-05-24 12:57 Richard Purdie
  0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2012-05-24 12:57 UTC (permalink / raw)
  To: bitbake-devel

If the path passed to which contains empty elements, it will search
the current working directory for the file which is correct baheviour.

Various pieces of code assume the path returned is a full path though.
This commit ensures we don't return relative paths.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index 7a73419..fc389a3 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -721,6 +721,8 @@ def which(path, item, direction = 0):
     for p in paths:
         next = os.path.join(p, item)
         if os.path.exists(next):
+            if not os.path.isabs(next):
+                next = os.path.abspath(next)
             return next
 
     return ""





^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-05-24 13:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-24 12:57 [PATCH] bitbake/utils.py: Ensure utils.which() returns full paths Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox