aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2016-10-12 02:19:05 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-10-15 09:53:09 +0100
commit3753d07c9ff33b9a97aca61ad312b0e283c4c68d (patch)
treef348d4b303605ab9bfa5835d1880da3b717f657c
parent98f521fff9bbeb1f7f40a009620884ec664992d7 (diff)
downloadopenembedded-core-contrib-3753d07c9ff33b9a97aca61ad312b0e283c4c68d.tar.gz
openembedded-core-contrib-3753d07c9ff33b9a97aca61ad312b0e283c4c68d.tar.bz2
openembedded-core-contrib-3753d07c9ff33b9a97aca61ad312b0e283c4c68d.zip
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 Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
-rw-r--r--meta/classes/package_tar.bbclass5
1 files changed, 5 insertions, 0 deletions
diff --git a/meta/classes/package_tar.bbclass b/meta/classes/package_tar.bbclass
index 854e6452865..e217814af49 100644
--- a/meta/classes/package_tar.bbclass
+++ b/meta/classes/package_tar.bbclass
@@ -4,6 +4,9 @@ IMAGE_PKGTYPE ?= "tar"
python do_package_tar () {
import subprocess
+
+ oldcwd = os.getcwd()
+
workdir = d.getVar('WORKDIR', True)
if not workdir:
bb.error("WORKDIR not defined, unable to package")
@@ -49,6 +52,8 @@ python do_package_tar () {
ret = subprocess.call(args + [tarfn] + dlist)
if ret != 0:
bb.error("Creation of tar %s failed." % tarfn)
+
+ os.chdir(oldcwd)
}
python () {