Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCHv2] docs/manual: fix generation of deprecated list
@ 2015-08-02 14:32 Yann E. MORIN
  2015-08-02 14:57 ` Samuel Martin
  2015-08-02 17:19 ` Thomas Petazzoni
  0 siblings, 2 replies; 3+ messages in thread
From: Yann E. MORIN @ 2015-08-02 14:32 UTC (permalink / raw)
  To: buildroot

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>

---
Thomas, you're in copy because it might be interesting to get the
autobuilders build the manual from time to time, no?

---
Changes v1 -> v2:
  - don't filter in the formatting function, filter in the filter
    function  (Samuel)
---
 support/scripts/gen-manual-lists.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/support/scripts/gen-manual-lists.py b/support/scripts/gen-manual-lists.py
index 1e0e9bb..d231eda 100644
--- a/support/scripts/gen-manual-lists.py
+++ b/support/scripts/gen-manual-lists.py
@@ -178,7 +178,7 @@ class Buildroot:
         'deprecated': {
             'filename': "deprecated-list",
             'root_menu': None,
-            'filter': "_is_deprecated",
+            'filter': "_is_deprecated_feature",
             'format': "_format_symbol_prompt_location",
             'sorted': False,
         },
@@ -278,6 +278,9 @@ class Buildroot:
     def _is_virtual_package(self, symbol):
         return self._is_package(symbol, 'virtual')
 
+    def _is_deprecated_feature(self, symbol):
+        return symbol.get_prompts() and self._is_deprecated(symbol)
+
     def _exists_virt_symbol(self, pkg_name):
         """ Return True if a symbol exists that defines the package as
         a virtual package, False otherwise
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCHv2] docs/manual: fix generation of deprecated list
  2015-08-02 14:32 [Buildroot] [PATCHv2] docs/manual: fix generation of deprecated list Yann E. MORIN
@ 2015-08-02 14:57 ` Samuel Martin
  2015-08-02 17:19 ` Thomas Petazzoni
  1 sibling, 0 replies; 3+ messages in thread
From: Samuel Martin @ 2015-08-02 14:57 UTC (permalink / raw)
  To: buildroot

Yann, all,

On Sun, Aug 2, 2015 at 4:32 PM, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> 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>

-- 
Samuel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCHv2] docs/manual: fix generation of deprecated list
  2015-08-02 14:32 [Buildroot] [PATCHv2] docs/manual: fix generation of deprecated list Yann E. MORIN
  2015-08-02 14:57 ` Samuel Martin
@ 2015-08-02 17:19 ` Thomas Petazzoni
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2015-08-02 17:19 UTC (permalink / raw)
  To: buildroot

Dear Yann E. MORIN,

On Sun,  2 Aug 2015 16:32:07 +0200, Yann E. MORIN wrote:
> 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>
> 
> ---
> Thomas, you're in copy because it might be interesting to get the
> autobuilders build the manual from time to time, no?

Applied, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-08-02 17:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-02 14:32 [Buildroot] [PATCHv2] docs/manual: fix generation of deprecated list Yann E. MORIN
2015-08-02 14:57 ` Samuel Martin
2015-08-02 17:19 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox