diff mbox series

[05/10] bitbake-setup: Allow local registry paths

Message ID 20250929125616.1751116-5-alex.kanavin@gmail.com
State New
Headers show
Series [01/10] bitbake-setup: add the initial implementation | expand

Commit Message

Alexander Kanavin Sept. 29, 2025, 12:56 p.m. UTC
From: Richard Purdie <richard.purdie@linuxfoundation.org>

It is useful for bitbake-setup to support local paths without access through
the fetcher so that internal data to the bitbake repository can be used as
a default.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 bin/bitbake-setup | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/bin/bitbake-setup b/bin/bitbake-setup
index d6509500d..b07bf2eb7 100755
--- a/bin/bitbake-setup
+++ b/bin/bitbake-setup
@@ -509,10 +509,15 @@  def do_fetch(fetcher, dir):
 
 def update_registry(registry, cachedir, d):
     registrydir = 'configurations'
-    full_registrydir = os.path.join(cachedir, registrydir)
-    print("Fetching configuration registry\n    {}\ninto\n    {}".format(registry, full_registrydir))
-    fetcher = bb.fetch.Fetch(["{};destsuffix={}".format(registry, registrydir)], d)
-    do_fetch(fetcher, cachedir)
+    if registry.startswith("."):
+        full_registrydir = os.path.join(os.getcwd(), registry, registrydir)
+    elif registry.startswith("/"):
+        full_registrydir = os.path.join(registry, registrydir)
+    else:
+        full_registrydir = os.path.join(cachedir, registrydir)
+        print("Fetching configuration registry\n    {}\ninto\n    {}".format(registry, full_registrydir))
+        fetcher = bb.fetch.Fetch(["{};destsuffix={}".format(registry, registrydir)], d)
+        do_fetch(fetcher, cachedir)
     return full_registrydir
 
 def has_expired(expiry_date):