diff mbox series

set_versions.py: check that we build from the git repository

Message ID 20260203-building-from-tarballs-v1-1-40e353ca4085@bootlin.com
State New
Headers show
Series set_versions.py: check that we build from the git repository | expand

Commit Message

Antonin Godard Feb. 3, 2026, 8:25 a.m. UTC
Check that we are building from a Git clone of yocto-docs, not a bare
directory, which is not supported as we need to tags to be fetched.
Inform the user how to clone the documentation too.

Fixes [YOCTO #15834]

Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
---
 documentation/set_versions.py | 8 ++++++++
 1 file changed, 8 insertions(+)


---
base-commit: b8a56b8b2e8c0417b2f7204f80c79b05d95e9ce4
change-id: 20260106-building-from-tarballs-70b35c8b4736
diff mbox series

Patch

diff --git a/documentation/set_versions.py b/documentation/set_versions.py
index 78d0518c1..eec0302f8 100755
--- a/documentation/set_versions.py
+++ b/documentation/set_versions.py
@@ -101,6 +101,14 @@  ourbranch = None
 bitbakeversion = None
 docconfver = None
 
+# Test that we are building from a Git repository
+try:
+    subprocess.run(["git", "rev-parse", "--is-inside-work-tree"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=True)
+except subprocess.CalledProcessError:
+    sys.exit("Building yocto-docs must be done from its Git repository.\n"
+             "Clone the documentation repository with the following command:\n"
+             "git clone https://git.yoctoproject.org/yocto-docs ")
+
 # Test tags exist and inform the user to fetch if not
 try:
     subprocess.run(["git", "show", "yocto-%s" % release_series[activereleases[0]]], stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=True)