summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2017-10-02 12:20:50 +0200
committerUlf Magnusson <ulfalizer@gmail.com>2017-10-02 12:30:37 +0200
commitbadc868bafbae418eac2b6a41387ed1723c1d86d (patch)
tree7bb9b5df21fa832f5bffcc3ff7fa166b57469698
parentb039a805f851f9050e03421c1a7f5f36bd778d35 (diff)
Explain common 'source' gotcha in warning
$FOO in 'source "$FOO"' refers to a Kconfig symbol rather than an environment variable. Seems there might be some tools derived from the kernel Kconfig implementation that work differently here.
-rw-r--r--kconfiglib.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/kconfiglib.py b/kconfiglib.py
index f5a5f93..6b5b80f 100644
--- a/kconfiglib.py
+++ b/kconfiglib.py
@@ -722,14 +722,18 @@ class Config(object):
filename = os.path.join(self._base_dir, exp_kconfig_file)
if not os.path.exists(filename):
- raise IOError('{}:{}: sourced file "{}" (expands to "{}") '
- "not found. Perhaps base_dir (argument to "
- 'Config.__init__(), currently "{}") is set '
- 'to the wrong value.'
- .format(line_feeder.filename,
- line_feeder.linenr,
- kconfig_file, exp_kconfig_file,
- self._base_dir))
+ raise IOError(
+ '{}:{}: sourced file "{}" (expands to "{}") not '
+ "found. Perhaps base_dir (argument to "
+ 'Config.__init__(), currently "{}") is set to the '
+ "the wrong value. Also note that e.g. $FOO in a "
+ "'source' statement does not refer to the "
+ "environment variable FOO, but rather to the Kconfig "
+ "symbol FOO (which would commonly have "
+ "'option env=\"FOO\"' in its definition)."
+ .format(line_feeder.filename, line_feeder.linenr,
+ kconfig_file, exp_kconfig_file,
+ self._base_dir))
# Add items to the same block
self._parse_file(filename, parent, deps, visible_if_deps,