All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bitbake/cooker: Ensure matchFile returns full pathnames
@ 2012-05-24 10:01 Richard Purdie
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Purdie @ 2012-05-24 10:01 UTC (permalink / raw)
  To: bitbake-devel

We should always be passing full pathnames around within bitbake. If
a file was referenced as a relative path to the current working
directory, it might not get passed through the abspath call and
hence the cwd would not get added as a prefix.

This change attempts to put everything through abspath and ignores
failures. Any failure cases would mean the file simply wouldn't exist
and then would get covered by the catchall code below.

[YOCTO #1465]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 8ad4922..e036efb 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -985,9 +985,10 @@ class BBCooker:
         """
         Find the .bb files which match the expression in 'buildfile'.
         """
-
-        if bf.startswith("/") or bf.startswith("../"):
+        try:
             bf = os.path.abspath(bf)
+        except:
+            pass
         filelist, masked = self.collect_bbfiles()
         try:
             os.stat(bf)





^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] bitbake/cooker: Ensure matchFile returns full pathnames
@ 2012-05-24 10:02 Richard Purdie
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Purdie @ 2012-05-24 10:02 UTC (permalink / raw)
  To: bitbake-devel

We should always be passing full pathnames around within bitbake. If
a file was referenced as a relative path to the current working
directory, it might not get passed through the abspath call and
hence the cwd would not get added as a prefix.

This change attempts to put everything through abspath and ignores
failures. Any failure cases would mean the file simply wouldn't exist
and then would get covered by the catchall code below.

[YOCTO #1465]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 8ad4922..e036efb 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -985,9 +985,10 @@ class BBCooker:
         """
         Find the .bb files which match the expression in 'buildfile'.
         """
-
-        if bf.startswith("/") or bf.startswith("../"):
+        try:
             bf = os.path.abspath(bf)
+        except:
+            pass
         filelist, masked = self.collect_bbfiles()
         try:
             os.stat(bf)





^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-05-24 10:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-24 10:01 [PATCH] bitbake/cooker: Ensure matchFile returns full pathnames Richard Purdie
  -- strict thread matches above, loose matches on Subject: below --
2012-05-24 10:02 Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.