From 41c7bf5f14dab7f763c4c5498c0bfec8312a2ac8 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 10 Jul 2026 11:52:00 +0200 Subject: fix: defer nvtake to slackrepo confirm nvchecker's oldver is now synced (nvtake) only when the slackrepo prompt is confirmed, per package, just before slackrepo runs. Moved out of the hint-rewrite step in --check and the version-accept step in --hintfile (both now route through run_slackrepo). Confirming slackrepo acknowledges the versions; a stopped/failed slackrepo can be rerun without nvchecker re-reporting already-committed versions. Fixes the stuck state where interrupting a run between hint-rewrite and slackrepo left oldver behind the hint, so nvchecker logged a phantom 'updated' line every subsequent --check. Tests T20/T23 answer Y to slackrepo so nvtake fires. Dead check_nvchecker_take flag removed. Co-Authored-By: Claude Opus 4.8 --- mkhint | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'mkhint') diff --git a/mkhint b/mkhint index e463dde..62bbbf8 100755 --- a/mkhint +++ b/mkhint @@ -1553,6 +1553,11 @@ run_slackrepo() { read -r -p "Run 'slackrepo $action $*'? [Y/n] " answer answer="${answer:-Y}" if [[ "$answer" =~ ^[Yy]$ ]]; then + # nvtake on confirm, before slackrepo runs: saying yes acknowledges the + # new versions. If slackrepo is then stopped or fails, just rerun it — + # nvchecker won't nag about versions already committed to the hints. + local p + for p in "$@"; do nvtake -c "$NVCHECKER_CONFIG" "$p" >&2 || true; done slackrepo "$action" "$@" fi } @@ -1726,7 +1731,6 @@ check_updates() { 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 @@ -1961,12 +1965,8 @@ main() { if [[ -z "$VERSION" ]]; then check_nvchecker VERSION=$(suggest_version "$HINT_FILE") || { echo "Aborted." >&2; exit 0; } - check_nvchecker_take=1 fi update_hint_file "$HINT_FILE" "$VERSION" - if [[ "${check_nvchecker_take:-0}" -eq 1 ]]; then - nvtake -c "$NVCHECKER_CONFIG" "$HINT_FILE" >&2 || true - fi load_bundle_manifests local _bm_pkg="${HINT_FILE%.hint}" -- cgit v1.2.3