From patchwork Fri Dec 1 15:09:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 843532 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="iKh24G4H"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ypHkc14rkz9t9n for ; Sat, 2 Dec 2017 02:09:59 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 36DC788846; Fri, 1 Dec 2017 15:09:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9fq4bIRlP37P; Fri, 1 Dec 2017 15:09:56 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 1762685AA1; Fri, 1 Dec 2017 15:09:56 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 8AA9F1C1F4F for ; Fri, 1 Dec 2017 15:09:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 849098A27C for ; Fri, 1 Dec 2017 15:09:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xRicjSfRinRn for ; Fri, 1 Dec 2017 15:09:54 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by hemlock.osuosl.org (Postfix) with ESMTPS id B0FF18A28E for ; Fri, 1 Dec 2017 15:09:53 +0000 (UTC) Received: by mail-wm0-f66.google.com with SMTP id r78so4080730wme.5 for ; Fri, 01 Dec 2017 07:09:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=YWMrKbwaBwsSH4mGoFs817eUMCAhkU4i7uuD1GBSECw=; b=iKh24G4HzItQg0T79dTgRBD8IagYhZGZnbiTj3j2vD0If+a21xg/6mWci9VMepKta3 0v2hW9tqUWDwczhYlL/+LFQlo/XVTmd4Io8CIHL0fXoK7b+Udm92iqigSa4tdOHDk6wW PuKpbW7/cqkG/ewqufaJydYTE7qukYvLDAUcl6XjRIwu97iCw4IFe0jPBDJI2RJdYKS6 rfTkKsCJpowvJ7nAzcXOQ8nCPLdSbiWI2dO1A96h4JJ77lgU3LjPVcAS7zodKAp2lBQk CN7dj9SO92jkUFD+/aE5+qewREfD1ivtpxha/rcFTj5/y3vAx0Faws0djr33x7dT4WIy VU6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=YWMrKbwaBwsSH4mGoFs817eUMCAhkU4i7uuD1GBSECw=; b=MVV39os8Zyl5/lAOAv1Uu1qK9h35qAwCO+iRhuogcih9Yvwr4SvTWaCsbB1+sCxIZv D87nZ7vSJTtfKnf9Tv5c/2Xtqy86JwwC7rV3VUXD88GY8AgbIrcDJs2c8PpnWfDemTsT ZUxVuS9vvC6gp6qZT9GEtMjU2a0OjxATeKnkdpnrWyuYIBauO3w3qVcRELwqYXDeeEkV JvBFIMEgvIEfbJQNHf0x90tfMKXTbnfqIp4tj3ks95AddODY7VMZYLvrNEm5Ir+FOPtb wBoO8CLb9XcOpqtNnLqUI5R/PNeNK+Ty3BwNh+G31YX6/b7qAAQKwgEhoczsTGp+iqZb GFNA== X-Gm-Message-State: AKGB3mKutt91cRu3tc9tiSZ+kxB9C9m8i5f671Zz6oL66mGrGk0viUm6 nKNX826qi6iZhw7st8VfnTRUbg== X-Google-Smtp-Source: AGs4zMYPATvyfqmpTV8mLlqMMtRl4RVWE5JrgGrlNHzH/8RMXF9j+o+GgpHmYEe08s6rHANmpyZc3w== X-Received: by 10.28.4.146 with SMTP id 140mr1369607wme.38.1512140991965; Fri, 01 Dec 2017 07:09:51 -0800 (PST) Received: from localhost.localdomain (2a01cb088610730085e44630f7218506.ipv6.abo.wanadoo.fr. [2a01:cb08:8610:7300:85e4:4630:f721:8506]) by smtp.gmail.com with ESMTPSA id i3sm4326025wre.33.2017.12.01.07.09.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Dec 2017 07:09:50 -0800 (PST) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Fri, 1 Dec 2017 16:09:44 +0100 Message-Id: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: Subject: [Buildroot] [PATCH 1/3] infra/pkg-kconfig: comonalise update-(def)config code X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Yann E. MORIN" MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Except for the nice human-friendly reminder of the command that the user was just running, and the name of the file to copu from, those two rules are exactly the same. Make that a common macro that is shared, so that it's easier to add more checks, and to simplify maintenance. Signed-off-by: "Yann E. MORIN" --- package/pkg-kconfig.mk | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/package/pkg-kconfig.mk b/package/pkg-kconfig.mk index 0402f81ffe..4bd7161b1a 100644 --- a/package/pkg-kconfig.mk +++ b/package/pkg-kconfig.mk @@ -11,6 +11,17 @@ # ################################################################################ +# Macro to update back the custom (def)config file +# $(1): file to copy from +define kconfig-package-update-config + @$(if $($(PKG)_KCONFIG_FRAGMENT_FILES), \ + echo "Unable to perform $(@) when fragment files are set"; exit 1) + @$(if $($(PKG)_KCONFIG_DEFCONFIG), \ + echo "Unable to perform $(@) when using a defconfig rule"; exit 1) + cp -f $($(PKG)_DIR)/$(1) $($(PKG)_KCONFIG_FILE) + touch --reference $($(PKG)_DIR)/$($(PKG)_KCONFIG_DOTCONFIG) $($(PKG)_KCONFIG_FILE) +endef + ################################################################################ # inner-kconfig-package -- generates the make targets needed to support a # kconfig package @@ -204,25 +215,17 @@ $(1)-savedefconfig: $(1)-check-configuration-done # Target to copy back the configuration to the source configuration file # Even though we could use 'cp --preserve-timestamps' here, the separate # cp and 'touch --reference' is used for symmetry with $(1)-update-defconfig. +$(1)-update-config: PKG=$(2) $(1)-update-config: $(1)-check-configuration-done - @$$(if $$($(2)_KCONFIG_FRAGMENT_FILES), \ - echo "Unable to perform $(1)-update-config when fragment files are set"; exit 1) - @$$(if $$($(2)_KCONFIG_DEFCONFIG), \ - echo "Unable to perform $(1)-update-config when using a defconfig rule"; exit 1) - cp -f $$($(2)_DIR)/$$($(2)_KCONFIG_DOTCONFIG) $$($(2)_KCONFIG_FILE) - touch --reference $$($(2)_DIR)/$$($(2)_KCONFIG_DOTCONFIG) $$($(2)_KCONFIG_FILE) + $$(call kconfig-package-update-config,$$($(2)_KCONFIG_DOTCONFIG)) # Note: make sure the timestamp of the stored configuration is not newer than # the .config to avoid a useless rebuild. Note that, contrary to # $(1)-update-config, the reference for 'touch' is _not_ the file from which # we copy. +$(1)-update-defconfig: PKG=$(2) $(1)-update-defconfig: $(1)-savedefconfig - @$$(if $$($(2)_KCONFIG_FRAGMENT_FILES), \ - echo "Unable to perform $(1)-update-defconfig when fragment files are set"; exit 1) - @$$(if $$($(2)_KCONFIG_DEFCONFIG), \ - echo "Unable to perform $(1)-update-defconfig when using a defconfig rule"; exit 1) - cp -f $$($(2)_DIR)/defconfig $$($(2)_KCONFIG_FILE) - touch --reference $$($(2)_DIR)/$$($(2)_KCONFIG_DOTCONFIG) $$($(2)_KCONFIG_FILE) + $$(call kconfig-package-update-config,defconfig) endif # package enabled From patchwork Fri Dec 1 15:09:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 843533 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="P4PP+A3d"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ypHkd1s0Kz9tBC for ; Sat, 2 Dec 2017 02:10:01 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 434D58A2C2; Fri, 1 Dec 2017 15:09:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AkFqG0YXJkuX; Fri, 1 Dec 2017 15:09:57 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 06AAF8A28E; Fri, 1 Dec 2017 15:09:57 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id EABA81C1F4F for ; Fri, 1 Dec 2017 15:09:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id E769A85AA1 for ; Fri, 1 Dec 2017 15:09:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9Lguq_eDKtYg for ; Fri, 1 Dec 2017 15:09:55 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 1A321858D5 for ; Fri, 1 Dec 2017 15:09:55 +0000 (UTC) Received: by mail-wm0-f66.google.com with SMTP id f140so3916323wmd.2 for ; Fri, 01 Dec 2017 07:09:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=QKOvUbldFpqg83l3u89phGi10ZwwlgRXb5zF1Vjwm4E=; b=P4PP+A3dkJ/HoWDV1CGW7ouOv9XwL6IGTYls8/+Oy6u0f0YjO4o+6AuoYz4u/4DEkm J/mRmo9WAo4ggNnHDT2riKguINo5K7LYH7cmjgERPnVhfkFz6I5zH/RSMNUSZoavXoLu BVK/3j/iqkp92vEl+WLb6lPAZzkPJ4g6ZLO2eBpzwwdBdphi45UvzOCVAQ6EpZW1XQ1F XFBeL1czwvnirTl0N7+6xxBO1GRs5FF5OEuUk2cdlPJx3p+ff/loovGrv/TqyW8diNzC Yf6BPT5kwdCvWHGHr0RBpBmwN9wiWvrwGq6E3E/NqV2UdPVGpiHRX/qj/auwKMsDapAe v7Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=QKOvUbldFpqg83l3u89phGi10ZwwlgRXb5zF1Vjwm4E=; b=WYfX8yNlTnMvvqJA7XnjRbkCmskNbjNN6G/cUiLj0qt7PVmnZ8IkkCVddzTioZCrGH 7/tcitsn+djR/PYcqgUAu9EdEhX0PTjYoUcXOCv4qLFjVr8BpuPX+6/cc/J7oXdmhd43 wyJPkQH11SYSJ4g5y0MbT4O5/SBP01iOs+US7F5ECntB809DgxpVDtw8xXUXZ98+S45S 4lp7QVOqevvCCBdKPDKGMe3uLM+SEFDx0GIj3yxgTRWuPzMJQzzcXzDcO+lDJwQny62M OqyRe7mQxY420nWQjWJO2EZtGIHZXEP1bNn4Rsn7wPmcKGnqIXbdOc10YyIbBGJDhmzb 71XQ== X-Gm-Message-State: AJaThX4sshS3PaBtwq1o/BgLCxx3pU2sRzzBj7p1sQI/PBcf+p7kX7hn ON6TS9y5hWmauXGw1fzIiiDP+A== X-Google-Smtp-Source: AGs4zMZxz7qWacdXLmoF5S/dSJyjkaH9rjm5GEVNvCgZpl3wdeSIxcT0+D1B3O8k4OdNF0zFV7Ozww== X-Received: by 10.28.238.135 with SMTP id j7mr1614895wmi.140.1512140993340; Fri, 01 Dec 2017 07:09:53 -0800 (PST) Received: from localhost.localdomain (2a01cb088610730085e44630f7218506.ipv6.abo.wanadoo.fr. [2a01:cb08:8610:7300:85e4:4630:f721:8506]) by smtp.gmail.com with ESMTPSA id i3sm4326025wre.33.2017.12.01.07.09.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Dec 2017 07:09:52 -0800 (PST) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Fri, 1 Dec 2017 16:09:45 +0100 Message-Id: <6149b8e2bbae760ff8079e82f497aaa1964bfef1.1512140974.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: Subject: [Buildroot] [PATCH 2/3] infra/pkg-config: hide away non-critical commands X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Yann E. MORIN" MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" When updating back the (def)config file, the touch command is not very useful by default, so hide it away. We do not hide away the cp command, as that could confuse the user under some circunmstances. For example, when the toolchain does not yet exist, the uClibc buildsystem will complain multiple times about gcc not being found, like so: make[2]: /home/ymorin/dev/buildroot/O/host/bin/i686-buildroot-linux-uclibc-gcc: Command not found (Note that we can not suppress those warnings, as they are on stderr, and we still want to see stderr in case of real errors). So, if we were to hide the cp command, the user could be left confused, even though we were sucessful in updating back the (def)config file. Signed-off-by: "Yann E. MORIN" --- package/pkg-kconfig.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/pkg-kconfig.mk b/package/pkg-kconfig.mk index 4bd7161b1a..0da6d0ab4e 100644 --- a/package/pkg-kconfig.mk +++ b/package/pkg-kconfig.mk @@ -19,7 +19,7 @@ define kconfig-package-update-config @$(if $($(PKG)_KCONFIG_DEFCONFIG), \ echo "Unable to perform $(@) when using a defconfig rule"; exit 1) cp -f $($(PKG)_DIR)/$(1) $($(PKG)_KCONFIG_FILE) - touch --reference $($(PKG)_DIR)/$($(PKG)_KCONFIG_DOTCONFIG) $($(PKG)_KCONFIG_FILE) + $(Q)touch --reference $($(PKG)_DIR)/$($(PKG)_KCONFIG_DOTCONFIG) $($(PKG)_KCONFIG_FILE) endef ################################################################################ From patchwork Fri Dec 1 15:09:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 843534 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="nCVTFo2j"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ypHkk648Yz9t9n for ; Sat, 2 Dec 2017 02:10:06 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id F2AE98789E; Fri, 1 Dec 2017 15:10:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QLAs3j9CdC1d; Fri, 1 Dec 2017 15:10:00 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id D9442888AD; Fri, 1 Dec 2017 15:09:59 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 984471C1F4F for ; Fri, 1 Dec 2017 15:09:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 9212E2FE77 for ; Fri, 1 Dec 2017 15:09:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CUCaRFbXvdbQ for ; Fri, 1 Dec 2017 15:09:56 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by silver.osuosl.org (Postfix) with ESMTPS id 7D4F72FE76 for ; Fri, 1 Dec 2017 15:09:56 +0000 (UTC) Received: by mail-wr0-f195.google.com with SMTP id a41so8562618wra.6 for ; Fri, 01 Dec 2017 07:09:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=b4nc0LR9Oj/DqwnSNp5nAu1MRoD9L06v5UGnAfGolxY=; b=nCVTFo2jsBJyz8bie2vr96dW7kAm8QQEyspTO0ffY6I+JvviEAMb7oeXdAGuOVf4gq 21Tt/tfPWJYk1HR8Zo98k+fMI4Y9wvqmXyuKVrLZvOKGPRBhNJcBkB1Wpf/o2eVAeXYy s3zMuhdXNXfuQj0B+wE5AFzydepVc0pNEtYrMlrIVMmG+atLT+iwXxeo8wpxEbvKr1zD V408uNlyaiXoSbtnxrCODwbPjoq8V7TiMmSrXLqF2BAOZiFNCF2bDmQQjK+He5m6vxy7 Ok84PaGrgpPDKj6dXQIaxtbBpND+Wg84O5KOdAVVMOIn/nagshW762sV73l2PB4mIBHL hp9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=b4nc0LR9Oj/DqwnSNp5nAu1MRoD9L06v5UGnAfGolxY=; b=ARKxV59xAweOuEOhEuvUCKk2t/hi4BovF3fEOgor8mVkH/s4Yd94dLD7JFcmy8yySV plM9QxQRR4DmomsjeWVDHhE6xoOyVXgghcL5g8NFWG/ji5Hm5qhqlo4ql/MBsne/7crk fmLl3u8OQAa/tqyysHUFRJ/uvhyZFekXfLum0SeTJfmtq2JUPQ1I5AHf9uPZBi8x+MfS hXMWds9NOq1yGSgpjHMfC76Bzur1GCOM+bn4CsqfF052FWDGZoBxtYUSkIIpN8e8eced pRg4eEZ1cYEitLOx4bvyd4yy0KT0h6XdcE4hUPU8sMXoOu6uY/Av+m4ZuUyaEbareBWY kbTQ== X-Gm-Message-State: AJaThX7EBP/st407WZi1MVsPjxr5KHrcKBPsnBFqt7ET5JTGC4TbEtC0 F/+cKf3gIGeSY7jbGkpyjysmjQ== X-Google-Smtp-Source: AGs4zMaPdjxUR94PtbrSHQMOfo3G5OKw8veRjapSPZW/Xsab1BAP+Y7j2oHdPT/ZKX5do7a9f+ehWw== X-Received: by 10.223.182.19 with SMTP id f19mr5279747wre.81.1512140994814; Fri, 01 Dec 2017 07:09:54 -0800 (PST) Received: from localhost.localdomain (2a01cb088610730085e44630f7218506.ipv6.abo.wanadoo.fr. [2a01:cb08:8610:7300:85e4:4630:f721:8506]) by smtp.gmail.com with ESMTPSA id i3sm4326025wre.33.2017.12.01.07.09.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Dec 2017 07:09:53 -0800 (PST) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Fri, 1 Dec 2017 16:09:46 +0100 Message-Id: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: Subject: [Buildroot] [PATCH 3/3] infra/pkg-kconfig: do not update-(def)config to a directory X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Yann E. MORIN" MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Currently, if the user specifies the path to an existing directory as the path to the custom (def)config file (FOO_KCONFIG_FILE), then we happily create a file in there, either 'defconfig' or '.config' (or whatever the .config is named for that package), depending on whether we're saving a defconfig or a full config. So, we could save the file, but then the Buildroot defconfig file that contains that path would no longer be reusable as-is, because we interpret that path as a path to a file. Furthermore, if the directory-portion of FOO_KCONFIG_FILE does not exist yet, the update would fail, because cp does not create missing directory components. So we fix that by adding an explicit test for the directory-ness of the target file, and then an explicit mkdir to create missing directory components. Signed-off-by: "Yann E. MORIN" --- package/pkg-kconfig.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/package/pkg-kconfig.mk b/package/pkg-kconfig.mk index 0da6d0ab4e..81bba5220c 100644 --- a/package/pkg-kconfig.mk +++ b/package/pkg-kconfig.mk @@ -18,6 +18,11 @@ define kconfig-package-update-config echo "Unable to perform $(@) when fragment files are set"; exit 1) @$(if $($(PKG)_KCONFIG_DEFCONFIG), \ echo "Unable to perform $(@) when using a defconfig rule"; exit 1) + $(Q)if [ -d $($(PKG)_KCONFIG_FILE) ]; then \ + echo "Unable to perform $(@) when $($(PKG)_KCONFIG_FILE) is a directory"; \ + exit 1; \ + fi + $(Q)mkdir -p $(dir $($(PKG)_KCONFIG_FILE)) cp -f $($(PKG)_DIR)/$(1) $($(PKG)_KCONFIG_FILE) $(Q)touch --reference $($(PKG)_DIR)/$($(PKG)_KCONFIG_DOTCONFIG) $($(PKG)_KCONFIG_FILE) endef