From patchwork Wed Dec 6 10:32:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 10095377 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3001F60210 for ; Wed, 6 Dec 2017 10:33:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1E9282859E for ; Wed, 6 Dec 2017 10:33:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1345D297B7; Wed, 6 Dec 2017 10:33:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C9152859E for ; Wed, 6 Dec 2017 10:33:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754940AbdLFKdc (ORCPT ); Wed, 6 Dec 2017 05:33:32 -0500 Received: from conuserg-07.nifty.com ([210.131.2.74]:48266 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754867AbdLFKdb (ORCPT ); Wed, 6 Dec 2017 05:33:31 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id vB6AX4KB025983; Wed, 6 Dec 2017 19:33:04 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com vB6AX4KB025983 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1512556384; bh=lK1dl/EwoL9aUtr8wnwc1JC9oBAB2OClWpGzCFGYA4U=; h=From:To:Cc:Subject:Date:From; b=JDocqYYWzUImF3z0WB4GqkcK19lDWosvO5rBPccq7ImxIRjQpTYNiglgIlfuKcfTR DerrTTtEnu/6jvz6wbOvpMTfrvtdjun0vFVz/Byf4xQeBSJnx96fAj0w5CmT1AwtJu IrS1JLXLiiZEVkMtD1YcxLyVCz5GbyGxZ1obt8QYVFqxjqPsqJIrvSOKmMnjhEN79i +5RVpA4xKsYF/nl9Eht4bkw3Q2xdXaZMrP+XbTYnFSLOwf1ObDPQb8If0wlgxI89G6 4/F+4OwMPOj2I2tNJiHxPSjSVW135jAqJmAP3X3rZ7F3EsTfZRZ/mfi7OfTl9rG34Y ByjfzJqq4REzg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH] kbuild: pkg: make out-of-tree rpm/deb-pkg build immediately fail Date: Wed, 6 Dec 2017 19:32:57 +0900 Message-Id: <1512556378-13310-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We do not support out-of-tree building of rpm-pkg / deb-pkg. If O= is given, the build should be terminated, but the "false" command is not effective because it is not the last command in the cmd_src_tar. Then, rpm-pkg / deb-pkg tries to continue building, and fails for a different reason. Set -e option so that the "false" terminates the building immediately. I also put the error messages to stderr, and made it stand out more. For example, "make O=foo rpm-pkg" will fail as follows: /bin/bash ../scripts/package/mkspec >./kernel.spec TAR kernel-4.15.0_rc2+.tar.gz ERROR: Building source tarball is not possible outside the kernel source tree. Don't set KBUILD_OUTPUT, or use the binrpm-pkg or bindeb-pkg target instead. ../scripts/package/Makefile:53: recipe for target 'rpm-pkg' failed Signed-off-by: Masahiro Yamada Tested-by: Jim Davis --- scripts/package/Makefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/package/Makefile b/scripts/package/Makefile index 61e29da..9fbcf5e 100644 --- a/scripts/package/Makefile +++ b/scripts/package/Makefile @@ -32,10 +32,14 @@ MKSPEC := $(srctree)/scripts/package/mkspec quiet_cmd_src_tar = TAR $(2).tar.gz cmd_src_tar = \ +set -e; \ if test "$(objtree)" != "$(srctree)"; then \ - echo "Building source tarball is not possible outside the"; \ - echo "kernel source tree. Don't set KBUILD_OUTPUT, or use the"; \ - echo "binrpm-pkg or bindeb-pkg target instead."; \ + echo >&2; \ + echo >&2 " ERROR:"; \ + echo >&2 " Building source tarball is not possible outside the"; \ + echo >&2 " kernel source tree. Don't set KBUILD_OUTPUT, or use the"; \ + echo >&2 " binrpm-pkg or bindeb-pkg target instead."; \ + echo >&2; \ false; \ fi ; \ $(srctree)/scripts/setlocalversion --save-scmversion; \