diff options
| -rw-r--r-- | meta/classes/base.bbclass | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index 5f83af1fa3..b7eb62c01a 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass | |||
| @@ -681,9 +681,20 @@ def oe_unpack_file(file, data, url = None): | |||
| 681 | if os.path.samefile(file, dest): | 681 | if os.path.samefile(file, dest): |
| 682 | return True | 682 | return True |
| 683 | 683 | ||
| 684 | # Change to subdir before executing command | ||
| 685 | save_cwd = os.getcwd(); | ||
| 686 | parm = bb.decodeurl(url)[5] | ||
| 687 | if 'subdir' in parm: | ||
| 688 | newdir = ("%s/%s" % (os.getcwd(), parm['subdir'])) | ||
| 689 | bb.mkdirhier(newdir) | ||
| 690 | os.chdir(newdir) | ||
| 691 | |||
| 684 | cmd = "PATH=\"%s\" %s" % (bb.data.getVar('PATH', data, 1), cmd) | 692 | cmd = "PATH=\"%s\" %s" % (bb.data.getVar('PATH', data, 1), cmd) |
| 685 | bb.note("Unpacking %s to %s/" % (file, os.getcwd())) | 693 | bb.note("Unpacking %s to %s/" % (file, os.getcwd())) |
| 686 | ret = os.system(cmd) | 694 | ret = os.system(cmd) |
| 695 | |||
| 696 | os.chdir(save_cwd) | ||
| 697 | |||
| 687 | return ret == 0 | 698 | return ret == 0 |
| 688 | 699 | ||
| 689 | addtask unpack after do_fetch | 700 | addtask unpack after do_fetch |
