diff options
| author | Danilo M. <danix@danix.xyz> | 2026-06-13 18:36:31 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-06-13 18:36:31 +0200 |
| commit | d4789701532c8acdfb4b109931e65e5e046871de (patch) | |
| tree | 1f8bc043687aa3e8fa079f95deee5a5e15036d79 /CLAUDE.md | |
| parent | d11b8be143998ea7349808b9e9da68139399aace (diff) | |
| parent | 8e6531764b00b29259fc59bd4e1f16e019bc3f2a (diff) | |
| download | mkhintfile-d4789701532c8acdfb4b109931e65e5e046871de.tar.gz mkhintfile-d4789701532c8acdfb4b109931e65e5e046871de.zip | |
Merge feat/nvchecker: nvchecker integration
- --new appends nvchecker [section] (github/pypi autodetect, else stub)
- --hintfile without -v suggests latest version via nvchecker
- --check/-C bulk update with per-package confirm + single slackrepo
- --check populate missing sections prompt
- fix: TOML-quote section names with non-bare-key chars
- fix: resolve relative keyfile path against config dir
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'CLAUDE.md')
| -rw-r--r-- | CLAUDE.md | 33 |
1 files changed, 31 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,32 @@ 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 | +| 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`. ## 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. 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). @@ -81,7 +110,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 |
