From aea0232a56d9a9d2611b79ea9c67e0d9d49b183f Mon Sep 17 00:00:00 2001 From: Roman Date: Tue, 27 Feb 2018 10:04:36 +0200 Subject: Implement 'rsource' statement ('source' with relative path) The 'rsource' statement works like 'source', but looks relative to the Kconfig file that has the 'rsource' rather than relative to the base Kconfig file. Using 'rsource' makes it possible to move subtrees with Kconfig files around without breaking references to other Kconfig files. So far, this is a Kconfiglib-exclusive feature. --- tests/Klocation | 22 ++++++++++++++++------ tests/Klocation_included | 18 ------------------ tests/Klocation_sourced | 18 ++++++++++++++++++ tests/sub/Klocation_rsourced | 2 ++ 4 files changed, 36 insertions(+), 24 deletions(-) delete mode 100644 tests/Klocation_included create mode 100644 tests/Klocation_sourced create mode 100644 tests/sub/Klocation_rsourced (limited to 'tests') diff --git a/tests/Klocation b/tests/Klocation index 00d4f4a..aa176b2 100644 --- a/tests/Klocation +++ b/tests/Klocation @@ -33,15 +33,25 @@ config MULTI_DEF endif endif -config EXPANDED_FROM_ENV +config TESTS_DIR_FROM_ENV string - option env="EXPANDED_FROM_ENV" + option env="TESTS_DIR_FROM_ENV" -config _INCLUDED +config SUB_DIR_FROM_ENV string - default "_included" + option env="SUB_DIR_FROM_ENV" -# Expands to "tests/Klocation_included" -source "$EXPANDED_FROM_ENV/Klocation$_INCLUDED" +config _SOURCED + string + default "_sourced" + +config _RSOURCED + string + default "_rsourced" + +# Expands to "tests/Klocation_sourced" +source "$TESTS_DIR_FROM_ENV/Klocation$_SOURCED" +# Expands to "sub/Klocation_rsourced" +rsource "$SUB_DIR_FROM_ENV/Klocation$_RSOURCED" config MULTI_DEF diff --git a/tests/Klocation_included b/tests/Klocation_included deleted file mode 100644 index 6e19f76..0000000 --- a/tests/Klocation_included +++ /dev/null @@ -1,18 +0,0 @@ - - -config MULTI_DEF - -choice CHOICE - bool "choice" -endchoice - -config MENU_HOOK - bool - -menu "menu" -endmenu - -config COMMENT_HOOK - bool - -comment "comment" diff --git a/tests/Klocation_sourced b/tests/Klocation_sourced new file mode 100644 index 0000000..6e19f76 --- /dev/null +++ b/tests/Klocation_sourced @@ -0,0 +1,18 @@ + + +config MULTI_DEF + +choice CHOICE + bool "choice" +endchoice + +config MENU_HOOK + bool + +menu "menu" +endmenu + +config COMMENT_HOOK + bool + +comment "comment" diff --git a/tests/sub/Klocation_rsourced b/tests/sub/Klocation_rsourced new file mode 100644 index 0000000..c6f185d --- /dev/null +++ b/tests/sub/Klocation_rsourced @@ -0,0 +1,2 @@ + +config MULTI_DEF -- cgit v1.2.3