Add implementation of dir function

mk2rbc was already emitting conversions of the dir
function, but its implementation didn't exist.

Bug: 227245326
Test: Manually
Change-Id: I3348c022a0ff84e6d3a5be6b18e45c439f1db802
diff --git a/core/product_config.rbc b/core/product_config.rbc
index eab149a..0e7dbf1 100644
--- a/core/product_config.rbc
+++ b/core/product_config.rbc
@@ -439,6 +439,10 @@
     """Returns basename."""
     return path.rsplit("/",1)[-1]
 
+def __dir(path):
+    """Returns dirname."""
+    return path.rsplit("/",1)[0]
+
 def _board_platform_in(g, string_or_list):
     """Returns true if board is in the list."""
     board = g.get("TARGET_BOARD_PLATFORM","")
@@ -736,6 +740,7 @@
     copy_files = _copy_files,
     copy_if_exists = _copy_if_exists,
     cfg = __h_cfg,
+    dir = __dir,
     enforce_product_packages_exist = _enforce_product_packages_exist,
     expand_wildcard = _expand_wildcard,
     file_exists = rblf_file_exists,