summaryrefslogtreecommitdiff
path: root/allmodconfig.py
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2019-03-22 15:42:45 +0100
committerUlf Magnusson <ulfalizer@gmail.com>2019-03-22 17:29:12 +0100
commitc70a45eb935dc536ce59ec860c17b4c1c531a663 (patch)
tree22afac8b77fefc6e5878b5605e1c878e0edd3345 /allmodconfig.py
parente4a71defef40b6ab640dedaf185562f343f963c9 (diff)
Convert some comments to module docstrings in utilities
This makes running pydoc(3) on the utilities helpful. Reuse the module docstring for the --help text for utilities that use argparse. Also fix some copy-paste errors in the all*config.py descriptions and clean up the language a bit. Piggyback removal of an optimization in allmodconfig.py that's pretty irrelevant now.
Diffstat (limited to 'allmodconfig.py')
-rwxr-xr-xallmodconfig.py29
1 files changed, 13 insertions, 16 deletions
diff --git a/allmodconfig.py b/allmodconfig.py
index f7c6608..b41cf23 100755
--- a/allmodconfig.py
+++ b/allmodconfig.py
@@ -3,15 +3,16 @@
# Copyright (c) 2018-2019, Ulf Magnusson
# SPDX-License-Identifier: ISC
-# Works like 'make allmodconfig'. Verified by the test suite to generate output
-# identical to 'make allmodconfig', for all ARCHES.
-#
-# The default output filename is '.config'. A different filename can be passed
-# in the KCONFIG_CONFIG environment variable.
-#
-# Usage for the Linux kernel:
-#
-# $ make [ARCH=<arch>] scriptconfig SCRIPT=Kconfiglib/examples/allyesconfig.py
+"""
+Writes a configuration file where as many symbols as possible are set to 'm'.
+
+The default output filename is '.config'. A different filename can be passed
+in the KCONFIG_CONFIG environment variable.
+
+Usage for the Linux kernel:
+
+ $ make [ARCH=<arch>] scriptconfig SCRIPT=Kconfiglib/examples/allmodconfig.py
+"""
import kconfiglib
@@ -22,22 +23,18 @@ def main():
# See allnoconfig.py
kconf.disable_warnings()
- # Small optimizations
- BOOL = kconfiglib.BOOL
- TRISTATE = kconfiglib.TRISTATE
-
for sym in kconf.unique_defined_syms:
- if sym.orig_type == BOOL:
+ if sym.orig_type == kconfiglib.BOOL:
# 'bool' choice symbols get their default value, as determined by
# e.g. 'default's on the choice
if not sym.choice:
# All other bool symbols get set to 'y', like for allyesconfig
sym.set_value(2)
- elif sym.orig_type == TRISTATE:
+ elif sym.orig_type == kconfiglib.TRISTATE:
sym.set_value(1)
for choice in kconf.unique_choices:
- choice.set_value(2 if choice.orig_type == BOOL else 1)
+ choice.set_value(2 if choice.orig_type == kconfiglib.BOOL else 1)
kconf.enable_warnings()