diff options
| -rwxr-xr-x | .extras/test-build | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/.extras/test-build b/.extras/test-build index 6c2d580..f245aed 100755 --- a/.extras/test-build +++ b/.extras/test-build @@ -38,6 +38,7 @@ USE_COLOR=1 # --no-color or non-TTY disables 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 VERSION_ID="current" # "current" | "15.0"; set by --stable TARGET_ARG="" @@ -66,6 +67,9 @@ OPTIONS: --dry-run Resolve, apply overrides, print the build order, do not build. --yes Skip the confirm prompt (the order is still printed first). --no-cache Rebuild all deps this run, ignore/refresh the cache. + --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. --no-color Disable ANSI color (auto-disabled when stdout is not a TTY). EOF } @@ -78,6 +82,7 @@ parse_args() { --dry-run) DRY_RUN=1; shift ;; --yes) ASSUME_YES=1; shift ;; --no-cache) USE_CACHE=0; shift ;; + --keep) KEEP_TARGET=1; shift ;; --no-color) USE_COLOR=0; shift ;; -*) echo "Unknown option: $1" >&2; usage >&2; exit 2 ;; *) @@ -643,6 +648,15 @@ CONTAINER_EOF elif grep -q '^LINT-CLEAN$' "$logf" 2>/dev/null; then echo " lint: ${C_GRN}clean${C_RST}" fi + # --keep: copy the built target package to a durable dir (sibling of the + # logs tree, not inside a throwaway run dir) so it can be installed on + # the host, e.g. to regenerate post-install artifacts. + if [[ $KEEP_TARGET -eq 1 ]]; then + local keepdir; keepdir="$(dirname "$LOG_ROOT")/kept" + mkdir -p "$keepdir" + cp -a "$newest" "$keepdir/" + echo " kept: $keepdir/$(basename "$newest")" + fi fi fi return 0 |
