diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2016-10-12 02:19:05 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-10-15 10:01:43 +0100 |
commit | 49d189e2415137d2091d72c3c7fd0dd45f53d908 (patch) | |
tree | 687c2260fc217b6ea248d0f781f6d009d3af8470 | |
parent | a6185017749b06a76d1f3d8ac748a9dc80f5cd17 (diff) | |
download | poky-49d189e2415137d2091d72c3c7fd0dd45f53d908.tar.gz |
package_tar: avoid chdir warnings and restore cwd after packaging
Fixed:
WARNING: attr-2.4.47-r0 do_package_write_tar: Task do_package_tar changed cwd to /path/to/attr/2.4.47-r0/packages-split/attr-locale-sv
(From OE-Core rev: 3753d07c9ff33b9a97aca61ad312b0e283c4c68d)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/package_tar.bbclass | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/meta/classes/package_tar.bbclass b/meta/classes/package_tar.bbclass index 854e645286..e217814af4 100644 --- a/meta/classes/package_tar.bbclass +++ b/meta/classes/package_tar.bbclass | |||
@@ -4,6 +4,9 @@ IMAGE_PKGTYPE ?= "tar" | |||
4 | 4 | ||
5 | python do_package_tar () { | 5 | python do_package_tar () { |
6 | import subprocess | 6 | import subprocess |
7 | |||
8 | oldcwd = os.getcwd() | ||
9 | |||
7 | workdir = d.getVar('WORKDIR', True) | 10 | workdir = d.getVar('WORKDIR', True) |
8 | if not workdir: | 11 | if not workdir: |
9 | bb.error("WORKDIR not defined, unable to package") | 12 | bb.error("WORKDIR not defined, unable to package") |
@@ -49,6 +52,8 @@ python do_package_tar () { | |||
49 | ret = subprocess.call(args + [tarfn] + dlist) | 52 | ret = subprocess.call(args + [tarfn] + dlist) |
50 | if ret != 0: | 53 | if ret != 0: |
51 | bb.error("Creation of tar %s failed." % tarfn) | 54 | bb.error("Creation of tar %s failed." % tarfn) |
55 | |||
56 | os.chdir(oldcwd) | ||
52 | } | 57 | } |
53 | 58 | ||
54 | python () { | 59 | python () { |