aboutsummaryrefslogtreecommitdiffstats
path: root/mkhint
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-07-07 19:13:58 +0200
committerDanilo M. <danix@danix.xyz>2026-07-07 19:13:58 +0200
commit3444391f3142771db9ef0218250545f32c202c8c (patch)
tree11c81ccc611221ff2dc3f4e13c01f81c62ae90d5 /mkhint
parent2841638a0146982322b53db7c305bdeb84456249 (diff)
downloadmkhintfile-3444391f3142771db9ef0218250545f32c202c8c.tar.gz
mkhintfile-3444391f3142771db9ef0218250545f32c202c8c.zip
feat: --check Phase 2 reconciles bundled deps for listed packages
Runs after the primary bump; auto when the primary changed this run, otherwise only with --force. Report then per-package apply confirm. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'mkhint')
-rwxr-xr-xmkhint93
1 files changed, 59 insertions, 34 deletions
diff --git a/mkhint b/mkhint
index 990eeb3..48a11af 100755
--- a/mkhint
+++ b/mkhint
@@ -1202,46 +1202,71 @@ check_updates() {
fi
fi
+ local updated=()
if [[ ${#outdated_pkgs[@]} -eq 0 ]]; then
echo "all up to date"
- return 0
- fi
+ else
+ # Report
+ echo ""
+ echo "Updates available:"
+ local i
+ for (( i=0; i<${#outdated_pkgs[@]}; i++ )); do
+ local note=""; [[ "${outdated_flag[$i]}" == "?downgrade" ]] && note=" (?downgrade)"
+ printf " %-30s %s -> %s%s\n" "${outdated_pkgs[$i]}" "${outdated_old[$i]}" "${outdated_new[$i]}" "$note"
+ done
+ echo ""
- # Report
- echo ""
- echo "Updates available:"
- local i
- for (( i=0; i<${#outdated_pkgs[@]}; i++ )); do
- local note=""; [[ "${outdated_flag[$i]}" == "?downgrade" ]] && note=" (?downgrade)"
- printf " %-30s %s -> %s%s\n" "${outdated_pkgs[$i]}" "${outdated_old[$i]}" "${outdated_new[$i]}" "$note"
- done
- echo ""
+ # Per-package confirm + update
+ for (( i=0; i<${#outdated_pkgs[@]}; i++ )); do
+ local p="${outdated_pkgs[$i]}"
+ local note=""; [[ "${outdated_flag[$i]}" == "?downgrade" ]] && note=" (?downgrade)"
+ local answer
+ read -r -p "${p} ${outdated_old[$i]} -> ${outdated_new[$i]}${note}. Update? [Y/n] " answer
+ answer="${answer:-Y}"
+ if [[ "$answer" =~ ^[Yy]$ ]]; then
+ update_hint_file "$p" "${outdated_new[$i]}"
+ nvtake -c "$NVCHECKER_CONFIG" "$p" >&2 || true
+ updated+=("$p")
+ fi
+ done
- # Per-package confirm + update
- local updated=()
- for (( i=0; i<${#outdated_pkgs[@]}; i++ )); do
- local p="${outdated_pkgs[$i]}"
- local note=""; [[ "${outdated_flag[$i]}" == "?downgrade" ]] && note=" (?downgrade)"
- local answer
- read -r -p "${p} ${outdated_old[$i]} -> ${outdated_new[$i]}${note}. Update? [Y/n] " answer
- answer="${answer:-Y}"
- if [[ "$answer" =~ ^[Yy]$ ]]; then
- update_hint_file "$p" "${outdated_new[$i]}"
- nvtake -c "$NVCHECKER_CONFIG" "$p" >&2 || true
- updated+=("$p")
+ # Split updated packages: existing → update, new → build.
+ if [[ ${#updated[@]} -gt 0 ]]; then
+ local -a existing=() fresh=()
+ local up
+ for up in "${updated[@]}"; do
+ if pkg_in_repo "$up"; then existing+=("$up"); else fresh+=("$up"); fi
+ done
+ run_slackrepo update "${existing[@]}"
+ run_slackrepo build "${fresh[@]}"
fi
- done
-
- # Split updated packages: existing → update, new → build.
- if [[ ${#updated[@]} -gt 0 ]]; then
- local -a existing=() fresh=()
- local up
- for up in "${updated[@]}"; do
- if pkg_in_repo "$up"; then existing+=("$up"); else fresh+=("$up"); fi
- done
- run_slackrepo update "${existing[@]}"
- run_slackrepo build "${fresh[@]}"
fi
+
+ # Phase 2: bundled-dep manifest reconcile for listed packages.
+ load_bundle_manifests
+ local was_updated
+ for pkg in "${targets[@]}"; do
+ pkg_has_manifest "$pkg" || continue
+ local hintpath="${HINT_DIR%/}/${pkg}.hint"
+ [[ -f "$hintpath" ]] || continue
+ was_updated=0
+ local u
+ for u in "${updated[@]}"; do [[ "$u" == "$pkg" ]] && was_updated=1; done
+ if [[ $was_updated -eq 0 && $FORCE -ne 1 ]]; then
+ continue
+ fi
+ local cur; cur=$(grep '^VERSION=' "$hintpath" | sed 's/VERSION="//;s/"$//')
+ local murl; murl=$(manifest_url_for "$pkg" "$cur") || continue
+ echo ""
+ echo "Bundled-dep reconcile: $pkg (manifest @ $cur)"
+ reconcile_bundle_deps "$pkg" "$hintpath" "$murl" report || true
+ local ans
+ read -r -p "Apply bundled-dep updates for $pkg? [Y/n] " ans
+ ans="${ans:-Y}"
+ if [[ "$ans" =~ ^[Yy]$ ]]; then
+ reconcile_bundle_deps "$pkg" "$hintpath" "$murl" apply || true
+ fi
+ done
}
# Main function