Merge "Make dir work on multiple paths"
This commit is contained in:
@@ -439,10 +439,6 @@ def __base(path):
|
|||||||
"""Returns basename."""
|
"""Returns basename."""
|
||||||
return path.rsplit("/",1)[-1]
|
return path.rsplit("/",1)[-1]
|
||||||
|
|
||||||
def __dir(path):
|
|
||||||
"""Returns dirname."""
|
|
||||||
return path.rsplit("/",1)[0]
|
|
||||||
|
|
||||||
def _board_platform_in(g, string_or_list):
|
def _board_platform_in(g, string_or_list):
|
||||||
"""Returns true if board is in the list."""
|
"""Returns true if board is in the list."""
|
||||||
board = g.get("TARGET_BOARD_PLATFORM","")
|
board = g.get("TARGET_BOARD_PLATFORM","")
|
||||||
@@ -533,6 +529,13 @@ def _filter(pattern, text):
|
|||||||
break
|
break
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
def _dir(paths):
|
||||||
|
"""Equivalent to the GNU make function $(dir).
|
||||||
|
|
||||||
|
Returns the folder of the file for each path in paths.
|
||||||
|
"""
|
||||||
|
return " ".join([w.rsplit("/",1)[0] for w in __words(paths)])
|
||||||
|
|
||||||
def _notdir(paths):
|
def _notdir(paths):
|
||||||
"""Equivalent to the GNU make function $(notdir).
|
"""Equivalent to the GNU make function $(notdir).
|
||||||
|
|
||||||
@@ -756,7 +759,7 @@ rblf = struct(
|
|||||||
copy_files = _copy_files,
|
copy_files = _copy_files,
|
||||||
copy_if_exists = _copy_if_exists,
|
copy_if_exists = _copy_if_exists,
|
||||||
cfg = __h_cfg,
|
cfg = __h_cfg,
|
||||||
dir = __dir,
|
dir = _dir,
|
||||||
enforce_product_packages_exist = _enforce_product_packages_exist,
|
enforce_product_packages_exist = _enforce_product_packages_exist,
|
||||||
expand_wildcard = _expand_wildcard,
|
expand_wildcard = _expand_wildcard,
|
||||||
file_exists = rblf_file_exists,
|
file_exists = rblf_file_exists,
|
||||||
|
Reference in New Issue
Block a user