diff options
| author | Danilo M. <danix@danix.xyz> | 2026-06-13 17:31:51 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-06-13 17:31:51 +0200 |
| commit | 545d6f70bfd01d7397d661d3c3b1ae73efa3c431 (patch) | |
| tree | a872639582ace2dc860c4d270fbc1c292ffcc6c3 /CLAUDE.md | |
| parent | d0bbdb431e34521f30508dc98d8f8b141baafd3b (diff) | |
| download | mkhintfile-545d6f70bfd01d7397d661d3c3b1ae73efa3c431.tar.gz mkhintfile-545d6f70bfd01d7397d661d3c3b1ae73efa3c431.zip | |
docs: document nvchecker integration and --check command
- Add Dependencies section covering wget, nvchecker/nvtake, and jq
- Document nvchecker config at ~/.config/nvchecker/nvchecker.toml
- Add usage examples for all three new features:
* --new appends nvchecker [section] auto-detecting source type
* --hintfile without -v queries nvchecker for latest version
* --check/-C runs comprehensive update checks across all hints
- Update Exit Code 4 description to list all required tools
- Add test coverage rows T16-T26 for nvchecker integration tests
- Add Key Behaviors bullets for nvchecker-specific features
- Update bash completion note to include --check/-C
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'CLAUDE.md')
| -rw-r--r-- | CLAUDE.md | 28 |
1 files changed, 26 insertions, 2 deletions
@@ -17,6 +17,14 @@ HINT_DIR="/etc/slackrepo/SBo-danix/hintfiles/" # where .hint files live Bash completion script has its own hardcoded copies (lines 8–9) — keep in sync when changing defaults. +nvchecker config path is read from `$HOME/.config/nvchecker/nvchecker.toml` (not hardcoded): + +```bash +NVCHECKER_CONFIG="$HOME/.config/nvchecker/nvchecker.toml" +``` + +User must set up the `[__config__]` section once before version-checking features work. Bash completion now also knows `--check`/`-C`. + ## Running / Testing No build step. Direct execution: @@ -31,6 +39,9 @@ bash mkhint --version 2.0.1 --hintfile mypackage --no-dl # downloads + md5 + N bash mkhint --new mypackage --no-dl # create hint with NODOWNLOAD=yes bash mkhint --delete mypackage bash mkhint --clean +bash mkhint --hintfile mypackage # suggest latest version via nvchecker (no -v) +bash mkhint --check # check all hints for upstream updates +bash mkhint --check pkg1 pkg2 # check specific packages ``` ### Automated test suite @@ -60,14 +71,27 @@ Test coverage: | T13 | `--new` multiline `.info`, no version — template copied, original md5s kept | | T14 | `--new` multiline `.info` with `-v` — first URL+md5 updated, continuation md5 kept | | T15 | `--clean` — removes all .bak files | +| T16 | `--new` github .info — [pkg] source=github appended to nvchecker config | +| T17 | `--new` pypi .info — [pkg] source=pypi appended to nvchecker config | +| T18 | `--new` unrecognised URL — commented stub [pkg] appended to nvchecker config | +| T19 | `--new` when [pkg] exists in config — not duplicated | +| T20 | `--hintfile` no -v, accept suggestion — VERSION=latest, nvtake called | +| T21 | `--hintfile` no -v, type override — VERSION=typed value | +| T22 | `--hintfile` no -v, no nvchecker result — graceful abort, hint unchanged | +| T23 | `--check` one outdated, confirm — updated, nvtake, slackrepo prompted | +| T24 | `--check` all current — "all up to date", no slackrepo | +| T25 | `--check` mixed — decline one / accept one | +| T26 | `--check` with -v — mutually-exclusive error, exit 1 | When adding new features, add a corresponding test case to `tests/mkhint_test.sh`. ## Key Behaviors - `--hintfile` update: backs up to `.bak`, replaces old version string globally via `sed`, re-downloads both URLs to recalculate MD5 checksums. Skips download if value is `UNSUPPORTED` or `UNTESTED`. -- `--new` with existing `.info`: copies `.info` as template, strips `PRGNAM`, `HOMEPAGE`, `MAINTAINER`, `EMAIL`, comments out `REQUIRES`, sets `ARCH="x86_64"`. Keeps `VERSION` from `.info`. If `-v` given, updates version string and recalculates checksums. +- `--new` with existing `.info`: copies `.info` as template, strips `PRGNAM`, `HOMEPAGE`, `MAINTAINER`, `EMAIL`, comments out `REQUIRES`, sets `ARCH="x86_64"`. Keeps `VERSION` from `.info`. If `-v` given, updates version string and recalculates checksums. Also appends an nvchecker `[section]` to the config, auto-detecting github/pypi source or providing a commented stub. - `--new` when hint already exists: backs up old, creates empty skeleton. +- `--hintfile` with no `-v`: queries nvchecker for latest version, shows current vs. latest, prompts to accept/override/decline. After accepting, runs `nvtake` to sync nvchecker's keyfile. +- `--check` / `-C`: runs nvchecker for all (or named) hints, reports outdated packages with current → latest versions, prompts per-package to update, applies updates with `nvtake`, then prompts single `slackrepo update` for all updated packages. - `--no-dl` / `-N`: downloads and recalculates checksums as normal, then appends `NODOWNLOAD=yes` after `MD5SUM_x86_64=`. Works with `--hintfile` or `--new`. Error if used alone. - `--delete` / `-d`: removes hint file and `.bak` if present. Accepts multiple package names. Exits 2 on first missing file. - Downloads go to `/tmp/mkhint/download` (single shared temp file, deleted after md5 calculation). @@ -81,7 +105,7 @@ When adding new features, add a corresponding test case to `tests/mkhint_test.sh | 1 | Invalid arguments | | 2 | File not found | | 3 | File already exists (unused — backup logic replaces this) | -| 4 | wget not available | +| 4 | Required tool not available (wget/nvchecker/nvtake/jq) | ## Installation |
