[oe-commits] [openembedded-core] 02/03: package_deb: Avoid chdir warnings and restore cwd after packaging

git at git.openembedded.org git at git.openembedded.org
Thu Jun 16 21:46:36 UTC 2016


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

commit c294f4ed5a02b055916cfc26a2fca672edee1208
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Thu Jun 16 16:36:27 2016 +0100

    package_deb: Avoid chdir warnings and restore cwd after packaging
    
    dpkg-build needs to be executed in the root of the package, so save and restore
    the current directory so this task doesn't modify the state.
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/classes/package_deb.bbclass | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass
index e35f427..8f9b09a 100644
--- a/meta/classes/package_deb.bbclass
+++ b/meta/classes/package_deb.bbclass
@@ -53,6 +53,8 @@ python do_package_deb () {
     import textwrap
     import subprocess
 
+    oldcwd = os.getcwd()
+
     workdir = d.getVar('WORKDIR', True)
     if not workdir:
         bb.error("WORKDIR not defined, unable to package")
@@ -311,6 +313,7 @@ python do_package_deb () {
 
         cleanupcontrol(root)
         bb.utils.unlockfile(lf)
+    os.chdir(oldcwd)
 }
 # Indirect references to these vars
 do_package_write_deb[vardeps] += "PKGV PKGR PKGV DESCRIPTION SECTION PRIORITY MAINTAINER DPKG_ARCH PN HOMEPAGE"

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


More information about the Openembedded-commits mailing list