[oe-commits] Chris Larson : base.bbclass: fix bug with absolute file:// uris

git version control git at git.openembedded.org
Tue Aug 31 16:47:36 UTC 2010


Module: openembedded.git
Branch: org.openembedded.dev
Commit: dd478c59e5ec36bc5f43ed9721323ad8171b5ef4
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=dd478c59e5ec36bc5f43ed9721323ad8171b5ef4

Author: Chris Larson <chris_larson at mentor.com>
Date:   Mon Aug 30 16:43:31 2010 -0700

base.bbclass: fix bug with absolute file:// uris

The code which used host/path from the url to construct the destination of the
copy was using os.path.join.  os.path.join treats a "/" in an element as an
indication to drop all previous elements, so the full path resulted in a
destination exactly the same as the source, resulting in a no-op unpack.
Fixed by using oe.path.join instead.

The previous fix missed two instances of os.path.join -- there's code
duplication in oe_unpack_file, really need to resurrect my do_unpack cleanup
branch.

Signed-off-by: Chris Larson <chris_larson at mentor.com>

---

 classes/base.bbclass |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/classes/base.bbclass b/classes/base.bbclass
index afc30da..438327c 100644
--- a/classes/base.bbclass
+++ b/classes/base.bbclass
@@ -226,14 +226,14 @@ def oe_unpack_file(file, data, url = None):
 					dest = host + os.path.dirname(path) or "."
 			else:
 				dest = "."
-			bb.mkdirhier("%s" % os.path.join(os.getcwd(),dest))
-			cmd = 'cp %s %s' % (file, os.path.join(os.getcwd(), dest))
+			bb.mkdirhier("%s" % oe.path.join(os.getcwd(),dest))
+			cmd = 'cp %s %s' % (file, oe.path.join(os.getcwd(), dest))
 	if not cmd:
 		return True
 	if not host:
-		dest = os.path.join(os.getcwd(), path)
+		dest = oe.path.join(os.getcwd(), path)
 	else:
-		dest = os.path.join(os.getcwd(), os.path.join(host, path))
+		dest = oe.path.join(os.getcwd(), oe.path.join(host, path))
 	if os.path.exists(dest):
 		if os.path.samefile(file, dest):
 			return True





More information about the Openembedded-commits mailing list