diff options
| author | Danilo M. <danix@danix.xyz> | 2026-07-04 09:29:44 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-07-04 09:29:44 +0200 |
| commit | d898f624bd3b03c99c1e889c1fb7e8fd68f033cf (patch) | |
| tree | 11b6b874e24c6e6326eafc36302d7c0bab81254a /CLAUDE.md | |
| parent | 11d1c51b97ae830b591c51b874da01de90a083dc (diff) | |
| download | mkhintfile-d898f624bd3b03c99c1e889c1fb7e8fd68f033cf.tar.gz mkhintfile-d898f624bd3b03c99c1e889c1fb7e8fd68f033cf.zip | |
feat: -l <pkg...> shows side-by-side hint vs .info
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>
Diffstat (limited to 'CLAUDE.md')
| -rw-r--r-- | CLAUDE.md | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -41,6 +41,7 @@ No build step. Direct execution: ```bash bash mkhint --help bash mkhint --list # highlight hints whose version matches SBo .info +bash mkhint --list mypackage # side-by-side hint vs .info (no table) bash mkhint --review # review matched hints: diff + [K]eep/[D]elete/[S]kip bash mkhint --list --review # show highlighted table, then review bash mkhint --version 2.0.1 --hintfile mypackage @@ -120,6 +121,8 @@ Test coverage: | T55 | missing phantom-deps file — `--fix-current` and `--new` are no-ops | | T56 | `--fix-current` with `-v` — mutually-exclusive error, exit 1 | | T57 | `-l` skips hints with no `VERSION`; count excludes them | +| T58 | `-l <pkg>` shows side-by-side hint vs `.info`, not the table | +| T59 | `-l <missing>` — exit 2 | When adding new features, add a corresponding test case to `tests/mkhint_test.sh`. @@ -129,7 +132,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. -- `--list` / `-l`: lists hints with `HintVer`/`SBOVer`; hints with no `VERSION` are skipped (and excluded from the total). Version columns are 22 wide to fit long version strings. Rows where the two are byte-equal are highlighted (color only on a TTY; plain when piped). Adds a legend when any row matched. +- `--list` / `-l`: lists hints with `HintVer`/`SBOVer`; hints with no `VERSION` are skipped (and excluded from the total). Version columns are 22 wide to fit long version strings. Rows where the two are byte-equal are highlighted (color only on a TTY; plain when piped). Adds a legend when any row matched. With package names (`-l foo bar`), the table is skipped and each named hint is shown side by side with its `.info` via `_show_hint_diff` (shared with `--review`); missing hint → exit 2. - `--review` / `-R`: with no package args, iterates only the matched (highlighted) hints. With explicit package names (`-R foo bar`), reviews each named hint regardless of version match (existence required: missing hint → exit 2). For each, shows the hint side-by-side with its `.info` (`git diff --no-index` if git present, else `diff -y`), then prompts `[K]eep / [D]elete / [S]kip` (default Keep). Delete removes the hint and its `.bak` via `_remove_hint`. Prints a deleted/kept summary counting hints actually reviewed. `-l` and `-R` combine: `-lR` shows the table first, then reviews. Bare `-R` with no matches → "nothing to review", exit 0. Per-hint logic lives in `_review_one_hint`; `review_hint_files` drives it from either the named list or `MATCHED_PKGS`. - `--check` / `-C`: runs nvchecker for all (or named) hints. With exactly one explicit package it uses `nvchecker -e <pkg>` to skip scanning the whole config; with two+ packages or no args it does one full scan. (`--hintfile` with no `-v` also queries via `nvchecker -e <pkg>`.) 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. Upstream versions are normalized via `_normalize_version` (`-` → `_`) before comparing and before storing, so a dashed upstream version like `2026-06-02` matches the packaged `2026_06_02` (SlackBuild versions cannot contain `-`) and updates are written in the underscore form. The same normalization applies to `--hintfile` with no `-v`. `nvtake` still uses nvchecker's own raw keyfile value. - `--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. |
