aboutsummaryrefslogtreecommitdiffstats
path: root/mkhint
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-07-09 20:25:24 +0200
committerDanilo M. <danix@danix.xyz>2026-07-09 20:25:24 +0200
commit2b421d007e58830036c939494f421fc5c0376aa4 (patch)
treec64a922fb70b30fda6136a4067f0cd25b14d9b18 /mkhint
parenta89e6799a4473ff2d182e1d3268222a9f54cea58 (diff)
downloadmkhintfile-2b421d007e58830036c939494f421fc5c0376aa4.tar.gz
mkhintfile-2b421d007e58830036c939494f421fc5c0376aa4.zip
feat: wire sha reconcile + inventory into --check/--force
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'mkhint')
-rwxr-xr-xmkhint22
1 files changed, 19 insertions, 3 deletions
diff --git a/mkhint b/mkhint
index 7921501..52d3804 100755
--- a/mkhint
+++ b/mkhint
@@ -969,7 +969,10 @@ create_new_hint_file() {
_bm_pkg="${_bm_pkg##*/}"
if pkg_has_manifest "$_bm_pkg"; then
local _bm_ver; _bm_ver=$(grep '^VERSION=' "$normalized_file" | sed 's/VERSION="//;s/"$//')
- local _bm_url; _bm_url=$(manifest_url_for "$_bm_pkg" "$_bm_ver")
+ local _bm_url=""
+ if [[ "$(bundle_mode "$_bm_pkg")" == "url" ]]; then
+ _bm_url=$(manifest_url_for "$_bm_pkg" "$_bm_ver") || _bm_url=""
+ fi
echo ""
echo "$_bm_pkg: bundled-dep manifest check"
reconcile_bundle_deps "$_bm_pkg" "$normalized_file" "$_bm_url" report || true
@@ -1618,6 +1621,7 @@ clean_bak_files() {
# Usage: check_updates [pkg...] (no args = all *.hint in HINT_DIR)
check_updates() {
check_nvchecker
+ local -A prev_version=() # pkg -> version before this run's bump (Job B)
if [[ ! -d "$HINT_DIR" ]]; then
echo "Error: Hint directory does not exist: $HINT_DIR" >&2
@@ -1673,6 +1677,7 @@ check_updates() {
outdated_old+=("$current")
outdated_new+=("$latest_norm")
outdated_flag+=("$flag")
+ prev_version["$pkg"]="$current" # pre-bump version for Job B
done
# Offer to populate nvchecker.toml for packages with no section
@@ -1752,7 +1757,10 @@ check_updates() {
continue
fi
local cur; cur=$(grep '^VERSION=' "$hintpath" | sed 's/VERSION="//;s/"$//')
- local murl; murl=$(manifest_url_for "$pkg" "$cur") || continue
+ local murl=""
+ if [[ "$(bundle_mode "$pkg")" == "url" ]]; then
+ murl=$(manifest_url_for "$pkg" "$cur") || continue
+ fi
echo ""
echo "Bundled-dep reconcile: $pkg (manifest @ $cur)"
local rc=0
@@ -1767,6 +1775,11 @@ check_updates() {
reconcile_bundle_deps "$pkg" "$hintpath" "$murl" apply || true
fi
fi
+ # Job B: submodule inventory / set-drift roster (sha-mode only).
+ if [[ "$(bundle_mode "$pkg")" == "sha" ]]; then
+ local _old_ver="${prev_version[$pkg]:-$cur}" _new_ver="$cur"
+ detect_set_drift "$pkg" "$_old_ver" "$_new_ver" || true
+ fi
done
}
@@ -1961,7 +1974,10 @@ main() {
if pkg_has_manifest "$_bm_pkg"; then
local _bm_hint="${HINT_DIR%/}/${_bm_pkg}.hint"
local _bm_cur; _bm_cur=$(grep '^VERSION=' "$_bm_hint" | sed 's/VERSION="//;s/"$//')
- local _bm_url; _bm_url=$(manifest_url_for "$_bm_pkg" "$_bm_cur")
+ local _bm_url=""
+ if [[ "$(bundle_mode "$_bm_pkg")" == "url" ]]; then
+ _bm_url=$(manifest_url_for "$_bm_pkg" "$_bm_cur") || _bm_url=""
+ fi
echo ""
echo "Bundled-dep reconcile: $_bm_pkg (manifest @ $_bm_cur)"
local _bm_rc=0