| Age | Commit message (Collapse) | Author |
|
Removed in linux-next.
|
|
Just for completeness.
|
|
'gsource' works like 'source', but takes a glob pattern and sources all
matching files. Works as a no-op if no files match, and hence doubles as
an include-if-exists function, similar to '-include' in 'make'.
Add a 'grsource' statement as well, mirroring 'rsource'.
Came up in https://github.com/ulfalizer/Kconfiglib/pull/40.
|
|
Works like 'make savedefconfig' in the C tools. Call it
write_min_config() rather than write_defconfig() to be a bit more
explicit.
Add a test similar to test_defconfig that compares Kconfiglib minimal
configuration output against the C implementation, for all defconfig
files.
Disable the tests for now. The C tools have a bug that causes an
incorrect configuration to be generated for tristate choices in some
cases. They will be re-enabled once those are fixed.
|
|
defconfig_files() yields all the defconfig files for a particular arch/
subdirectory. This will allow reuse when savedefconfig is tested.
Also simplify the code a bit.
|
|
Not that important of a stat, plus there might be more tests that
process defconfig files soon, making it kinda meaningless.
|
|
No great need to log timestamps anymore.
|
|
The 'for' overrode 'srcarch', which is currently harmless, but ugly.
|
|
Makes sense as SRCARCH holds the arch/ subdirectory and _arch might be
confused for ARCH.
|
|
Get rid of the compare_configs flag and just do the comparison from the
test functions themselves with a helper.
Also get rid of the test_load() test. That's indirectly tested through
the other tests, and test_alldefconfig() runs first and is speedy.
|
|
Implement a scheme from the C tools where symbols get corresponding
files that are touch'ed whenever the symbol's value changes. This can be
used to add e.g. Makefile dependencies between source files and
particular symbols.
See the docstring of the new sync_deps() function for more information.
Piggyback a small sanity check for write_autoconf().
|
|
Unused leftover from Kconfiglib 1.
|
|
The 'rsource' statement works like 'source', but looks relative to the
Kconfig file that has the 'rsource' rather than relative to the base
Kconfig file. Using 'rsource' makes it possible to move subtrees with
Kconfig files around without breaking references to other Kconfig files.
So far, this is a Kconfiglib-exclusive feature.
|
|
Direct dependencies are significant for 'imply' even if the symbol has
no properties, so they need to be included to get semantically
equivalent output.
Making the direct dependencies clear is helpful in general too, even if
you can usually infer them from the properties they get propagated to.
|
|
Previously, setting a choice symbol to y would only update
user_selection on the parent choice and not the symbol's own user_value.
Now both are updated.
The point of the old behavior was to remember the m mode selections of a
choice when it was switched back and forth between m and y mode, which
was a feature I thought the C implementation had. On closer inspection,
the C implementation never had that feature, though it might appear like
it if you only make "lucky" changes (if you never select any symbols in
y mode that were n in m mode).
The new behavior is simpler and easier to understand: Symbol.user_value
now always matches the value assigned in a .config file or via
set_value(), provided the value was well-formed. This might avoid some
special-casing in scripts too.
The loss in usability is pretty minimal.
|
|
Oversight during refactoring. defconfig files should be searched for in
in arch/$SRCARCH/ rather than arch/$ARCH/, to account for
$ARCH != $SRCARCH.
Adds a few tests to test_defconfig(). Some of the ARCH/defconfig
combinations might be nonsensical, but that's fine.
Make all test functions take $SRCARCH as well as $ARCH, which makes the
implementation straightforward.
|
|
List the ARCH/SRCARCH pairs that don't conform to the arch/$ARCH/Kconfig
pattern directly.
|
|
Don't think anything currently depends on it where it would matter for
the test suite, but might as well.
|
|
Just to have clean output. The warnings themselves are accurate.
|
|
These are easiest to check after parsing, since a symbol/choice can be
defined in multiple locations:
- Warn if a symbol or choice defined without a type. Also warn for
choice value symbols defined without a type, even if they
automatically get their type from the choice. This feature isn't
well-known and probably not used deliberately.
- Warn if a choice is defined without a prompt
- Warn of a choice default symbol is not contained in the choice
Also move _name_and_loc_str() from the symbol class to the global scope
and generalize it to be able to handle choices.
|
|
Might break U-Boot if they ever upgrade Kconfiglib, because they have a
'select y' in there (which the C tools don't flag since they only look
for quotes), but it's a one-line fix.
|
|
Mirrors 9059a3493ef ("kconfig: fix relational operators for bool and
tristate symbols") in the C implementation.
|
|
The fancy regex isn't really justified. Much faster with replace() too,
though this is an unlikely hotspot.
Could have used a \g<0> backreference to refer to the entire match
instead of using a capturing group too. Hadn't discovered that.
Add some selftests for escape() and unescape() too.
|
|
|
|
Speeds things up a bit further.
Rework the unget handling to save the ungotten line directly instead of
using a flag.
Add some help texts to tests/Klocation to make sure the line number is
updated properly for those.
|
|
Check for incorrect exceptions instead of propagating them, and get rid
of the flag.
|
|
Easier to debug than a RecursionError.
Point out in the exception message that a common cause is environment
variables not being set correctly.
|
|
Old code.
|
|
Choice symbols without prompts are pointless and probably nonexistent in
practice, so it's a bit silly to run the no-prompt optimization for
them.
Piggyback copyright year update.
|
|
The Linux Kernel's merge_config.sh defaults to disabling warnings for
redundant assignments and has support for enabling them
specifically. This patch reproduces this behaviour in kconfiglib
except that we retaing kconfiglib's default behaviour of enabling the
warnings.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
|
|
Piggyback some cleanup and redundant comment removal.
|
|
Oversight. SYMBOL_AUTO (env_var) being set indirectly clears
SYMBOL_WRITE (_write_to_conf) in sym_calc_value(). The .config case was
already fine due to an explicit env_var check.
Even non-visible env. symbols ended up in the header, due to
'option env' internally adding a default.
Disallow user values altogether on 'option env' symbols, even if
specified manually. This matches the C implementation. Add a warning
too.
|
|
IANAL, but hopefully this should be enough. Don't bundle the license
file. Might be easier to work with if just kconfiglib.py is copied.
|
|
Clean up some formatting a bit too.
|
|
Confirms that all the examples that aren't tested in the test suite at
least run. Easy to miss brokenness there. Output can be inspected
manually (it'll vary depending on the kernel version).
Fix defconfig_oldconfig.py, which hadn't been properly updated for the
new API.
|
|
Add test coverage for that Choice.__repr__() path too.
|
|
Was only used by allyesconfig.py. Easy to add back if needed at any
point.
|
|
"List comprehensions no longer support the...",
https://docs.python.org/3.0/whatsnew/3.0.html
|
|
Just return (2,). More intuitive, and makes y-mode choices just work in
the menuconfig example.
Turns out to be simple to implement with choice symbol visibility
depending on the Choice.
|
|
Usability improvement discovered while putting together menuconfig
example. Would have to duplicate validity checking otherwise.
Also reject negative values for HEX symbols, just to be compatible with
the C implementation.
Keep TRI_TO_STR and STR_TO_TRI public. They're pretty handy even if
they're trivial.
|
|
s/absolute/relative/
|
|
Used to set a bunch of other options too on MODULES in the test, but
it's cleaner to do it separately.
|
|
Tests for .assignable have been added.
|
|
Just add a column for the expected values for the no-modules case to the
existing tests.
Also automatically detect choice symbols in choices with y mode and
disable the value setting test, instead of having to pass a flag.
|
|
|
|
Could never return 0 as a valid assignable value previously.
|
|
|
|
|
|
A tristate implied to y can't be set to m. Other than that, imply
doesn't affect assignable values.
Fix some copy-paste type errors too.
In the C menuconfig, a tristate with m visibility implied to y gets
stuck if you change it with space. Look into that later. Test case:
config MODULES
def_bool y
option modules
config Y_IMPLIER
def_tristate y
imply Y_IMP_M_VIS_TRI
config Y_IMP_M_VIS_TRI
tristate "y-imp m-vis tri" if m
|
|
Comprehensive selftests are important here, because the
allno/yesconfig.py scripts only check the upper and lower bound, and
allnoconfig disables modules.
Found a bug for non-selected m-visible tristates, where n didn't show up
in sym.assignable. Everything matches menuconfig after fixing that.
Still need to test symbols in choices with different modes, imply, and
.assignable for choices.
|