From 1ec3a154e045c2b39d57589530156c3d61902c79 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Thu, 9 Jul 2026 19:14:21 +0200 Subject: refactor: split reconcile into url/sha dispatch, url logic unchanged Co-Authored-By: Claude Opus 4.8 --- mkhint | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'mkhint') diff --git a/mkhint b/mkhint index 5f22c2d..6e9d15c 100755 --- a/mkhint +++ b/mkhint @@ -584,14 +584,29 @@ fetch_manifest() { printf '%s\n' "$out" } -# reconcile_bundle_deps +# reconcile_bundle_deps +# Dispatch on the package's configured bundle mode. url-mode uses the manifest +# URL argument (as before); sha-mode ignores it and reads BUNDLE_REST. Keeps the +# three existing call sites unchanged. Returns whatever the mode handler returns. +reconcile_bundle_deps() { + local pkg="$1" + case "${BUNDLE_MODE[$pkg]:-url}" in + sha) reconcile_bundle_deps_sha "$@" ;; + *) reconcile_bundle_deps_url "$@" ;; + esac +} + +# TEMPORARY stub for sha-mode; real body arrives in a later task. +reconcile_bundle_deps_sha() { echo " $1: sha-mode not yet implemented"; return 0; } + +# reconcile_bundle_deps_url # mode = report (print only) | apply (rewrite matched changed lines + md5). # Reconciles the DOWNLOAD line's extra URLs (index >= 1) against the manifest. # The primary URL (index 0) is never touched here. Guarded for set -e. # In report mode: returns 2 when there are changes to apply, 0 otherwise (all # current, no deps, fetch/parse fail) so a caller can skip the apply prompt. # apply mode always returns 0. -reconcile_bundle_deps() { +reconcile_bundle_deps_url() { local pkg="$1" hint="$2" murl="$3" mode="$4" # Display label for a dep URL: _url_stem is basename-only, so for a github -- cgit v1.2.3