diff options
author | Viacheslav Hletenko <v.gletenko@vyos.io> | 2025-06-09 09:41:34 +0000 |
---|---|---|
committer | Viacheslav Hletenko <v.gletenko@vyos.io> | 2025-06-09 09:41:34 +0000 |
commit | 2ecdb4f464f41f43daec872c95c3fce9c8282c11 (patch) | |
tree | d8ccee14f8933e074c70435ec5b92840c2e865c7 /scripts/package-build/build.py | |
parent | 8350580ac5e21d67716f8d40d65786306a7d7b0d (diff) | |
download | vyos-build-2ecdb4f464f41f43daec872c95c3fce9c8282c11.tar.gz vyos-build-2ecdb4f464f41f43daec872c95c3fce9c8282c11.zip |
T7530: Build package binaries script should exit if repo is absent
The build package binaries script should exit if the repo is absent
or cannot be cloned
If a build package `repo-a` depends on the `repo-b` and the `repo-b`
cannot be cloned, then we shoud exit from the script to avoid
partly build dependencies
For example:
```
[[packages]]
name = "fake-repo"
commit_id = "v0.0.1"
scm_url = "https://github.com/vyos/fake-repo"
[[packages]]
name = "ethtool"
commit_id = "debian/1%6.10-1"
scm_url = "https://salsa.debian.org/kernel-team/ethtool"
```
If ethtool depends on some fake-package and this package cannot be
downloaded from the repo, then we shouldn't build the ethtool package
at all.
Diffstat (limited to 'scripts/package-build/build.py')
-rwxr-xr-x | scripts/package-build/build.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/package-build/build.py b/scripts/package-build/build.py index 9c1df7b3..28e9db2a 100755 --- a/scripts/package-build/build.py +++ b/scripts/package-build/build.py @@ -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, |