From 3753d07c9ff33b9a97aca61ad312b0e283c4c68d Mon Sep 17 00:00:00 2001 From: Robert Yang Date: Wed, 12 Oct 2016 02:19:05 -0700 Subject: 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 Signed-off-by: Ross Burton --- meta/classes/package_tar.bbclass | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'meta/classes') 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" 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 () { -- cgit v1.2.3