Merge pull request #975 from sever-sever/T7530

T7530: Build package binaries script should exit if repo is absent
This commit is contained in:
Daniil Baturin 2025-06-10 15:36:23 +01:00 committed by GitHub
commit 7d40712037
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 2 deletions

View File

@ -17,6 +17,7 @@
import glob
import shutil
import sys
import toml
import os
@ -91,7 +92,11 @@ def build_package(package: list, patch_dir: Path) -> None:
# Check out the specific commit
run(['git', 'checkout', package['commit_id']], cwd=repo_dir, check=True)
except CalledProcessError as e:
print(f"Failed to clone or checkout for package '{repo_name}': {e}")
sys.exit(1)
try:
# The `pre_build_hook` is an optional configuration defined in `package.toml`.
# It executes after the repository is checked out and before the build process begins.
# This hook allows you to perform preparatory tasks, such as creating directories,

View File

@ -18,6 +18,7 @@
import datetime
import glob
import shutil
import sys
import toml
import os
import subprocess
@ -60,8 +61,12 @@ def clone_or_update_repo(repo_dir: Path, scm_url: str, commit_id: str) -> None:
run(['git', 'checkout', commit_id], cwd=repo_dir, check=True)
#run(['git', 'pull'], cwd=repo_dir, check=True)
else:
run(['git', 'clone', scm_url, str(repo_dir)], check=True)
run(['git', 'checkout', commit_id], cwd=repo_dir, check=True)
try:
run(['git', 'clone', scm_url, str(repo_dir)], check=True)
run(['git', 'checkout', commit_id], cwd=repo_dir, check=True)
except CalledProcessError as e:
print(f"Failed to clone or checkout: {e}")
sys.exit(1)
def create_tarball(package_name, source_dir=None):