aboutsummaryrefslogtreecommitdiffstats
path: root/mkhint
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-07-10 11:52:00 +0200
committerDanilo M. <danix@danix.xyz>2026-07-10 11:52:00 +0200
commit41c7bf5f14dab7f763c4c5498c0bfec8312a2ac8 (patch)
treebde68f56333ec1754a3cccc8b7a2c31204474971 /mkhint
parentf60659bf44bf970af3dfc200135bc6b98413e16b (diff)
downloadmkhintfile-41c7bf5f14dab7f763c4c5498c0bfec8312a2ac8.tar.gz
mkhintfile-41c7bf5f14dab7f763c4c5498c0bfec8312a2ac8.zip
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 <noreply@anthropic.com>
Diffstat (limited to 'mkhint')
-rwxr-xr-xmkhint10
1 files changed, 5 insertions, 5 deletions
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}"