]> code.ossystems Code Review - openembedded-core.git/commitdiff
package_deb: Avoid chdir warnings and restore cwd after packaging
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 16 Jun 2016 15:36:27 +0000 (16:36 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 16 Jun 2016 21:43:53 +0000 (22:43 +0100)
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@linuxfoundation.org>
meta/classes/package_deb.bbclass

index e35f427ea2d85a5dd407d182539da55ba10f20cd..8f9b09a7805202665718180fb8051d89790ab8a0 100644 (file)
@@ -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"