lkml.org 
[lkml]   [2011]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH v3] [ANNOUNCE] kconfig: Kconfiglib: a flexible Python Kconfig parser
This patch builds on https://lkml.org/lkml/2011/2/5/174 . A compound patch
(original patch + all fixes) is available at
http://dl.dropbox.com/u/10406197/kconfiglib.patch (apply with 'git am').

Changelog:
v3:
- Forgot to update the documentation for get_mainmenu_text() in v2.
- s/effect/affect/ in example 7.

v2:
- Now supports alternative output directories (O=).
- $-references were expanded as environment variables in some
contexts ('source', 'mainmenu', and 'defconfig') where they should
have been expanded as symbol values - fixed. The reason this broke
so little is that all symbols whose value come from an environment
variable are currently called the same thing as that variable.
- Added the internal special symbol UNAME_RELEASE, used by
DEFCONFIG_LIST. Previously get_defconfig_filename() failed to find
.configs whose DEFCONFIG_LIST entry involved UNAME_RELEASE - now
works.
- get_defconfig_filename() now searches relative to $srctree before
looking in the current directory, just like the C implementation.
- Updated example 1 to work regardless of build directory.
- Precompiled a few regexes.

Signed-off-by: Ulf Magnusson <ulfalizer.lkml@gmail.com>
---
Convenience links:

Latest documentation (generated with pydoc -w kconfiglib):
http://dl.dropbox.com/u/10406197/kconfiglib.html

Latest example files (ex1.py updated in v2):
http://dl.dropbox.com/u/10406197/kconfiglib-examples.tar.gz

scripts/kconfig/kconfiglib.py | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/scripts/kconfig/kconfiglib.py b/scripts/kconfig/kconfiglib.py
index fa3d5ee..964e5cb 100644
--- a/scripts/kconfig/kconfiglib.py
+++ b/scripts/kconfig/kconfiglib.py
@@ -323,7 +323,7 @@ while True:

sym.set_value(lower_bound)

- # We just changed the value of some symbol. As this may effect
+ # We just changed the value of some symbol. As this may affect
# other symbols, keep going.
done = False

@@ -708,9 +708,9 @@ class Config():
return self.arch

def get_mainmenu_text(self):
- """Returns the text of the 'mainmenu' statement (with environment
- variables expanded to the value they had when the Config was created),
- or None if the configuration has no 'mainmenu' statement."""
+ """Returns the text of the 'mainmenu' statement (with $-references to
+ symbols replaced by symbol values), or None if the configuration has no
+ 'mainmenu' statement."""
return self._expand_sym_refs(self.mainmenu_text)

def get_defconfig_filename(self):
--
1.7.0.4


\
 
 \ /
  Last update: 2011-02-06 19:29    [W:0.021 / U:1.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site