Loading core/product_config.rbc +9 −1 Original line number Diff line number Diff line Loading @@ -361,7 +361,7 @@ def _addsuffix(suffix, string_or_list): def __words(string_or_list): if type(string_or_list) == "list": return string_or_list return string_or_list.split() return _mkstrip(string_or_list).split() # Handle manipulation functions. # A handle passed to a PCM consists of: Loading Loading @@ -485,6 +485,13 @@ def _filter(pattern, text): res.append(w) return res def _notdir(paths): """Equivalent to the GNU make function $(notdir). Returns the name of the file at the end of each path in paths. """ return " ".join([__base(w) for w in __words(paths)]) def __mk2regex(words): """Returns regular expression equivalent to Make pattern.""" Loading Loading @@ -674,6 +681,7 @@ rblf = struct( mkwarning = _mkwarning, mkstrip = _mkstrip, mksubst = _mksubst, notdir = _notdir, printvars = _printvars, printglobals = _printglobals, product_configuration = _product_configuration, Loading tests/run.rbc +5 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,11 @@ assert_eq(["from/a:to/a", "from/b:to/b"], rblf.product_copy_files_by_pattern("fr assert_eq([], rblf.filter(["a", "", "b"], "f")) assert_eq(["", "b"], rblf.filter_out(["a", "" ], ["a", "", "b"] )) assert_eq("foo.c no_folder", rblf.notdir(["src/foo.c", "no_folder"])) assert_eq("foo.c no_folder", rblf.notdir("src/foo.c no_folder")) assert_eq("", rblf.notdir("/")) assert_eq("", rblf.notdir("")) (globals, config, globals_base) = rblf.product_configuration("test/device", init, version_defaults) assert_eq( { Loading Loading
core/product_config.rbc +9 −1 Original line number Diff line number Diff line Loading @@ -361,7 +361,7 @@ def _addsuffix(suffix, string_or_list): def __words(string_or_list): if type(string_or_list) == "list": return string_or_list return string_or_list.split() return _mkstrip(string_or_list).split() # Handle manipulation functions. # A handle passed to a PCM consists of: Loading Loading @@ -485,6 +485,13 @@ def _filter(pattern, text): res.append(w) return res def _notdir(paths): """Equivalent to the GNU make function $(notdir). Returns the name of the file at the end of each path in paths. """ return " ".join([__base(w) for w in __words(paths)]) def __mk2regex(words): """Returns regular expression equivalent to Make pattern.""" Loading Loading @@ -674,6 +681,7 @@ rblf = struct( mkwarning = _mkwarning, mkstrip = _mkstrip, mksubst = _mksubst, notdir = _notdir, printvars = _printvars, printglobals = _printglobals, product_configuration = _product_configuration, Loading
tests/run.rbc +5 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,11 @@ assert_eq(["from/a:to/a", "from/b:to/b"], rblf.product_copy_files_by_pattern("fr assert_eq([], rblf.filter(["a", "", "b"], "f")) assert_eq(["", "b"], rblf.filter_out(["a", "" ], ["a", "", "b"] )) assert_eq("foo.c no_folder", rblf.notdir(["src/foo.c", "no_folder"])) assert_eq("foo.c no_folder", rblf.notdir("src/foo.c no_folder")) assert_eq("", rblf.notdir("/")) assert_eq("", rblf.notdir("")) (globals, config, globals_base) = rblf.product_configuration("test/device", init, version_defaults) assert_eq( { Loading