All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 05/12 v2] infra/utils: add helper to generate comma-separated lists
Date: Sun, 14 Apr 2019 22:17:16 +0200	[thread overview]
Message-ID: <c1da3d005d552147d497686e45ae5e95423e1f81.1555273025.git.yann.morin.1998@free.fr> (raw)
In-Reply-To: <cover.1555273025.git.yann.morin.1998@free.fr>

Add a helper macro that, from a space-separated list of items, returns a
comma-separated list of the quoted items.

This will be useful when we need to generate lists in JSON, later...

Code suggested by Thomas P.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Arnout Vandecappelle <arnout@mind.be>

---
Changes v1 -> v2:
  - don't rely on implicit space in replacement text, instead use
    explicit $(space)  (Thmas DS)
---
 support/misc/utils.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/support/misc/utils.mk b/support/misc/utils.mk
index c44319338e..b422c67d76 100644
--- a/support/misc/utils.mk
+++ b/support/misc/utils.mk
@@ -70,6 +70,10 @@ finddirclauses = $(call notfirstword,$(patsubst %,-o -path '$(1)/%',$(2)))
 # notfirstword(wordlist): returns all but the first word in wordlist
 notfirstword = $(wordlist 2,$(words $(1)),$(1))
 
+# build a comma-separated list of quoted items, from a space-separated
+# list of unquoted items:   a b c d  -->  "a", "b", "c", "d"
+make-comma-list = $(subst $(space),$(comma)$(space),$(patsubst %,"%",$(strip $(1))))
+
 # Needed for the foreach loops to loop over the list of hooks, so that
 # each hook call is properly separated by a newline.
 define sep
-- 
2.14.1

  parent reply	other threads:[~2019-04-14 20:17 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-14 20:17 [Buildroot] [PATCH 00/12 v2] infra: add solution to dump metadata from packages (branch yem/show-info-2) Yann E. MORIN
2019-04-14 20:17 ` [Buildroot] [PATCH 01/12 v2] infra/pkg-download: return just a list of URIs Yann E. MORIN
2019-04-14 20:17 ` [Buildroot] [PATCH 02/12 v2] infra/pkg-download: make the URI list a callable macro Yann E. MORIN
2019-04-14 20:17 ` [Buildroot] [PATCH 03/12 v2] infra/pkg-download: get rid of the FLOCK variable Yann E. MORIN
2019-04-14 20:17 ` [Buildroot] [PATCH 04/12 v2] infra/pkg-download: make the DOWNLOAD macro fully parameterised Yann E. MORIN
2019-04-15  9:08   ` Arnout Vandecappelle
2019-04-15 17:18     ` Yann E. MORIN
2019-04-14 20:17 ` Yann E. MORIN [this message]
2019-04-14 20:17 ` [Buildroot] [PATCH 06/12 v2] fs: introduce variables with name and type Yann E. MORIN
2019-04-14 20:17 ` [Buildroot] [PATCH 07/12 v2] fs: introduce variable with all recursive dependencies Yann E. MORIN
2019-04-14 20:17 ` [Buildroot] [PATCH 08/12 v2] fs: add all recursive dependencies to packages list Yann E. MORIN
2019-04-15  9:48   ` Arnout Vandecappelle
2019-04-14 20:17 ` [Buildroot] [PATCH 09/12 v2] core: introduce new global show-info Yann E. MORIN
2019-04-15 12:17   ` Arnout Vandecappelle
2019-04-15 12:23     ` Thomas Petazzoni
2019-04-15 17:34     ` Yann E. MORIN
2019-04-15 17:51       ` Arnout Vandecappelle
2019-04-15 18:51         ` Yann E. MORIN
2019-04-16  9:47     ` Peter Korsgaard
2019-04-16 19:49       ` Arnout Vandecappelle
2019-04-16 20:10         ` Peter Korsgaard
2019-04-14 20:17 ` [Buildroot] [PATCH 10/12 v2] core: add per-package and per-filesystem show-info Yann E. MORIN
2019-04-14 20:17 ` [Buildroot] [PATCH 11/12 v2] support/scripts: use show-info to extract dependency graph Yann E. MORIN
2019-04-14 20:17 ` [Buildroot] [PATCH 12/12 v2] core: remove show-depednency-tree Yann E. MORIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c1da3d005d552147d497686e45ae5e95423e1f81.1555273025.git.yann.morin.1998@free.fr \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.