aboutsummaryrefslogtreecommitdiffstats
path: root/tests
AgeCommit message (Collapse)AuthorFilesLines
39 hoursfeat: _detect_nvchecker_source maps forge+registry hostsDanilo M.1-0/+41
39 hoursfeat: _registry_name_from_url helper for nvchecker autodetectDanilo M.1-0/+24
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
3 daysfeat: suppress continuation-URL prompt for manifest-listed pkgs; release v1.2.4v1.2.4Danilo M.1-4/+33
On a primary version bump of a manifest-listed package, mkhint used to prompt interactively for each extra DOWNLOAD (continuation) URL, then Phase 2 (reconcile_bundle_deps) rewrote those same lines from the upstream manifest — a pointless double-touch (13 prompts for neovim). update_hint_file now detects a listed package and threads a skip_cont flag through update_checksums -> _process_download_var, which leaves the continuation URLs for the manifest reconcile and prints a short notice instead of prompting. Non-listed packages prompt exactly as before. Also fixes a set -e abort: the manifest-lookup guard was written as `pkg_has_manifest ... && _skip_cont=1`, whose false result (non-listed package) killed the run right after the backup. Rewritten as an if. This would have broken every non-listed --hintfile -V update. Verified live on a non-listed multiline package (exploitdb). Tests: T-BM18 now asserts the listed-pkg suppression, T-BM25 guards against over-suppression (non-listed still prompts); the read -p prompt is invisible under piped stdin, so both assert on the always-echoed "line N (current)" header. 184 passed. Also defers the multi-file split TODO with a rationale and revisit triggers (extract only the bundled-dep block when the time comes). Bump MKHINT_VERSION and man title to 1.2.4, rebuild mkhint.1.gz. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
3 daysfix: skip bundled-dep apply prompt when nothing changed; release v1.2.3v1.2.3Danilo M.1-0/+21
After the version-aware reconcile, a --force run on an up-to-date bundle package still asked "Apply bundled-dep updates?" with nothing to apply. reconcile_bundle_deps report mode now signals whether there is anything to apply via its exit code: 2 = changes present, 0 = all current / no deps / fetch fail. The --check and --hintfile -V callers prompt only on exit 2. apply mode still returns 0. Adds T-BM24 (all-current → no prompt); 183 passed. Bump MKHINT_VERSION and man title to 1.2.3, rebuild mkhint.1.gz. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
3 daysfix: complete version-aware reconcile against real URL shapes; release v1.2.2v1.2.2Danilo M.1-0/+39
1.2.1 made the bundled-dep reconcile version-aware but _url_version mis-parsed several real-world URL shapes, so 1.2.1 was never correct in the field (found by running mkhint -C --force neovim against the live 0.12.4 hint). _url_version now derives the version by stripping the URL's own github repo name from the basename: - dep names containing digits/dashes (lua-compat-5.3) parse correctly instead of splitting the name as a version - a bare-tag basename with no name prefix is taken as the whole version, fixing package-rev suffixes (luv 1.52.1-0 was truncated to 0) - non-github and the shared neovim/deps blob host fall back to the trailing-version/sha heuristic _url_repo is lowercased so JuliaStrings/utf8proc matches juliastrings/utf8proc (github repos are case-insensitive); utf8proc had reported no-match and appeared in the manifest-only FYI. Verified against all 13 live neovim 0.12.4 bundled deps: all match and report current, no false change, a real bump still detected. Adds T-BM22 (one case per URL-shape class) and T-BM23 (case-insensitive repo match); T-BM17 unchanged. 182 passed. Bump MKHINT_VERSION and man title to 1.2.2, rebuild mkhint.1.gz. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
3 daysfix: version-aware bundled-dep reconcile; release v1.2.1v1.2.1Danilo M.1-0/+31
reconcile_bundle_deps flagged a dep as changed on raw URL-string inequality. Manifests serve bare-tag archive URLs (.../archive/v0.26.7.tar.gz) while hints use the SBo-fetched tree shape (.../archive/v0.26.7/tree-sitter-0.26.7.tar.gz) — same version, different path — so every dep was reported changed at a version that had not moved. Add _url_version to parse and normalize the version from a URL basename, and detect change by version rather than URL string. Only rewrite a line when the version actually differs. Change report now shows "name old-ver -> new-ver". Regression test T-BM17 pins the same-version, different-shape case as no change (180 passed). Bump MKHINT_VERSION and man title to 1.2.1, rebuild mkhint.1.gz. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
3 daysfix: reconcile backup, versioned change report, no double reportv1.2.0Danilo M.1-0/+53
Review findings before v1.2.0 deploy: - apply mode now writes a .bak before mutating (parity with every other mutator; the --force recovery path had no rollback) - the changed-deps report shows old->new basenames so bumps are visible, not the version-stripped 'dep -> dep' - apply mode no longer re-prints the report (report/apply split) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
3 daysfeat: --hintfile -V reconciles bundled deps for listed packagesDanilo M.1-0/+30
Parity with --check: the update path runs Phase 2 (report + apply) after the primary bump. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
3 daysfix: primary manifest entry no longer flagged as missing in reconcile FYIDanilo M.1-0/+5
The bundled-dep FYI iterated all manifest URLs but only extra (index>=1) hint URLs were tracked as matched, so the manifest's primary entry was always reported as 'not in hint'. Seed the primary's manifest match (without reconciling index 0) so the FYI is accurate. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
3 daysfeat: --check Phase 2 reconciles bundled deps for listed packagesDanilo M.1-0/+85
Runs after the primary bump; auto when the primary changed this run, otherwise only with --force. Report then per-package apply confirm. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
3 daysfeat: add --force flag (check-only, mutually exclusive elsewhere)Danilo M.1-0/+16
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
3 daysfeat: --new prints a manifest reconcile report for listed packagesDanilo M.1-0/+47
Report-only at creation time; the .info version is kept, upstream disagreement is flagged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
3 daysfeat: reconcile_bundle_deps core (report/apply)Danilo M.1-0/+42
Match each extra DOWNLOAD line to the manifest, rewrite changed lines and recompute their md5 in apply mode, report only in report mode, and print the manifest-only-deps FYI. Primary line untouched. Also guard the main "$@" call at the bottom of mkhint behind a BASH_SOURCE check so tests can source the whole script (needed to reach parse_multiline_var/build_multiline_value/download_file alongside the new function) without triggering the no-args CLI path, which previously called exit 1. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
3 daysfeat: fetch_manifest + fake-wget manifest fixture supportDanilo M.1-8/+29
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
3 daysfeat: load_bundle_manifests + manifest_url_forDanilo M.1-0/+20
Parse the pkg->url-template config and substitute {VERSION}. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
3 daysfeat: match_dep_url maps a hint download line to a manifest URLDanilo M.1-0/+38
Repo-path match first, exact basename-stem fallback for blob hosts. Blob host repo (owner/deps) is excluded from repo-path matching so it resolves by stem. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
3 daysfeat: parse_manifest reads NAME_URL entries from a deps manifestDanilo M.1-0/+16
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
3 daysfeat: add BUNDLE_MANIFEST_FILE config varDanilo M.1-0/+1
Opt-in per-package manifest for bundled-dep reconciliation. No behavior yet; wires the config default and the test-harness path patch. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
4 daysfix: bump dash-form dated URLs on version changev1.1.3Danilo M.1-0/+43
--hintfile -V and --new -V only substituted the packaged underscore form of the old version, so download URLs using the upstream dash form (dates like 2026-07-07, tags) kept pointing at the old tarball and their md5 went stale. Now both the underscore and dash variants of old->new are rewritten. exploitdb was the trigger case. Tests T74 (--hintfile) and T75 (--new) cover the dashed-URL bump. Release v1.1.3. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
5 daysfeat: compact --help, move reference to man pageDanilo M.1-0/+11
Trim show_help to a usage synopsis, the options list, the runtime paths, and a 'man mkhint' pointer. The usage examples, variable-order note, and exit-code table now live in the man page. Add T73 asserting --help exits 0 and points at the man page. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
5 daystest: config file overrides PACKAGES_DIRDanilo M.1-0/+25
5 daysfeat: slackrepo build for new packages, update for existingDanilo M.1-0/+88
5 daystest: harness support for slackrepo stub and PACKAGES_DIRDanilo M.1-0/+23
6 daysfeat!: -v/--version prints tool version; hint version moves to -V/--set-versionDanilo M.1-9/+38
BREAKING CHANGE: the hint-version flag is now -V/--set-version. -v/--version now prints the tool's own version and exits. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
6 daysfeat: -l colors newer version cell green, adds DelReq columnDanilo M.1-1/+91
Equal versions keep the yellow row (and MATCHED_PKGS for -R). When versions differ, sort -V picks the newer side and only that cell is green. New DelReq column (before Created) shows a check when the hint has a populated DELREQUIRES. Tests T60-T64 added. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
7 daysfeat: -l <pkg...> shows side-by-side hint vs .infoDanilo M.1-0/+25
With package names, --list skips the table and shows each named hint diffed against its .info (git diff --no-index, else diff -y), missing hint exits 2. Diff display extracted to _show_hint_diff, shared with --review. Bash completion completes hint names after -l. Adds T58, T59. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
7 daysfeat: -l skips versionless hints, widen version columnsDanilo M.1-0/+24
--list now skips hint files with no VERSION (e.g. pure DELREQUIRES hints) and excludes them from the total. Version columns widened 10->22 to fit long version strings without shifting other rows. Adds T57. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
7 daysAdd phantom-dep stripping for slackware-currentDanilo M.1-0/+123
SBo SlackBuilds target stable; some build deps (rust-opt, google-go-lang) are unneeded on -current. Auto-add DELREQUIRES for these instead of writing a hintfile per dependent by hand. - Read the phantom-dep list from ~/.config/mkhint/phantom-deps (one per line, # comments; missing file = no-op). - --fix-current / -F: sweep the repo, ensure every package whose REQUIRES contains a phantom dep carries the matching DELREQUIRES. Create a minimal hint if absent, back up and merge into an existing hint otherwise. Idempotent, no prompts, mutually exclusive with -v/-f/-n. - --new: auto-append DELREQUIRES for phantom deps found in the .info. - Tests T50-T56; docs and bash-completion updated. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
7 daysfeat: treat dashed upstream version as equivalent to packaged underscore formDanilo M.1-0/+38
SlackBuild versions cannot contain '-' (it breaks PRGNAM parsing), so an upstream date like 2026-06-02 is packaged as 2026_06_02. mkhint was comparing them byte-for-byte and offering a spurious upgrade/downgrade. Add _normalize_version ('-' -> '_') and apply it to the upstream version in --check and --hintfile (no -v) before comparing and before storing, so equivalent versions compare equal and accepted updates are written in the underscore form. nvtake still uses nvchecker's raw keyfile value. Tests T48/T49 cover equivalence and normalized storage (105 passing). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
14 daystest: cover -R <pkg...> named-hint review (T44-T47)Danilo M.1-0/+66
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19perf: scan single nvchecker entry with -e for single-package checksDanilo M.1-2/+35
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>
2026-06-19feat: add -R/--review loop with side-by-side diff and keep/delete promptDanilo M.1-0/+63
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19feat: highlight hint rows whose version matches SBo .info in -lDanilo M.1-0/+31
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13fix: resolve relative nvchecker keyfile path against config dirDanilo M.1-0/+26
nvchecker resolves a relative oldver/newver/keyfile path against the config file's directory, not the CWD. _nvchecker_newver_path returned the raw relative string (e.g. "new_ver.json"), so nvchecker_latest's [[ -f ]] check ran against whatever CWD 'mkhint -C' was launched from — almost never the config dir. Result: every package reported 'no nvchecker result' and the run said 'all up to date' despite nvchecker having found updates. Resolve non-absolute keyfile paths against dirname(NVCHECKER_CONFIG). T35 covers a relative newver path with the keyfile beside the config. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13fix: quote nvchecker section names containing non-bare-key charsDanilo M.1-0/+56
Section names with '.', '-', etc. must be TOML-quoted (e.g. ["yt-dlp"]), otherwise nvchecker fails to parse them. add_nvchecker_section wrote bare [pkg] headers, so such names had to be hand-quoted. Worse, _has_nvchecker_section only matched the bare form, so already-present quoted sections were reported as missing and re-flagged for populate on every 'mkhint -C' run. Add _nvchecker_label helper as the single source of truth for the written label (bare iff name matches ^[A-Za-z0-9_]+$, else double-quoted), used by both the write side (3 section headers + messages) and the read side (_has_nvchecker_section grep, with regex metachars escaped so '.' is literal). Tests T32-T34 cover quoted-header write, no-duplicate on re---new, and --check recognizing an existing quoted section. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13test: add T29-T31 for --check populate missing sectionsDanilo M.1-0/+77
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13test: add T27 (downgrade flag) and T28 (--check scan-all)Danilo M.1-0/+41
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13test: add nvchecker config patch and mock tools to harnessDanilo M.1-0/+211
- Patch NVCHECKER_CONFIG in run_mkhint() sed block - Add nvchecker.toml + new_ver.json/old_ver.json fixtures in setup() - Add github (ghpkg) and pypi (pypkg) .info fixtures - Add mock_nvchecker_tools() with no-op nvchecker and logging nvtake - Call mock_nvchecker_tools after mock_wget Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-18feat: multiline DOWNLOAD support, test suite, updated docsDanilo M.1-0/+347
- Add parse_multiline_var, prompt_continuation_urls, build_multiline_value, _process_download_var; refactor update_checksums to handle multi-URL vars - First URL always re-downloaded; continuation URLs prompt user, skip re-download if unchanged - Add tests/mkhint_test.sh: 44 cases covering all commands and edge cases - Update README and CLAUDE.md: correct -N semantics, --new behavior, multiline DOWNLOAD flow, test suite docs