[PATCH] sb/version: Set top from external package

chrisj at rtems.org chrisj at rtems.org
Thu Sep 29 08:57:29 UTC 2022


From: Chris Johns <chrisj at rtems.org>

---
 source-builder/sb/version.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/source-builder/sb/version.py b/source-builder/sb/version.py
index 29d2dc5..4ec7cfa 100644
--- a/source-builder/sb/version.py
+++ b/source-builder/sb/version.py
@@ -89,9 +89,13 @@ _version_str = '%s.%s' % (_version, _revision)
 _released = False
 _git = False
 _is_loaded = False
+_top_dir = None
 
 def _top():
-    top = path.dirname(sys.argv[0])
+    if _top_dir is None:
+        top = path.dirname(sys.argv[0])
+    else:
+        top = _top_dir
     if len(top) == 0:
         top = '.'
     return top
@@ -183,6 +187,10 @@ def _load_git_version():
             _is_loaded = True
     return _git
 
+def set_top(top):
+    global _top_dir
+    _top_dir = top
+
 def load_release_settings(section, error = False):
     vc, v = _load_released_version_config()
     items = []
-- 
2.37.1



More information about the devel mailing list