Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 06/10] infra/pkg-generic: introduce foo-show-info
Date: Thu, 11 Apr 2019 22:49:50 +0200	[thread overview]
Message-ID: <20190411204949.GE2539@scaer> (raw)
In-Reply-To: <CAAXf6LU-j7zMLUc93J1rchu5BytrZL22L=vkTOwDgwMdCA-rqA@mail.gmail.com>

Thpmas DS. All,

On 2019-04-10 11:16 +0200, Thomas De Schampheleire spake thusly:
> El dom., 7 abr. 2019 a las 13:51, Yann E. MORIN
> (<yann.morin.1998@free.fr>) escribi?:
[--SNIP--]
> > Introduce a new rule, foo-show-info, that provides a properly formatted
> > output of all the meta-information about a package: name, type, version,
> > licenses, dependencies...
[--SNIP--]
> > +define $(2)_SHOW_INFO_VIRTUAL
> > +       "virtual": false,
> > +       "version": "$$($(2)_DL_VERSION)",
> > +       "licenses": "$$($(2)_LICENSE)",
> > +       "downloads": [
> > +       $$(foreach dl,$$($(2)_ALL_DOWNLOADS),
> > +               {
> > +                       "source": "$$(notdir $$(dl))",
> > +                       "URIs": [
> > +                       $$(call make-comma-list,
> > +                               $$(subst \|,|,
> > +                                       $$(call DOWNLOAD_URIS,$$(dl),$(2))
> > +                               )
> > +                       )
> > +                       ]
> > +               },
> > +       )
> > +       null
> > +       ],
> 
> So the 'null' serves as last element in the array and is only needed
> because JSON cannot handle the trailing comma, right?

Ah, right, I forgot to explain that part in the commit log, because it
does deserve some explanations, indeed. And yes, that's because JSON
does not allow for a trailing comma.

Comming up with a Makefile-based construct that did not require this
trick is not obvious, so I did resort on this null trick to generate a
valifd JSON output. If we require that jq is present, then we could
pipe that to jq to filter it out. But I'm not to keen on that...

> > +endef
> > +endif
> > +
> > +define $(2)_SHOW_INFO
> > +       "name": "$(1)",
> > +       "type": "$(4)",
> > +       $$($(2)_SHOW_INFO_VIRTUAL)
> > +       "depends on": [
> > +               $$(call make-comma-list,$$($(2)_FINAL_ALL_DEPENDENCIES))
> > +       ],
> > +       "dependency of": [
> > +               $$(call make-comma-list,$$($(2)_RDEPENDENCIES))
> > +       ]
> 
> It feels odd to me to not use single-word keys here. Why not use
> 'depends/rdepends', 'dependencies'/'rdependencies' or if you want
> dependencies/reverse_dependencies ? The naming 'rdepends' is already
> exposed to users 'make show-rdepends' so it makes sense to me to use
> the same naming.

OK for "dependendencies" vs. "reverse_dependencies".

Thanks! :-)

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

  reply	other threads:[~2019-04-11 20:49 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-07 11:51 [Buildroot] [PATCH 00/10] infra: add solution to dump metadata from packages (branch yem/misc) Yann E. MORIN
2019-04-07 11:51 ` [Buildroot] [PATCH 01/10] infra/pkg-download: return just a list of URIs Yann E. MORIN
2019-04-07 12:20   ` Thomas Petazzoni
2019-04-07 12:42     ` Yann E. MORIN
2019-04-07 11:51 ` [Buildroot] [PATCH 02/10] infra/pkg-download: make the URI list a callable macro Yann E. MORIN
2019-04-10  8:33   ` Thomas De Schampheleire
2019-04-07 11:51 ` [Buildroot] [PATCH 03/10] infra/pkg-download: get rid of the FLOCK variable Yann E. MORIN
2019-04-07 11:51 ` [Buildroot] [PATCH 04/10] infra/pkg-download: make the DOWNLOAD macro fully parameterised Yann E. MORIN
2019-04-07 12:46   ` Yann E. MORIN
2019-04-07 11:51 ` [Buildroot] [PATCH 05/10] infra/utils: add helper to generate comma-separated lists Yann E. MORIN
2019-04-10  9:03   ` Thomas De Schampheleire
2019-04-07 11:51 ` [Buildroot] [PATCH 06/10] infra/pkg-generic: introduce foo-show-info Yann E. MORIN
2019-04-10  9:16   ` Thomas De Schampheleire
2019-04-11 20:49     ` Yann E. MORIN [this message]
2019-04-11 17:33   ` Thomas Petazzoni
2019-04-13  8:58   ` Arnout Vandecappelle
2019-04-13 17:17     ` Yann E. MORIN
2019-04-13 19:07       ` Arnout Vandecappelle
2019-04-07 11:51 ` [Buildroot] [PATCH 07/10] infra/pkg-generic: introduce foo-show-recursive-info Yann E. MORIN
2019-04-10  9:20   ` Thomas De Schampheleire
2019-04-07 11:51 ` [Buildroot] [PATCH 08/10] infra/fs: introduce rootfs-foo-show-info Yann E. MORIN
2019-04-10  9:19   ` Thomas De Schampheleire
2019-04-07 11:51 ` [Buildroot] [PATCH 09/10] infar/fs: introduce rootfs-foo-show-recursive-info Yann E. MORIN
2019-04-10  9:19   ` Thomas De Schampheleire
2019-04-07 11:51 ` [Buildroot] [PATCH 10/10] infra: introduce top-level, global show-info Yann E. MORIN
2019-04-10  9:28   ` Thomas De Schampheleire
2019-04-11 21:06     ` Yann E. MORIN
2019-04-13  9:08   ` Arnout Vandecappelle
2019-04-10 12:47 ` [Buildroot] [PATCH 00/10] infra: add solution to dump metadata from packages (branch yem/misc) Thomas De Schampheleire
2019-04-11 17:26 ` Thomas Petazzoni
2019-04-11 21:20   ` Yann E. MORIN
2019-04-13  8:00     ` Arnout Vandecappelle
2019-04-13 17:19       ` 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=20190411204949.GE2539@scaer \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox