From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dan.rpsys.net (5751f4a1.skybroadband.com [87.81.244.161]) by mail.openembedded.org (Postfix) with ESMTP id 9902C72A78 for ; Tue, 28 Apr 2015 16:10:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by dan.rpsys.net (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id t3SGAAWt030429 for ; Tue, 28 Apr 2015 17:10:10 +0100 Received: from dan.rpsys.net ([127.0.0.1]) by localhost (dan.rpsys.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id zty9Hq60RiPG for ; Tue, 28 Apr 2015 17:10:10 +0100 (BST) Received: from [192.168.3.10] ([192.168.3.10]) (authenticated bits=0) by dan.rpsys.net (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id t3SG9wFu030417 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 28 Apr 2015 17:10:10 +0100 Message-ID: <1430237398.13022.237.camel@linuxfoundation.org> From: Richard Purdie To: openembedded-core Date: Tue, 28 Apr 2015 17:09:58 +0100 X-Mailer: Evolution 3.12.10-0ubuntu1~14.10.1 Mime-Version: 1.0 Subject: [PATCH] lib/oe/package: Improve strip subprocess handling X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Apr 2015 16:10:13 -0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Currently if the strip process fails, we get a message but don't know why. This adds code to show the return value and any error output. Signed-off-by: Richard Purdie diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py index ea6feaa..f176446 100644 --- a/meta/lib/oe/package.py +++ b/meta/lib/oe/package.py @@ -33,14 +33,14 @@ def runstrip(arg): stripcmd = "'%s' %s '%s'" % (strip, extraflags, file) bb.debug(1, "runstrip: %s" % stripcmd) - ret = subprocess.call(stripcmd, shell=True) + try: + output = subprocess.check_output(stripcmd, stderr=subprocess.STDOUT, shell=True) + except subprocess.CalledProcessError as e: + bb.error("runstrip: '%s' strip command failed with %s (%s)" % (stripcmd, e.returncode, e.output)) if newmode: os.chmod(file, origmode) - if ret: - bb.error("runstrip: '%s' strip command failed" % stripcmd) - return