aboutsummaryrefslogtreecommitdiffstats
path: root/mkhint
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-07-09 10:26:38 +0200
committerDanilo M. <danix@danix.xyz>2026-07-09 10:26:38 +0200
commit3615b979a1dd6e379c0be87e2be36af49905c609 (patch)
tree63786353c61821952a8296164513894bc0b26228 /mkhint
parentf2eba98dddee1e0da6acd46c8fbb1ee79fca6b70 (diff)
downloadmkhintfile-3615b979a1dd6e379c0be87e2be36af49905c609.tar.gz
mkhintfile-3615b979a1dd6e379c0be87e2be36af49905c609.zip
feat: _extract_nvchecker_section reads one config block
Diffstat (limited to 'mkhint')
-rwxr-xr-xmkhint13
1 files changed, 13 insertions, 0 deletions
diff --git a/mkhint b/mkhint
index 20b20a8..e8c4fab 100755
--- a/mkhint
+++ b/mkhint
@@ -817,6 +817,19 @@ _has_nvchecker_section() {
"$NVCHECKER_CONFIG"
}
+# Print the [pkg] section (header + body) from NVCHECKER_CONFIG: from the label
+# line until the next line starting with '[' or EOF. Empty if not found.
+_extract_nvchecker_section() {
+ local pkg="$1"
+ [[ -f "$NVCHECKER_CONFIG" ]] || return 0
+ local label; label=$(_nvchecker_label "$pkg")
+ awk -v lbl="$label" '
+ $0==lbl { grab=1; print; next }
+ grab && /^\[/ { exit }
+ grab { print }
+ ' "$NVCHECKER_CONFIG"
+}
+
# Extract a package name from a language-registry download URL.
# Args: <url> <prgnam-fallback>. Prints the parsed name, or the fallback
# (PRGNAM) when no host-specific pattern matches.