summaryrefslogtreecommitdiffstats
path: root/support/scripts/gen-manual-lists.py
Commit message (Collapse)AuthorAgeFilesLines
* manual: get rid of the lists of packagesYann E. MORIN2016-09-191-513/+0
| | | | | | | | | | | | | | | | | | | | | | | | | We currently have four lists of packages in the manual: - the non-virtual target packages, - the virtual target packages, - the host packages, - the deprecated features. Those list take more than half of the manual. They do not serve much purpose except to show off. After the recent discussion on the list [0], remove them all. We can now get rid of our biggish and complex generating script (and its companion library kconfiglib). [0] http://lists.busybox.net/pipermail/buildroot/2016-September/171199.html Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Peter Korsgaard <peter@korsgaard.com> Cc: Arnout Vandecappelle <arnout@mind.be> Cc: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* docs/manual: fix generation of deprecated listYann E. MORIN2015-08-021-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 5f117c3 (webkit: mark as deprecated), generation of the manual has been broken. This is because that commit added a deprecated dependency on a prompt-less symbol, BR2_PACKAGE_WEBKIT_ARCH_SUPPORTS. However, the generation script does not check that a symbol has a prompt before it attempts to add it to the deprecated list. So, we end up with traceback: Writing the virtual-packages list in: /home/ymorin/dev/buildroot/O/build/docs/manual/virtual-package-list.txt Traceback (most recent call last): File "/home/ymorin/dev/buildroot/buildroot/support/scripts/gen-manual-lists.py", line 510, in <module> buildroot.print_list(list_name, dry_run=args.dry_run, output=output) File "/home/ymorin/dev/buildroot/buildroot/support/scripts/gen-manual-lists.py", line 466, in print_list item_label=item_label) File "/home/ymorin/dev/buildroot/buildroot/support/scripts/gen-manual-lists.py", line 126, in format_asciidoc_table enable_choice=enable_choice)) File "/home/ymorin/dev/buildroot/buildroot/support/scripts/gen-manual-lists.py", line 350, in _format_symbol_prompt_location return "| {0:<40} <| {1}\n".format(get_label_func(symbol), File "/home/ymorin/dev/buildroot/buildroot/support/scripts/gen-manual-lists.py", line 458, in <lambda> get_label = lambda x: self._get_symbol_label(x, mark_depr) File "/home/ymorin/dev/buildroot/buildroot/support/scripts/gen-manual-lists.py", line 313, in _get_symbol_label label = symbol.get_prompts()[0] IndexError: list index out of range However, we can not use the existing _is_deprecated filter function to filter out symbols without prompts, because this function is also used to add a '(deprecated)' tag in the man package list (not that it would not work, but it does not seem /right/). Furthermore, it could also be used (but is currently not) to build the list of virtual packages, which do not have a prompt. So, introduce a filter function, aptly named _is_deprecated_feature(), to be used as the filter to find deprecated feature, and keep the existing _is_deprecated() that can be used in any context to decide whether a symbol is deprecated or not. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Samuel Martin <s.martin49@gmail.com> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Gustavo Zacarias <gustavo@zacarias.com.ar> Acked-by: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* support: remove outdated note re. Python 3 supportUlf Magnusson2015-06-121-5/+0
| | | | | | | Kconfiglib now runs as either Python 2 or Python 3. Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* support: get prompts via official Kconfiglib APIsUlf Magnusson2015-06-111-5/+5
| | | | | | | These weren't available when gen-manual-lists.py was first written. Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* support: gen-manual-lists.py base directory simplificationUlf Magnusson2015-06-111-4/+2
| | | | | | | Buildroot doesn't use $srctree from what I could tell. Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* Fix typos in comment blocksMasahiro Yamada2015-04-081-1/+1
| | | | | | | | | | | [Thomas: fix issues noticed by Arnout: - Rewrap the linux/Config.in paragraph - Revert the "is a toolchain dependency" -> "has a toolchain dependency" change from pkg-generic.mk, as the original was correct.] Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* support/gen-manual-lists.py: bail out early for legacy symbolsYann E. MORIN2014-07-191-2/+2
| | | | | | | | | | When searching for virtual package providers, there's no need to handle legacy symbols at all, so just bail out early. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Samuel Martin <s.martin49@gmail.com> Acked-by: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* support/gen-manual-lists.py: remove unneeded arg in private functionYann E. MORIN2014-07-191-3/+3
| | | | | | | | | No need to pass as argument to a function, members of the class it's in. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Samuel Martin <s.martin49@gmail.com> Acked-by: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* support/scripts: generate a list of virtual packagesYann E. MORIN2014-06-081-1/+83
| | | | | | | | | | | | | | | | | | | | | | | Generate an asciidoc table that can be included in the manual, that lists the existing virtual packages, the corresponding symbols, and their providers (and sub-options thereof). The core of this change is the addition of a new formatter for virtual packages. This formatter is a bit tricky, as it has to catter for a bunch of corner cases: - provider is not a package, but is sub-options of a package - such a sub-option may be itself 'select'-ed by one or more other sub-options - legacy packages should not be considered as a provider Those cases are real: - sub-options of mesa3d provide EGL or GLES - selected sub-options of mesa3d provide GL - udev is a legacy package, but it provides udev Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* support/scripts: introduce a symbol formatter to generate package listsYann E. MORIN2014-06-081-29/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, we can generate two different tables of packages: - a single-column table with the symbols' prompts, - a two-column table with the symbols' prompts and locations in the menuconfig. For virtual packages, this is not enough, since we will have to display more columns, with different content: - the virtual package name (but such symbols do not have a prompt) - the symbol name - the providers for the virtual package So, instead of having a single function that knows how to generate any table, introduce a formatter function that is passed as argument to, and called by format_asciidoc_table(). Such formatter functions are responsible for providing: - the layout of the table (number of columns, column arrangement), - the formatted header line, - a formatted line for a symbol. What the formatter should ouput depends on its arguments: - if none are passed, the layout is returned, - if the header label is passed, it returns the formatted header line, - otherwise, it returns the formatted line for a symbol. Two formatter functions are introduced in this changeset, to replace the current 'sub_menu' feature: - _format_symbol_prompt() to display a one-column table with only the symbols' prompts, - _format_symbol_prompt_location() to display a two-column table with the symbols' prompts and locations. This will help us to later introduce a new formatter to generate a table for virtual packages. [Thanks to Samuel for his pythonistic help!] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* support/scripts: who's responsible to decide what is a packageYann E. MORIN2014-06-081-4/+4
| | | | | | | | | | | | | | | | | | | | | When generating the package lists, the responsibility to decide what is actually a package symbol is currently split between the _is_package(), the get_symbol_subset() and the format_asciidoc_table() functions. The two latter functions check that an item is really a symbol, and that is has a prompt. While this is currently correct for real packages, this will no longer be the case when we also generate a list of virtual packages, since they do not have a prompt. Move the responsibility to verify that a symbol is indeed a package symbol to _is_package(), so it's all in one place, and makes it easier to change for virtual packages. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* support/scripts: do not display virtual packages in generated listsYann E. MORIN2014-06-081-2/+19
| | | | | | | | | | | | | | | | | If a package has both a 'real' and a 'virtual' definition, consider it is a virtual package and do not display it in the generated package list. This is the case for jpeg and cryptodev, that are virtual packages, but also real (but empty) packages used to provide a prompt to enable/disable a choice to select an implementation. In this case, we do not want to list the virtual packages, but only their implementations. So, consider packages that are both real and virtual as virtual packages. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Samuel Martin <s.martin49@gmail.com> Acked-by: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* support/scripts: prepare handling virtual packages in generated listsYann E. MORIN2014-06-081-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prepare to tell apart real packages from virtual packages. Currently, the code implicitly recognises only real packages, and discards virtual packages, because of the heuristic used to recognise whether a symbol is a package: - for real package: - symbols : BR2_PACKAGE_FOO - .mk files: foo.mk - for virtual packages: - symbols : BR2_PACKAGE_HAS_FOO - .mk files: foo.mk The current heuristic is to check for each symbol if a corresponding .mk file exists, by stripping 'BR2_PACKAGE_' from the beginning of the symbol, converting the result to lowercase, and checking if a .mk file exists. So, as a side effect, it completely misses the virtual packages [*], which is pretty nice since we get a list with only real packages that the user can indeed select and see in the menuconfig. [*] Except for 'cryptodev' and 'jpeg' which are both virtual packages and normal packages. Except they are not normal packages, they are used to display a choice of the implementation to use. This case will be fixed in follow-up patches. Since we'll soon need to also output the table of virtual packages, we need to teach the _is_package() function to recognise them as well. This patch is the first step into that direction: it introduces a new function _is_real_package() that is just a wrapper to _is_package(), which gains a new parameter, being the type of packages to filter on. No behavioural change is made in this patch, it is just a preparatory patch. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* support/scripts: document args to _is_package() in gen-manual-listsYann E. MORIN2014-06-081-0/+2
| | | | | | | Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Samuel Martin <s.martin49@gmail.com> Acked-by: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* support/scripts: prepare expanding the packages listsYann E. MORIN2014-06-081-1/+10
| | | | | | | | | | | | Move to a function the code generating the package name from a symbol's name, to avoid code duplication. This is not used currently, but will be in a subsequent patch. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Samuel Martin <s.martin49@gmail.com> Acked-by: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* deprecated handling: introduce BR2_DEPRECATED_SINCE_xxxx_xxThomas De Schampheleire2014-01-101-1/+3
| | | | | | | | | | | | | | | | | | | | | In order to keep better track of when a feature got deprecated, and hence when it can be removed, a new set of symbols BR2_DEPRECATED_SINCE_xxxx_xx is introduced. These symbols are automatically selected when BR2_DEPRECATED is selected, and thus are transparent to the user. A deprecated feature will no longer depend on BR2_DEPRECATED directly, but rather on the appropriate BR2_DEPRECATED_SINCE_xxxx_xx. If that symbol does not yet exist, it has to be created in Config.in. When removing a deprecated feature, one should also check whether this was the last feature using the BR2_DEPRECATED_SINCE_xxxx_xx symbol, in which case the latter can be removed from Config.in. A followup patch will make sure the overview is added to the list of deprecated features in the manual, so that a buildroot core developer can easily determine which features to remove in a given development cycle. Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com> Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* manual: do not generate .pyc filesYann E. MORIN2013-12-061-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | Python saves a pre-compiled support/scripts/kconfiglib.pyc file side-to-side with the corresponding .py file. This does not work if the Buildroot source tree is read-only (but this is not an error for Python, which keep going OK). But this may cause issues for out-of-tree builds in case the same Buildroot source tree is shared by many builds. Also, 'make clean' currently does not clean this file, and out-of-tree builds can remove it either, at the risk of causing issues for other out-of-tree builds running at the same time. Just tell Python not to generate .pyc files: - call the script via python, don't use the sha-bang - thus, make the script non-executable, and remove the sha-bang Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Arnout Vandecappelle <arnout@mind.be> Cc: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* support: trivial fixes (typos and minor rewording) in gen-manual-lists.pySamuel Martin2013-11-011-8/+7
| | | | | | | | | | [Thomas: added Thomas DS Acked-by, given at http://patchwork.ozlabs.org/patch/284719/, and made the additional typo fixes suggested by Thomas DS.] Signed-off-by: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Acked-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
* gen-manual-lists.py: fixup after 2440385 (config: reorder top-level menu)Peter Korsgaard2013-08-301-1/+1
| | | | Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
* support/scripts: add gen-manual-lists.pySamuel Martin2013-05-041-0/+379
Script generating the target and host package tables, and the deprecated stuff list as well. These tables and lists are generated parsing the Config.in files. Signed-off-by: Samuel Martin <s.martin49@gmail.com> [yann.morin.1998@free.fr: no leading dot, no menu path for host-utils] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
OpenPOWER on IntegriCloud