summaryrefslogtreecommitdiff
path: root/classes/base.bbclass
diff options
context:
space:
mode:
authorRobert Schuster <rschus@entw2.(none)>2009-01-15 17:55:32 +0100
committerRobert Schuster <rschus@entw2.(none)>2009-01-15 18:04:29 +0100
commitb2526465141545d94f155a4d0573568f0febb204 (patch)
tree953b901fcb435c1cebc6d8c8207b450a78e36c0d /classes/base.bbclass
parent783e00aa0697cb2b75c2f5f32c626ce98199e5cd (diff)
base.bbclass: Add subdir feature to SRC_URI entries.
Diffstat (limited to 'classes/base.bbclass')
-rw-r--r--classes/base.bbclass11
1 files changed, 11 insertions, 0 deletions
diff --git a/classes/base.bbclass b/classes/base.bbclass
index b2b60850b3..fca0edd2fc 100644
--- a/classes/base.bbclass
+++ b/classes/base.bbclass
@@ -725,9 +725,20 @@ def oe_unpack_file(file, data, url = None):
if os.path.samefile(file, dest):
return True
+ # Change to subdir before executing command
+ save_cwd = os.getcwd();
+ parm = bb.decodeurl(url)[5]
+ if 'subdir' in parm:
+ newdir = ("%s/%s" % (os.getcwd(), parm['subdir']))
+ bb.mkdirhier(newdir)
+ os.chdir(newdir)
+
cmd = "PATH=\"%s\" %s" % (bb.data.getVar('PATH', data, 1), cmd)
bb.note("Unpacking %s to %s/" % (file, os.getcwd()))
ret = os.system(cmd)
+
+ os.chdir(save_cwd)
+
return ret == 0
addtask unpack after do_fetch