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 1/2] boot/, linux/, package/: improve help text of kconfig packages
Date: Sun, 4 Jul 2021 10:05:55 +0200	[thread overview]
Message-ID: <20210704080555.GA2521@scaer> (raw)
In-Reply-To: <20210703194001.693553-1-thomas.petazzoni@bootlin.com>

Thomas, All,

On 2021-07-03 21:39 +0200, Thomas Petazzoni spake thusly:
> The <pkg>_HELP_CMDS variable allows packages using the kconfig-package
> infrastructure to display their specific targets related to the
> handling of their configuration.
> 
> However, it was not consistently used and handled by the different
> packages. This commit makes sure all packages using kconfig-package
> have that help text, and that is does reflect which targets are
> available/usable.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

I wonder wy we can't have that generated automatically by the
kconfig-package infra, rather than repeast it in all packages.

The only exception is busybox, which does not have support for defconfig
files, otherwise all packages behave similarly.

What about the following patch (lightly tested):

    diff --git a/package/pkg-kconfig.mk b/package/pkg-kconfig.mk
    index dd727b7200..18d11e845a 100644
    --- a/package/pkg-kconfig.mk
    +++ b/package/pkg-kconfig.mk
    @@ -82,6 +82,31 @@ define inner-kconfig-package
     # they are also accounted for in the generated graphs.
     $(2)_DEPENDENCIES += $$($(2)_KCONFIG_DEPENDENCIES)
     
    +$(2)_KCONFIG_SUPPORTS_DEFCONFIG ?= YES
    +
    +# Generate the kconfig-related help: one entry for each editor.
    +# Additionally, if the package is *not* using an in-tree defconfig
    +# name, an entry for updating the package configuration file.
    +ifndef $(2)_HELP_CMDS
    +define $(2)_HELP_CMDS
    +	$$(foreach editor, $$($(2)_KCONFIG_EDITORS), \
    +		@printf '  %-22s - Run %s %s\n' $(1)-$$(editor) $(1) $$(editor)
    +	)
    +	$$(if $$($(2)_KCONFIG_DEFCONFIG),,\
    +		$$(if $$(filter YES,$$($(2)_KCONFIG_SUPPORTS_DEFCONFIG)),\
    +			@printf '  %-22s - Save the %s configuration as a defconfig file\n' \
    +				$(1)-update-defconfig $(1)
    +			@printf '  %-22s     to %s\n' '' $$($(2)_KCONFIG_FILE)
    +			@printf '  %-22s     (or override with %s_KCONFIG_FILE)\n' '' $(2)
    +		)
    +		@printf '  %-22s - Save the %s configuration as a full .config file\n' \
    +			$(1)-update-config $(1)
    +		@printf '  %-22s     to %s\n' '' $$($(2)_KCONFIG_FILE)
    +		@printf '  %-22s     (or override with %s_KCONFIG_FILE)\n' '' $(2)
    +)
    +endef
    +endif
    +
     # Call the generic package infrastructure to generate the necessary
     # make targets.
     # Note: this must be done _before_ attempting to use $$($(2)_DIR) in a

Note: I am not 100% sure we want the coditional definition, but it is
more in-line with the other _CMDS that packages can define.

Then we can simply drop all the per-package _HELP_CMDS.

$(2)_KCONFIG_SUPPORTS_DEFCONFIG is there just for busybox, which AFAICS
is the only package without support for defconfig files. We could
alternatively drop this new variable and let busybox define its own
_HELP_CMDS; that would slightly simplify the code above.

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.  |
'------------------------------^-------^------------------^--------------------'

  parent reply	other threads:[~2021-07-04  8:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-03 19:39 [Buildroot] [PATCH 1/2] boot/, linux/, package/: improve help text of kconfig packages Thomas Petazzoni
2021-07-03 19:40 ` [Buildroot] [PATCH 2/2] Makefile: document the <pkg>-reinstall target Thomas Petazzoni
2021-07-04  8:08   ` Yann E. MORIN
2021-07-04  8:05 ` Yann E. MORIN [this message]
2021-07-24 21:21   ` [Buildroot] [PATCH 1/2] boot/, linux/, package/: improve help text of kconfig packages 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=20210704080555.GA2521@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 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.