From badc868bafbae418eac2b6a41387ed1723c1d86d Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Mon, 2 Oct 2017 12:20:50 +0200 Subject: 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. --- kconfiglib.py | 20 ++++++++++++-------- 1 file 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, -- cgit v1.2.3