aboutsummaryrefslogtreecommitdiffstats
path: root/mkhint
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-06-19 10:26:22 +0200
committerDanilo M. <danix@danix.xyz>2026-06-19 10:26:22 +0200
commite9730f8eaed88cc742e6db34786b19bb712b5866 (patch)
tree82a0756ff1f6c131a5c68a9c04a9836c98f28115 /mkhint
parentf2f19227b14d5a342fdfb48f7d67914d947160a9 (diff)
downloadmkhintfile-master.tar.gz
mkhintfile-master.zip
perf: scan single nvchecker entry with -e for single-package checksHEADmaster
When --check is given exactly one package, and when --hintfile suggests a version without -v, run `nvchecker -e <pkg>` so only that entry is scanned instead of the whole nvchecker.toml. Two+ packages or no args still do one full scan, since nvchecker -e accepts only a single entry. Add T42/T43 (mock nvchecker now logs its args), and update CLAUDE.md and README.md (including the previously undocumented -R/--review and -l highlight). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'mkhint')
-rwxr-xr-xmkhint14
1 files changed, 10 insertions, 4 deletions
diff --git a/mkhint b/mkhint
index 8decc76..bca91bc 100755
--- a/mkhint
+++ b/mkhint
@@ -509,8 +509,9 @@ build_multiline_value() {
suggest_version() {
local pkg="$1"
- # Refresh nvchecker results (stderr only; keep stdout clean for the echo)
- nvchecker -c "$NVCHECKER_CONFIG" >&2 || true
+ # Refresh nvchecker results (stderr only; keep stdout clean for the echo).
+ # -e limits the run to this entry instead of scanning the whole config.
+ nvchecker -c "$NVCHECKER_CONFIG" -e "$pkg" >&2 || true
local latest
latest=$(nvchecker_latest "$pkg") || {
@@ -731,9 +732,14 @@ check_updates() {
done
fi
- # Refresh nvchecker results once for everything
+ # Refresh nvchecker results. With exactly one explicit target, -e limits
+ # the run to that entry; otherwise scan the whole config in one pass.
echo "Running nvchecker..."
- nvchecker -c "$NVCHECKER_CONFIG" >&2 || true
+ if [[ ${#targets[@]} -eq 1 && $# -gt 0 ]]; then
+ nvchecker -c "$NVCHECKER_CONFIG" -e "${targets[0]}" >&2 || true
+ else
+ nvchecker -c "$NVCHECKER_CONFIG" >&2 || true
+ fi
# Classify each target
local outdated_pkgs=() outdated_old=() outdated_new=() outdated_flag=()