summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kconfiglib.py15
-rw-r--r--tests/Kdefconfig_srctree2
2 files changed, 6 insertions, 11 deletions
diff --git a/kconfiglib.py b/kconfiglib.py
index fab1fb9..d87f9cc 100644
--- a/kconfiglib.py
+++ b/kconfiglib.py
@@ -292,9 +292,9 @@ class Config(object):
past the first one (and prints a warning).
If the environment variable 'srctree' was set when the Config was
- created, each defconfig specified with an absolute path will be
+ created, each defconfig specified with a relative path will be
searched for in $srcdir if it is not found at the specified path (i.e.,
- if /foo/defconfig is not found, $srctree/foo/defconfig will be looked
+ if foo/defconfig is not found, $srctree/foo/defconfig will be looked
up).
WARNING: A wart here is that scripts/kconfig/Makefile sometimes uses
@@ -311,15 +311,10 @@ class Config(object):
filename = self._expand_sym_refs(filename)
if os.path.exists(filename):
return filename
- # defconfig not found. If the path is an absolute path and
+ # defconfig not found. If the path is a relative path and
# $srctree is set, we also look in $srctree.
- if os.path.isabs(filename) and self.srctree is not None:
- # The os.path.relpath() de-absolutizes the path, e.g.
- # /foo/bar/baz -> foo/bar/baz. os.path.join() ignores the
- # first argument if the second argument is an absolute
- # path.
- filename = os.path.join(self.srctree,
- os.path.relpath(filename, os.sep))
+ if not os.path.isabs(filename) and self.srctree is not None:
+ filename = os.path.join(self.srctree, filename)
if os.path.exists(filename):
return filename
diff --git a/tests/Kdefconfig_srctree b/tests/Kdefconfig_srctree
index 3aa4505..d2591fa 100644
--- a/tests/Kdefconfig_srctree
+++ b/tests/Kdefconfig_srctree
@@ -1,5 +1,5 @@
config A
string
option defconfig_list
- default "/sub/defconfig_in_sub" # Assume this doesn't exist
+ default "sub/defconfig_in_sub" # Assume this doesn't exist
default "Kconfiglib/tests/defconfig_2"