From 545d6f70bfd01d7397d661d3c3b1ae73efa3c431 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Sat, 13 Jun 2026 17:31:51 +0200 Subject: 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 --- CLAUDE.md | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'CLAUDE.md') diff --git a/CLAUDE.md b/CLAUDE.md index e464d97..f6578bf 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -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 -- cgit v1.2.3 From 8c14667b6377e643bd1e6d630e9d12bccf6660d3 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Sat, 13 Jun 2026 17:58:44 +0200 Subject: docs: document --check populate-missing-sections prompt Co-Authored-By: Claude Opus 4.8 --- CLAUDE.md | 7 ++++++- README.md | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'CLAUDE.md') diff --git a/CLAUDE.md b/CLAUDE.md index f6578bf..7320177 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -82,6 +82,11 @@ Test coverage: | 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 | +| T27 | `--check` upstream older than hint — reported as `(?downgrade)` | +| T28 | `--check` no args — scans entire HINT_DIR | +| T29 | `--check` missing section, accept populate — github section appended, run stops, hint unchanged | +| T30 | `--check` missing section, decline populate — nothing added | +| T31 | `--check` missing section, no `.info` in repo — skipped, no section added | When adding new features, add a corresponding test case to `tests/mkhint_test.sh`. @@ -91,7 +96,7 @@ When adding new features, add a corresponding test case to `tests/mkhint_test.sh - `--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. +- `--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. Hints with no `[pkg]` section in `nvchecker.toml` are collected and, after the scan, a single prompt offers to populate the config via `add_nvchecker_section` (github/pypi autodetect, else stub); on accept it prints a "review and re-run" message and stops the run without applying updates. Packages whose `.info` is not found in `REPO_DIR` are skipped. - `--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). diff --git a/README.md b/README.md index e71429d..5eb5ec0 100644 --- a/README.md +++ b/README.md @@ -146,6 +146,8 @@ mkhint --check pkg1 pkg2 # check specific packages mkhint -C # short form ``` +If any scanned hint file has no nvchecker source configured, `--check` lists those packages and offers to populate `nvchecker.toml` for them in one prompt — auto-detecting github/pypi from the SBo `.info`, otherwise writing a commented stub to fill in. After populating, it asks you to review the file (fill any stubs) and re-run `mkhint -C`. Packages with no matching `.info` in the repository are skipped. + ### Help ```bash -- cgit v1.2.3