From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 11/12 v3] support/scripts: use show-info to extract dependency graph
Date: Mon, 22 Apr 2019 08:53:44 +0200 [thread overview]
Message-ID: <20190422065344.GA6200@scaer> (raw)
In-Reply-To: <5cbd07729d823_6f5c2ad964f8616052718@ultri5.mail>
Ricardo, All,
[Typoes fixed, thanks.]
On 2019-04-21 21:14 -0300, Ricardo Martincoski spake thusly:
> On Mon, Apr 15, 2019 at 04:47 PM, Yann E. MORIN wrote:
> > Since show-dependency-graph never went into a release so far, and
> > show-info does provide the same (and more), swith to using show-info.
[--SNIP--]
> When I do this before and after this patch:
> $ make qemu_arm_versatile_defconfig
> $ make graph-depends
> The color for "rootfs-common" and "rootfs-ext2" changes.
> Can you reproduce it?
Yes.
> Is this intended?
More or less, yes.
> If not intended, do we care enough?
IMHO, not really.
However, I still have further improvements to do about the graphs, and
one of them was to add a new 'colour' to rootfs items.
>
> [snip]
> > + versions[pkg] = \
> > + None if pkg_list[pkg]["type"] == "rootfs" \
> > + else "virtual" if pkg_list[pkg]["virtual"] \
> > + else pkg_list[pkg]["version"]
>
> Why not the straightforward version?
> if pkg_list[pkg]["type"] == "rootfs":
> versions[pkg] = None
> elif pkg_list[pkg]["virtual"]:
> versions[pkg] = "virtual"
> else:
> versions[pkg] = pkg_list[pkg]["version"]
Because this is not pythonic!
Seriously, yes, the main reason is to write python scripts in the most
pythonic way I can, for two reasons:
1- I try to use the idioms and best practices of the language I write
in, so that those that come later and are pofficient in the language
can maintain it without having to cleanup before;
2- I learn python along the way...
So yes, this looks very more pythonic than the if-else-blocs which look
much more like C or shell...
And it takes 6 lines instead of 4! ;-)
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. |
'------------------------------^-------^------------------^--------------------'
next prev parent reply other threads:[~2019-04-22 6:53 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-15 19:47 [Buildroot] [PATCH 00/12 v3] infra: add solution to dump metadata from packages (branch yem/show-info-2) Yann E. MORIN
2019-04-15 19:47 ` [Buildroot] [PATCH 01/12 v3] infra/pkg-download: return just a list of URIs Yann E. MORIN
2019-04-15 19:47 ` [Buildroot] [PATCH 02/12 v3] infra/pkg-download: make the URI list a callable macro Yann E. MORIN
2019-04-15 19:47 ` [Buildroot] [PATCH 03/12 v3] infra/pkg-download: get rid of the FLOCK variable Yann E. MORIN
2019-04-15 19:47 ` [Buildroot] [PATCH 04/12 v3] infra/pkg-download: make the DOWNLOAD macro fully parameterised Yann E. MORIN
2019-04-15 19:47 ` [Buildroot] [PATCH 05/12 v3] infra/utils: add helper to generate comma-separated lists Yann E. MORIN
2019-04-15 19:47 ` [Buildroot] [PATCH 06/12 v3] fs: introduce variables with name and type Yann E. MORIN
2019-04-15 19:47 ` [Buildroot] [PATCH 07/12 v3] fs: introduce variable with all recursive dependencies Yann E. MORIN
2019-04-15 19:47 ` [Buildroot] [PATCH 08/12 v3] fs: add all recursive dependencies to packages list Yann E. MORIN
2019-04-15 19:47 ` [Buildroot] [PATCH 09/12 v3] core: introduce new global show-info Yann E. MORIN
2019-04-15 19:47 ` [Buildroot] [PATCH 10/12 v3] core: add per-package and per-filesystem show-info Yann E. MORIN
2019-04-15 19:47 ` [Buildroot] [PATCH 11/12 v3] support/scripts: use show-info to extract dependency graph Yann E. MORIN
2019-04-15 20:08 ` Yann E. MORIN
2019-04-22 0:14 ` Ricardo Martincoski
2019-04-22 6:53 ` Yann E. MORIN [this message]
2019-04-15 19:47 ` [Buildroot] [PATCH 12/12 v3] core: remove show-depednency-tree Yann E. MORIN
2019-04-15 21:51 ` [Buildroot] [PATCH 00/12 v3] infra: add solution to dump metadata from packages (branch yem/show-info-2) Arnout Vandecappelle
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=20190422065344.GA6200@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