From d56e9c1d4c3e6f560382ac71fa2419b2a9bef1cb Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Sun, 7 Jun 2015 16:57:46 +0200 Subject: Do not require $srctree to be set for non-kernel projects. (It was never required if you explicitly passed a 'base_dir', but it's a bit silly to have to do that too.) This is a bug. I expected os.path.expandvars() to replace references non-set environment variables with nothing, but it leaves them as is. Work around it by letting base_dir = None be special and the default. It uses $srctree if set and the current directory otherwise. This has the following advantages: - It avoids having to reimplement a different version of os.path.expandvars() and special-casing "" to mean the current directory. - It means '$' can appear in paths. (Though it probably never will.) Maybe the expansion behavior could be removed too, but keep it for now to be backwards compatible. --- tests/Kbase_dir | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 tests/Kbase_dir (limited to 'tests/Kbase_dir') diff --git a/tests/Kbase_dir b/tests/Kbase_dir new file mode 100644 index 0000000..9f8c55a --- /dev/null +++ b/tests/Kbase_dir @@ -0,0 +1,2 @@ +# This will only work if 'base_dir' is set correctly +source "empty" -- cgit v1.2.3