Commit e36e544c authored by Ulf Magnusson's avatar Ulf Magnusson Committed by Carles Cufi
Browse files

genrest: Mention that dependencies are only propagated to 'depends on'



A recent Kconfiglib change turns

    config A
            bool
            prompt "foo" if C && D
            default A if B && C && D
            depends on C && D

into

    config A
            bool "foo"
            default A if B
            depends on C && D

Where e.g. D might be from a surrounding menu/if.

Update the note at the end of symbol pages to clarify that only the
'depends on' includes propagated dependencies.

Piggyback some minor cleanup.

Signed-off-by: default avatarUlf Magnusson <Ulf.Magnusson@nordicsemi.no>
parent cc14c40a
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -77,15 +77,15 @@ Supported Options
     - Description
"""

def write_kconfig_rst():
    # The "main" function. Writes index.rst and the symbol RST files.
def main():
    # Writes index.rst and the symbol RST files

    # accelerate doc building by skipping kconfig option documentation.
    # Accelerate doc building by skipping kconfig option documentation.
    turbo_mode = os.environ.get('KCONFIG_TURBO_MODE') == "1"

    if len(sys.argv) != 3:
        print("usage: {} <Kconfig> <output directory>", file=sys.stderr)
        sys.exit(1)
        sys.exit("usage: {} <Kconfig> <output directory>"
                 .format(sys.argv[0]))

    kconf = kconfiglib.Kconfig(sys.argv[1])
    out_dir = sys.argv[2]
@@ -388,8 +388,8 @@ def kconfig_definition_rst(sc):
            # Add a horizontal line between multiple definitions
            rst += "\n\n----"

    rst += "\n\n*(Definitions include propagated dependencies, " \
           "including from if's and menus.)*"
    rst += "\n\n*(The 'depends on' condition includes propagated " \
           "dependencies from if's and menus.)*"

    return rst

@@ -404,7 +404,7 @@ def choice_id(choice):
    # we can't use that, and the prompt isn't guaranteed to be unique.

    # Pretty slow, but fast enough
    return "choice_{}".format(choice.kconfig.choices.index(choice))
    return "choice_{}".format(choice.kconfig.unique_choices.index(choice))


def choice_desc(choice):
@@ -445,4 +445,4 @@ def write_if_updated(filename, s):


if __name__ == "__main__":
    write_kconfig_rst()
    main()