From: Richard Purdie Date: Thu, 16 Jun 2016 15:36:27 +0000 (+0100) Subject: package_deb: Avoid chdir warnings and restore cwd after packaging X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~25303 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c294f4ed5a02b055916cfc26a2fca672edee1208;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git 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 --- diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass index e35f427ea2d..8f9b09a7805 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"