From patchwork Tue Aug 6 11:02:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadym Kochan X-Patchwork-Id: 1142718 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@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; 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.b="C/v9HgtK"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 462sCx6ST8z9s7T for ; Tue, 6 Aug 2019 21:02:21 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id B229887D11; Tue, 6 Aug 2019 11:02:17 +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 psY+jG5zHdLE; Tue, 6 Aug 2019 11:02:16 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 25DA487C91; Tue, 6 Aug 2019 11:02:16 +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 9FB9C1BF263 for ; Tue, 6 Aug 2019 11:02:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 9CA6D85CA8 for ; Tue, 6 Aug 2019 11:02:14 +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 f8Re5_dAux_o for ; Tue, 6 Aug 2019 11:02:14 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-lf1-f66.google.com (mail-lf1-f66.google.com [209.85.167.66]) by fraxinus.osuosl.org (Postfix) with ESMTPS id BAE9C85C06 for ; Tue, 6 Aug 2019 11:02:13 +0000 (UTC) Received: by mail-lf1-f66.google.com with SMTP id p197so60689015lfa.2 for ; Tue, 06 Aug 2019 04:02:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=4GWo8F52qBUVMv2PEL2pRI672nufYRGJpkYfo6ByKrs=; b=C/v9HgtKYqISGnxWFDcHbS+D1lgzwndM4prUPFCC+bdfcgSV36cZ8i6ongz9cPQ4E6 fjIt/qZ0lrtHl5YkNfwkFRS2UxcF5HDcJm3X3w7gdDBXZZVG/2am19fjPkbKpkFgrxwy XIO+c0kf4iz2swzZdcbc/pJNLei6PyAjfdrtxFcvNgxPecS1faqcU9/bz0SLJJaE5JMV az+8V0w3nLeo6zRCg9JSNVeQ2ji07PFWOcCIjNi3PPMgakdVzB//uPhHDEc3kmok/JDv mGTb1vrywFSc3Vpq+fOifzRStq3Gu/73VQ4MMOctnwyFGMYS2xp/uxrvktcEmtCzNt/8 vZTQ== 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=4GWo8F52qBUVMv2PEL2pRI672nufYRGJpkYfo6ByKrs=; b=jlA6HAaF1WUka3f6UQTTlbheBS+ARBoBFVEmEXAiIOv3G+TxFHsVjg82mKqnQ+7g06 RjFaJSsY1fyX5xhGMfWsqGDSRTBJ1PaqdJ223UIqa80yOYHNKaxMljk6sH6ifubDHozs zz3rdqYLak86ZHlN9y75BIkZB50z/3x/Lgzfbal/H0dd7fvP9PvwnqUWtru5Me9XUD+U 3v9JbUM8psGsxT8y2RtiKzJCmWCb6/h3z/Zr9Luvg8mGAok+66EugI8X61xwyuqNx7pc 4Tp+NXfaOs0af+tPTXnAhDnLPy+sUP7O6Hj/dIg+M9uPnJu0tKkuGBehdY8mzC55ycek boYw== X-Gm-Message-State: APjAAAUNsqiseZ/3N0/22EJ5hAw9kKDCszgeqYcUlH+aXQDPmKypiTCS NMT1YZ7AhMCSeJMp8NbuWC8jckbIl3g= X-Google-Smtp-Source: APXvYqwB4/snXiBwZQFLmj4Evmn1oE+vamWVQRLRJ+/bUdvGj6khCGfvi2BxvjGun9kBydR/JgC3fQ== X-Received: by 2002:a19:e20c:: with SMTP id z12mr2093174lfg.120.1565089331477; Tue, 06 Aug 2019 04:02:11 -0700 (PDT) Received: from pc60716vkochan.x.ow.s ([217.20.186.93]) by smtp.gmail.com with ESMTPSA id s24sm17797805lje.58.2019.08.06.04.02.10 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 06 Aug 2019 04:02:11 -0700 (PDT) From: Vadim Kochan To: buildroot@buildroot.org Date: Tue, 6 Aug 2019 14:02:03 +0300 Message-Id: <20190806110203.24423-1-vadim4j@gmail.com> X-Mailer: git-send-email 2.17.1 Subject: [Buildroot] [PATCH v4 1/1] pkg-infra/show-info: dump install_{staging, target, images} info 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: Vadim Kochan , "Yann E . MORIN" MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" provide info if the package will be installed to staging/target/images destinations. Might be useful for analyzing the packages which installed for target/staging/images. Signed-off-by: Vadim Kochan --- v4: 1) use "install_{target,staging,images}" property name format (suggested by Arnout Vandecappelle) 2) add and use macro for YES/NO -> true/false conversion (suggested by Arnout Vandecappelle) 3) add "install_images" property (suggested by Yann E. Morin) v3: 1) fix evaluation of true/false value via 'subst' (suggested by Yann E. Morin) v2: 1) use oneliner 'if' to dump install_{staging,target} properties package/pkg-utils.mk | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk index b7280e930f..74ade437d9 100644 --- a/package/pkg-utils.mk +++ b/package/pkg-utils.mk @@ -62,6 +62,11 @@ $$(error Package error: use $(2) instead of $(1). Please fix your .mk file) endif endef +# $(1): YES or NO +define yesno-to-bool + $(subst NO,false,$(subst YES,true,$(1))) +endef + # json-info -- return package or filesystem metadata formatted as an entry # of a JSON dictionnary # $(1): upper-case package or filesystem name @@ -94,6 +99,9 @@ endef define _json-info-pkg-details "version": "$($(1)_DL_VERSION)", "licenses": "$($(1)_LICENSE)", + "install_target": $(call yesno-to-bool,$($(1)_INSTALL_TARGET)), + "install_staging": $(call yesno-to-bool,$($(1)_INSTALL_STAGING)), + "install_images": $(call yesno-to-bool,$($(1)_INSTALL_IMAGES)), "downloads": [ $(foreach dl,$(sort $($(1)_ALL_DOWNLOADS)), {