diff --git a/local/scripts/verify-fork-versions.sh b/local/scripts/verify-fork-versions.sh index 90ff05b07d..47e8adf22c 100755 --- a/local/scripts/verify-fork-versions.sh +++ b/local/scripts/verify-fork-versions.sh @@ -32,12 +32,15 @@ BRANCH="$(git branch --show-current 2>/dev/null || echo "")" BRANCH_VERSION="$(echo "$BRANCH" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' || true)" violations=0 +# Per-fork status tracking for post-loop summary (Phase 13.1) +declare -A FORK_STATUS=() +declare -A FORK_DETAIL=() for fork_dir in local/sources/*/; do [ -d "$fork_dir" ] || continue fork_name=$(basename "$fork_dir") toml="$fork_dir/Cargo.toml" - [ -f "$toml" ] || continue + [ -f "$toml" ] || { FORK_STATUS[$fork_name]="SKIP"; FORK_DETAIL[$fork_name]="no Cargo.toml (not a tracked fork)"; continue; } version=$(grep -E '^version\s*=' "$toml" | head -1 | sed -E 's/.*"([^"]+)".*/\1/') || true if [ -z "$version" ]; then @@ -88,6 +91,8 @@ for fork_dir in local/sources/*/; do # before content-check can be re-enabled. The build runs anyway with # an explicit warning printed to stderr. if [ "$fork_mode" = "diverged" ]; then + FORK_STATUS[$fork_name]="DIVERGED" + FORK_DETAIL[$fork_name]="mode=diverged; content check skipped" echo "WARN: $fork_name is in 'diverged' mode — content check skipped." >&2 echo " Fork has substantial post-fork work; run upgrade-forks.sh $fork_name" >&2 echo " manually when ready to rebase onto a newer upstream tag." >&2 @@ -99,6 +104,8 @@ for fork_dir in local/sources/*/; do fi if [ "$upstream_tag" = "PENDING_REBASE" ]; then + FORK_STATUS[$fork_name]="PENDING_REBASE" + FORK_DETAIL[$fork_name]="needs manual rebase" echo "ERROR: $fork_name is marked as PENDING_REBASE in $MAP_FILE." >&2 echo " A real rebase onto a chosen upstream tag is required." >&2 violations=$((violations + 1)) @@ -126,6 +133,8 @@ for fork_dir in local/sources/*/; do # Fetch the upstream tag's tree hash upstream_hash=$(cd /tmp && git ls-remote --tags "$upstream_url" "refs/tags/$upstream_tag" 2>/dev/null | awk '{print $1}' | head -1) if [ -z "$upstream_hash" ]; then + FORK_STATUS[$fork_name]="NO_UPSTREAM_TAG" + FORK_DETAIL[$fork_name]="tag $upstream_tag not found at $upstream_url" echo "WARN: $fork_name: couldn't ls-remote $upstream_url tag $upstream_tag, skipping content check" >&2 continue fi @@ -272,8 +281,29 @@ for fork_dir in local/sources/*/; do # re-clone upstream. Stored under .redbear-fork-verify/-. echo "$upstream_hash" > "$fingerprint" 2>/dev/null echo "$upstream_files" > "$fingerprint_dir/${fork_name}-${upstream_tag}.files" 2>/dev/null + + # Fork passed content check — record status for post-loop summary + FORK_STATUS[$fork_name]="PASS" + FORK_DETAIL[$fork_name]="content matches upstream $upstream_tag" done +# Post-loop summary (Phase 13.1): enumerate each fork's verification status. +# Return to script root (the per-fork content check does cd into each fork dir). +cd "$ROOT" + +echo "" +echo "=== Post-verification fork status ===" +printf " %-12s %-18s %s\n" "fork" "status" "detail" +printf " %-12s %-18s %s\n" "----------" "----------------" "------" +for fork_dir in local/sources/*/; do + [ -d "$fork_dir" ] || continue + fork_name=$(basename "$fork_dir") + status="${FORK_STATUS[$fork_name]:-UNKNOWN}" + detail="${FORK_DETAIL[$fork_name]:-not checked}" + printf " %-12s %-18s %s\n" "$fork_name" "$status" "$detail" +done +echo "" + if [ "$violations" -gt 0 ]; then echo "" >&2 echo "FAIL: $violations fork version violations found." >&2