aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-07-07 18:56:39 +0200
committerDanilo M. <danix@danix.xyz>2026-07-07 18:56:39 +0200
commita6bbb96d31fb1df707ba3eea182e68b2f1c35552 (patch)
treeb12e2f5eb9e9bd5885260cfe130a1ad1f53c205a
parent4dfd3d7bc3ffe48f9483b4c5667d1f0bbc0f1325 (diff)
downloadmkhintfile-a6bbb96d31fb1df707ba3eea182e68b2f1c35552.tar.gz
mkhintfile-a6bbb96d31fb1df707ba3eea182e68b2f1c35552.zip
feat: --new prints a manifest reconcile report for listed packages
Report-only at creation time; the .info version is kept, upstream disagreement is flagged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
-rwxr-xr-xmkhint12
-rwxr-xr-xtests/mkhint_test.sh47
2 files changed, 59 insertions, 0 deletions
diff --git a/mkhint b/mkhint
index d064a64..e8cbb00 100755
--- a/mkhint
+++ b/mkhint
@@ -686,6 +686,18 @@ create_new_hint_file() {
echo "generated $normalized_file from $(basename $info)."
echo "Check variables before using."
+
+ load_bundle_manifests
+ local _bm_pkg="${normalized_file%.hint}"
+ _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")
+ echo ""
+ echo "$_bm_pkg: bundled-dep manifest check"
+ reconcile_bundle_deps "$_bm_pkg" "$normalized_file" "$_bm_url" report || true
+ fi
+
add_nvchecker_section "${normalized_file%.hint}" "$info"
fi
else
diff --git a/tests/mkhint_test.sh b/tests/mkhint_test.sh
index f736de1..0d1553d 100755
--- a/tests/mkhint_test.sh
+++ b/tests/mkhint_test.sh
@@ -23,6 +23,7 @@ setup() {
"$MOCK_REPO/development/rustpkg" \
"$MOCK_REPO/development/mixedpkg" \
"$MOCK_REPO/system/datedpkg" \
+ "$MOCK_REPO/editors/bmnvim" \
"$MOCK_HINT" \
"$MOCK_TMP"
@@ -166,6 +167,22 @@ MAINTAINER="Test"
EMAIL="test@test.com"
EOF
+ # bundled-dep manifest fixture (T-BM10/11)
+ cat > "$MOCK_REPO/editors/bmnvim/bmnvim.info" << 'EOF'
+PRGNAM="bmnvim"
+VERSION="0.13.0"
+HOMEPAGE="https://neovim.io"
+DOWNLOAD="https://github.com/neovim/neovim/archive/v0.13.0/bmnvim-0.13.0.tar.gz \
+ https://github.com/tree-sitter/tree-sitter/archive/v0.26.7/tree-sitter-0.26.7.tar.gz"
+MD5SUM="aaa \
+ bbb"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES=""
+MAINTAINER="Test"
+EMAIL="test@test.com"
+EOF
+
# phantom-dep list consumed by --fix-current and --new
cat > "$MOCK_BASE/phantom-deps" << 'EOF'
# deps unneeded on -current
@@ -1594,6 +1611,36 @@ grep -q 'tree-sitter/archive/v0.26.8' "$MOCK_HINT/nvim.hint" \
|| { echo " FAIL: apply mode:"; cat "$MOCK_HINT/nvim.hint"; (( FAIL++ )); ERRORS+=("T-BM9"); }
rm -f "$MOCK_BASE/manifest_fixture"
+# ── T-BM10: --new listed pkg prints reconcile report, does NOT rewrite ───────
+echo ""
+echo "T-BM10: --new listed pkg → manifest report, hint not rewritten by manifest"
+cat > "$MOCK_BASE/bundle-manifests" << 'EOF'
+bmnvim https://example.com/bmnvim/v{VERSION}/deps.txt
+EOF
+cat > "$MOCK_BASE/manifest_fixture" << 'EOF'
+NVIM_URL https://github.com/neovim/neovim/archive/v0.13.0.tar.gz
+NVIM_SHA256 a
+TREESITTER_URL https://github.com/tree-sitter/tree-sitter/archive/v0.26.8.tar.gz
+TREESITTER_SHA256 b
+EOF
+rm -f "$MOCK_HINT/bmnvim.hint"
+out=$(run_mkhint -n bmnvim 2>&1)
+echo "$out" | grep -qi 'tree-sitter' \
+ && grep -q 'v0.26.7' "$MOCK_HINT/bmnvim.hint" \
+ && { echo " PASS: --new reported, kept .info dep version"; (( PASS++ )); } \
+ || { echo " FAIL: --new manifest report. out=$out"; (( FAIL++ )); ERRORS+=("T-BM10"); }
+
+# ── T-BM11: --new non-listed pkg runs no manifest code ───────────────────────
+echo ""
+echo "T-BM11: --new non-listed pkg → no manifest output"
+: > "$MOCK_BASE/bundle-manifests"
+rm -f "$MOCK_HINT/curl.hint"
+out=$(run_mkhint -n curl 2>&1)
+echo "$out" | grep -qi 'manifest' \
+ && { echo " FAIL: unexpected manifest output for curl"; (( FAIL++ )); ERRORS+=("T-BM11"); } \
+ || { echo " PASS: no manifest code for non-listed"; (( PASS++ )); }
+rm -f "$MOCK_BASE/manifest_fixture" "$MOCK_BASE/bundle-manifests"
+
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
teardown