[oe-commits] [openembedded-core] 14/32: package_tar: avoid chdir warnings and restore cwd after packaging

git at git.openembedded.org git at git.openembedded.org
Sat Oct 15 09:05:59 UTC 2016


rpurdie pushed a commit to branch master
in repository openembedded-core.

commit 3753d07c9ff33b9a97aca61ad312b0e283c4c68d
Author: Robert Yang <liezhi.yang at windriver.com>
AuthorDate: Wed Oct 12 02:19:05 2016 -0700

    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 at windriver.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 meta/classes/package_tar.bbclass | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/meta/classes/package_tar.bbclass b/meta/classes/package_tar.bbclass
index 854e645..e217814 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 () {

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list