From 357bf7dd7134d1f5aede02a1b5ac7b55827fd96d Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Sat, 11 Jul 2026 11:07:19 +0200 Subject: Wire --setup-repo and --update flags into main Co-Authored-By: Claude Opus 4.8 --- sbo-batch-test | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/sbo-batch-test b/sbo-batch-test index 1ff4e76..5801e88 100755 --- a/sbo-batch-test +++ b/sbo-batch-test @@ -83,6 +83,8 @@ DRY_RUN=0 # resolve + print build order, do not build WITH_X=0 # --with-x: optional X passthrough (default headless) JOBS=1 # -j: reserved, see TODO INIT_BASE=0 # --init-base: populate SLACKWARE_BASE from the mirror, then exit +SETUP_REPO=0 # --setup-repo: rm+rsync tree, clone subtrees, shadow, then exit +DO_UPDATE=0 # --update: rsync-unshadow + pull subtrees + shadow before build TARGET_ARG="" RUN_DIR="" # timestamped log dir for this run @@ -123,6 +125,13 @@ OPTIONS: --init-base First-time populate SLACKWARE_BASE with the FULL 15.0 package set from the mirror, then exit. Run once before the first build. Refuses to clobber an existing base. + --setup-repo First-time build of the SBo tree: REMOVE SBO_TREE_ROOTS[0], + rsync it fresh from SBO_RSYNC_URL, clone the SBO_PERSONAL_TREES + subtrees in, shadow duplicated upstream packages, then exit. + Does not build. Runs as root. + --update Before building: rsync the tree (--delete, personal subtrees + preserved) to unshadow and refresh upstream, git-pull each + personal subtree, re-shadow duplicated upstream packages. EXTENSION POINTS (not implemented, see TODOs in source): - "all" mode (build every package across all SBo roots). @@ -155,6 +164,8 @@ parse_args() { --with-x) WITH_X=1; shift ;; -j|--jobs) JOBS="${2:-1}"; shift 2 ;; # TODO: implement parallelism --init-base) INIT_BASE=1; shift ;; + --setup-repo) SETUP_REPO=1; shift ;; + --update) DO_UPDATE=1; shift ;; -*) echo "Unknown option: $1" >&2; usage >&2; exit 2 ;; *) if [[ -n "$TARGET_ARG" ]]; then @@ -164,7 +175,7 @@ parse_args() { TARGET_ARG="$1"; shift ;; esac done - if [[ -z "$TARGET_ARG" && $INIT_BASE -eq 0 ]]; then + if [[ -z "$TARGET_ARG" && $INIT_BASE -eq 0 && $SETUP_REPO -eq 0 ]]; then echo "No target given." >&2; usage >&2; exit 2 fi } @@ -1043,7 +1054,11 @@ main() { init_base exit 0 fi + if [[ $SETUP_REPO -eq 1 ]]; then + setup_repo + fi validate_env + [[ $DO_UPDATE -eq 1 ]] && update_personal_trees RUN_DIR="$LOG_ROOT/$(date +%Y-%m-%d_%H-%M-%S)" mkdir -p "$RUN_DIR" -- cgit v1.2.3