@@ -8,10 +8,20 @@
import datetime
import os
+import subprocess
import sys
from pathlib import Path
+# 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 bitbake's documentation must be done from its Git repository.\n"
+ "Clone the repository with the following command:\n"
+ "git clone https://git.openembedded.org/bitbake ")
+
sys.path.insert(0, os.path.abspath('.'))
import setversions
@@ -43,15 +43,6 @@ BB_RELEASE_TAG_RE = re.compile(r"^[0-9]+\.[0-9]+\.[0-9]+$")
def get_current_version():
ourversion = 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 bitbake's documentation must be done from its Git repository.\n"
- "Clone the repository with the following command:\n"
- "git clone https://git.openembedded.org/bitbake ")
-
# Test tags exist and inform the user to fetch if not
try:
subprocess.run(["git", "show", f"{LTSSERIES[0]}.0"],
This check can be done earlier when building the documentation, and does not need any version information. Move it to the beginning of conf.py. Signed-off-by: Antonin Godard <antonin.godard@bootlin.com> --- doc/conf.py | 10 ++++++++++ doc/setversions.py | 9 --------- 2 files changed, 10 insertions(+), 9 deletions(-)