From patchwork Thu Feb 27 12:39:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Santos X-Patchwork-Id: 1245817 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=FVp8Hkh/; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48Ssh14dwPz9sSW for ; Thu, 27 Feb 2020 23:40:01 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id D26CF8789E; Thu, 27 Feb 2020 12:39:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IX7rLvW54LFG; Thu, 27 Feb 2020 12:39:57 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 06CBA8785D; Thu, 27 Feb 2020 12:39: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 637A91BF378 for ; Thu, 27 Feb 2020 12:39:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 60611850D6 for ; Thu, 27 Feb 2020 12:39:53 +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 lmfhUUV_0log for ; Thu, 27 Feb 2020 12:39:52 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qv1-f66.google.com (mail-qv1-f66.google.com [209.85.219.66]) by fraxinus.osuosl.org (Postfix) with ESMTPS id BBCD484FFF for ; Thu, 27 Feb 2020 12:39:52 +0000 (UTC) Received: by mail-qv1-f66.google.com with SMTP id g16so1439984qvz.5 for ; Thu, 27 Feb 2020 04:39:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=o9iRHAyYorXHP4Meupd1p0oS0tIP1wfsooWo/0Odt1s=; b=FVp8Hkh/PDineKLT2qPL2W001vHJbwUbhrx1HFiity8060UWRGyb17g1tL3x4OzYy9 zvwO2cnk0KRC5lzivPeqJNyRRIBukHDTt8v0L7QfMbvFQUmHEK6NV/rRUYvPV0FgAtQG POufyWREH4RcKWia+MgaCzmhXg83D/877S//6Gl9w0VH60KWqF/9duta79W8B1CprZFq +Aqc76K6kJMHIb9/UDsbCH2WTl8nhYciF7plt4mioyYN6lMIchv22MvXIx5BSAdz43D7 TSNF4lbCGhT57SMbhoWyce+b3N7zCaEYdR5eZpzghhJn1DYn8AqosyqzOllsDNMFMyUq UbXQ== 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:in-reply-to :references; bh=o9iRHAyYorXHP4Meupd1p0oS0tIP1wfsooWo/0Odt1s=; b=g1RMLbUJ+Ex2lqBnoAhSAg5EsvlR9K0FRUe4DBZnCVtqYxA6D3ILu8zVPPzuQ6bW6w CBpOVxCwiM/fyuGLSHGSlniGTADAUleGiMPT4dL0CwCnbbUL/Z70Iddb3Srl3Bf9dWq1 YYCZ4OJyjCD5q8zT29UizvHmCRFxSL3cdsFjmJmD0vtwzLq0YMO4EJDYDtyNdu/5rEmp vxKZaq0JZjYhJUzLsfRQk4M8qK4aRnthOCwp4lt+8AG/5H3xbLapTUFLQ+uBb8LhkLLI KqAo2CRujZZdJcah+xyP3cNGtVcQv5TvcqAI0Xgi+eFZ4bAtoNclQln0S3QAHYR4nY/O UnHA== X-Gm-Message-State: APjAAAWfLk0GRYKu3P1b/VO4oCnXfmKh3adOqMeuPKpGg5tMOjEms2sj Envk4ZoE7wIazlo/KP50TJ679jXJ X-Google-Smtp-Source: APXvYqw3Gg4DfKHx65+ApbfNy0nbMwKhycxA+N1tecsH4QS14+R0jPj/cfE6/1eDyjDubrvlzZSbFg== X-Received: by 2002:a05:6214:1634:: with SMTP id e20mr4774151qvw.205.1582807191493; Thu, 27 Feb 2020 04:39:51 -0800 (PST) Received: from casantos.com (179.178.22.126.dynamic.adsl.gvt.net.br. [179.178.22.126]) by smtp.gmail.com with ESMTPSA id y190sm2960285qkb.130.2020.02.27.04.39.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Feb 2020 04:39:51 -0800 (PST) From: unixmania@gmail.com To: buildroot@buildroot.org Date: Thu, 27 Feb 2020 09:39:36 -0300 Message-Id: <20200227123938.13412-3-unixmania@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200227123938.13412-1-unixmania@gmail.com> References: <20200227123938.13412-1-unixmania@gmail.com> Subject: [Buildroot] [PATCH 2/4] package/pkg-utils.mk: add KCONFIG_GET_OPT macro X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Carlos Santos , Adam Duskett , =?utf-8?b?TWljaGHFgiDFgXlzemN6ZWs=?= MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Carlos Santos Given a config name and a file, returns the config value if it is set; otherwise returns an empty string. Signed-off-by: Carlos Santos --- package/pkg-utils.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk index d324934dba..c8d74520e9 100644 --- a/package/pkg-utils.mk +++ b/package/pkg-utils.mk @@ -16,6 +16,10 @@ define KCONFIG_ENABLE_OPT # (option, file) echo '$(1)=y' >> $(2) endef +define KCONFIG_GET_OPT # (option, file) +$(shell $(SED_QUIET) '/^\<$(1)\>=/h;$${x;s/$(1)=//p;}' $(2)) +endef + define KCONFIG_SET_OPT # (option, value, file) $(SED) "/\\<$(1)\\>/d" $(3) echo '$(1)=$(2)' >> $(3)