From patchwork Wed Aug 16 11:08:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 9903449 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 EAD0560231 for ; Wed, 16 Aug 2017 11:09:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DE4E5289B5 for ; Wed, 16 Aug 2017 11:09:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D36F1289B8; Wed, 16 Aug 2017 11:09:01 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 2CF2C289B5 for ; Wed, 16 Aug 2017 11:09:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751969AbdHPLJA (ORCPT ); Wed, 16 Aug 2017 07:09:00 -0400 Received: from mail-lf0-f52.google.com ([209.85.215.52]:35105 "EHLO mail-lf0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752026AbdHPLI7 (ORCPT ); Wed, 16 Aug 2017 07:08:59 -0400 Received: by mail-lf0-f52.google.com with SMTP id t128so14958929lff.2 for ; Wed, 16 Aug 2017 04:08:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=+G3isCsYjtjJyy5ma1mbe64HPXE+KqfNguekpoZqzqc=; b=Ygui8mqostC7ockol86FaXdggVtBhqWYrB6yJ/d5YU9y7UEi/Zi6xCMNA5WsQFkeGV 1OgHgVeEz/54+k3ndj3JDJwFNzFfTEW2HSqIAU5za6icVQnPgcOfw+3fxHwgMJt02gUv X6KxR5ywJEfKQxPDrgHVptUeQc2JPleiEyadE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=+G3isCsYjtjJyy5ma1mbe64HPXE+KqfNguekpoZqzqc=; b=uBcRlz4dpOOkFS9i590Ri1HlFi3gclgq7DHh/gDLm4d9ivNHoWdp6LjUCyiApz9FaQ x4KhQKHR2X8l4o+nJ07Ko9qsZAI7pmGyHeVVg0GkWMIxr7cVEzwteJRzBEh8U2GgaD/T t/NMh/d9N+KugDeoKPHqzLEEW67hULyA+yk9nPM0ClX1PNSh1PLQ5PfOWcuve+1yKXsm 95H60bZa+mEQtVDapOkddLlRXvKVvXNZRceptqhUFTTN6iVZbjVxXvc7HG4c24rdUhQm SFewmBQHbmaVSZkBf26XsjW1bhKloMfxE6WQl7j2gsJHV4qkUBGv6X74csNIFLKlmHQe 3SnQ== X-Gm-Message-State: AHYfb5jlOiA5ozQS22yG0UvFJZjwUoAOIl2xrtiqFeTPBOvo9S/NORtZ R/ow4dY+zkeaSm2vubh03g== X-Received: by 10.25.181.150 with SMTP id g22mr534692lfk.128.1502881738231; Wed, 16 Aug 2017 04:08:58 -0700 (PDT) Received: from berserk.kos.to (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id s7sm172725lfg.25.2017.08.16.04.08.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Aug 2017 04:08:56 -0700 (PDT) From: riku.voipio@linaro.org To: linux-kbuild@vger.kernel.org, mmarek@suse.com Cc: yamada.masahiro@socionext.com, debian-kernel@lists.debian.org, Riku Voipio Subject: [PATCH 1/2] scripts/package/Makefile: make revision update a function Date: Wed, 16 Aug 2017 14:08:54 +0300 Message-Id: <20170816110855.6021-1-riku.voipio@linaro.org> X-Mailer: git-send-email 2.11.0 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 From: Riku Voipio The updated deb-pkg and bindeb-pkg will use the same snippet, so make it reusable. Signed-off-by: Riku Voipio --- scripts/package/Makefile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/package/Makefile b/scripts/package/Makefile index 71b4a8af9d4d..9867638896ad 100644 --- a/scripts/package/Makefile +++ b/scripts/package/Makefile @@ -44,14 +44,18 @@ tar -cz $(RCS_TAR_IGNORE) -f $(2).tar.gz \ $(addprefix $(2)/,$(TAR_CONTENT) $(3)); \ rm -f $(2) $(objtree)/.scmversion +quiet_cmd_updateversion = UPDATEVERSION + cmd_updateversion = \ + $(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version; \ + mv -f $(objtree)/.tmp_version $(objtree)/.version + # rpm-pkg # --------------------------------------------------------------------------- rpm-pkg rpm: FORCE $(MAKE) clean $(CONFIG_SHELL) $(MKSPEC) >$(objtree)/kernel.spec $(call cmd,src_tar,$(KERNELPATH),kernel.spec) - $(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version - mv -f $(objtree)/.tmp_version $(objtree)/.version + $(call cmd,updateversion) rpmbuild $(RPMOPTS) --target $(UTS_MACHINE) -ta $(KERNELPATH).tar.gz rm $(KERNELPATH).tar.gz kernel.spec @@ -60,9 +64,7 @@ rpm-pkg rpm: FORCE binrpm-pkg: FORCE $(MAKE) KBUILD_SRC= $(CONFIG_SHELL) $(MKSPEC) prebuilt > $(objtree)/binkernel.spec - $(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version - mv -f $(objtree)/.tmp_version $(objtree)/.version - + $(call cmd,updateversion) rpmbuild $(RPMOPTS) --define "_builddir $(objtree)" --target \ $(UTS_MACHINE) -bb $(objtree)/binkernel.spec rm binkernel.spec