aboutsummaryrefslogtreecommitdiffstats
path: root/test-build
diff options
context:
space:
mode:
Diffstat (limited to 'test-build')
-rwxr-xr-xtest-build14
1 files changed, 13 insertions, 1 deletions
diff --git a/test-build b/test-build
index 54a8da4..1eb1795 100755
--- a/test-build
+++ b/test-build
@@ -53,6 +53,7 @@ DRY_RUN=0 # --dry-run: resolve + print order, do not build
ASSUME_YES=0 # --yes: skip the confirm prompt (still prints the order)
USE_CACHE=1 # --no-cache disables the dep cache for one run
KEEP_TARGET=0 # --keep: copy the built target package out to KEEP_DIR
+LOCAL_DEPS=0 # --local-deps: also resolve deps from the target's own repo
VERSION_ID="current" # "current" | "15.0"; set by --stable
TARGET_ARG=""
@@ -85,6 +86,9 @@ OPTIONS:
--keep Copy the built target package out to a kept/ dir (path is
printed), so it can be installed on the host. The build is
otherwise throwaway.
+ --local-deps Also resolve deps from the target's own repo (its grandparent
+ dir), for packages whose deps are siblings in the same repo and
+ not on SBo. The configured SBo tree is still searched after.
--no-color Disable ANSI color (auto-disabled when stdout is not a TTY).
EOF
}
@@ -99,6 +103,7 @@ parse_args() {
--yes) ASSUME_YES=1; shift ;;
--no-cache) USE_CACHE=0; shift ;;
--keep) KEEP_TARGET=1; shift ;;
+ --local-deps) LOCAL_DEPS=1; shift ;;
--no-color) USE_COLOR=0; shift ;;
-*) echo "Unknown option: $1" >&2; usage >&2; exit 2 ;;
*)
@@ -851,7 +856,7 @@ main() {
parse_args "$@"
init_color
require_config
- SBO_TREE_ROOTS=("$ACTIVE_TREE")
+ SBO_TREE_ROOTS=("$ACTIVE_TREE") # target's repo root prepended below if --local-deps
load_overrides
# image + cache namespace (skip the image check on a pure dry-run so the order
@@ -873,6 +878,13 @@ main() {
exit 1
fi
+ # --local-deps: search the target's own repo (grandparent of <repo>/<cat>/<pkg>)
+ # before the SBo tree, so deps that are siblings in the same repo resolve.
+ if [[ $LOCAL_DEPS -eq 1 ]]; then
+ local repo_root; repo_root="$(dirname "$(dirname "$tdir")")"
+ SBO_TREE_ROOTS=("$repo_root" "${SBO_TREE_ROOTS[@]}")
+ fi
+
run_target "$tdir"
print_summary
}