diff options
| author | Danilo M. <danix@danix.xyz> | 2026-07-09 11:05:40 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-07-09 11:05:40 +0200 |
| commit | 93190858380c533f9b7564c42bdfb5dbea03f144 (patch) | |
| tree | 26a861ed4cedc4010549465c660c207d24a247c2 | |
| parent | 2c6e860df7e394fff4753796128fd50ce5c04ef3 (diff) | |
| download | mkhintfile-93190858380c533f9b7564c42bdfb5dbea03f144.tar.gz mkhintfile-93190858380c533f9b7564c42bdfb5dbea03f144.zip | |
feat: nvchecker autodetect expansion, -n stanza echo, --info/-i; release v1.2.5
Documents the Task 1-6 additions that shipped without doc updates: expanded
nvchecker source autodetection (gitlab, bitbucket, gitea, codeberg, pagure,
npm, gems, crates.io, cpan, hackage, packagist, cran, in addition to github
and pypi), the fenced stanza echo on --new/-n, and the --info/-i command
(category/program header plus paged README). Updates show_help, bash
completion, mkhint.1.md (rebuilds mkhint.1.gz), CLAUDE.md, and CHANGELOG.md.
Bumps MKHINT_VERSION to 1.2.5. No program logic changed; 224/224 tests still
pass.
| -rw-r--r-- | CHANGELOG.md | 20 | ||||
| -rw-r--r-- | CLAUDE.md | 4 | ||||
| -rwxr-xr-x | mkhint | 3 | ||||
| -rw-r--r-- | mkhint.1.gz | bin | 3536 -> 3837 bytes | |||
| -rw-r--r-- | mkhint.1.md | 18 | ||||
| -rw-r--r-- | mkhint.bash-completion | 2 |
6 files changed, 42 insertions, 5 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 798a049..26b4cbf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,26 @@ All notable changes to this project are documented here. The format is based on [Keep a Changelog](https://keepachangelog.com/), and this project adheres to [Semantic Versioning](https://semver.org/). +## [1.2.5] - 2026-07-09 + +### Added +- `--info` / `-i <pkg>`: shows a package's `category/program` path (green on a + TTY) followed by its README, paged with a sticky header (`less --header=1`) + only when the README is taller than the terminal. Missing package exits 2; + missing README prints `(no README)` and exits 0. Mutually exclusive with + `-V`/`-f`/`-n`. + +### Changed +- `--new` / `-n` now prints the nvchecker stanza it manages on stdout, fenced, + whether it was just added or was already present, so the effect of the + autodetection is visible immediately instead of only living in the config + file. +- Expanded nvchecker source autodetection (`_detect_nvchecker_source`) beyond + github and pypi to also recognize gitlab, bitbucket, gitea, codeberg, and + pagure owner/repo URLs, and the npm, gems, crates.io, cpan, hackage, + packagist, and cran registries. Registry sources parse the package name from + the URL where possible, falling back to `PRGNAM`. + ## [1.2.4] - 2026-07-08 ### Changed @@ -141,7 +141,8 @@ 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`. After a successful update it dispatches slackrepo for the single package via `prompt_slackrepo`, which uses `pkg_in_repo` (glob `PACKAGES_DIR/*/<pkg>/<pkg>-*.txz`) to choose `slackrepo update` for a built package or `slackrepo build` for an absent one, both run through `run_slackrepo`. -- `--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` 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 via `add_nvchecker_section`. +- `add_nvchecker_section` autodetection: `_detect_nvchecker_source` recognizes github, gitlab, bitbucket, gitea, codeberg, and pagure owner/repo URLs plus the pypi, npm, gems, crates.io (`cratesio`), cpan, hackage, packagist, and cran registries, else leaves a commented stub. Github gets `use_latest_release = true` with commented `use_max_tag`/`prefix = "v"` fallbacks; the other forges get `use_max_tag = true` plus a commented `# prefix = "v"`; registries use the package name parsed from the URL via `_registry_name_from_url`, falling back to `PRGNAM` when no host-specific pattern matches. Either way, the managed stanza (freshly added or already present) is echoed fenced on stdout via `_extract_nvchecker_section`. - `--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` plus a `DelReq` column (before `Created`) showing `✓` when the hint has a populated `DELREQUIRES` (detected via `grep '^DELREQUIRES="..*"'`, padded with `_pad_glyph` so the multibyte glyph stays aligned). Hints with no `VERSION` are skipped (and excluded from the total). Version columns are 22 wide to fit long version strings. Coloring: rows where the two versions are byte-equal get the whole row yellow (and populate `MATCHED_PKGS` for `-R`); when they differ, `sort -V` picks the newer side and only that version cell is green (version strings are pre-padded to 22 before the color wrap so the escape bytes don't break alignment); an absent/empty `SBOVer` leaves the row plain. Color only on a TTY (or `MKHINT_FORCE_COLOR`); plain when piped. Legend `(yellow row = versions match; green = newer side)` prints 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. @@ -175,6 +176,7 @@ When adding new features, add a corresponding test case to `tests/mkhint_test.sh `fetch_manifest`, `parse_manifest`, `match_dep_url`, `_url_version`, `reconcile_bundle_deps`. - `--delete` / `-d`: removes hint file and `.bak` if present. Accepts multiple package names. Exits 2 on first missing file. +- `--info` / `-i <pkg>`: globs `REPO_DIR/*/pkg/` for the category, prints the green `category/program` header then the README, paged with sticky header (`less --header=1`) only when the README is taller than the terminal (inline when it fits or when piped), missing package exits 2, missing README prints `(no README)` and exits 0. Mutually exclusive with `-V`/`-f`/`-n`. Handler `show_info`. - Downloads go to `/tmp/mkhint/download` (single shared temp file, deleted after md5 calculation). - Multiline `DOWNLOAD`/`DOWNLOAD_x86_64`: parsed via `parse_multiline_var` (awk). First URL always re-downloaded. Continuation URLs (2+) prompt user interactively — changed URLs re-downloaded, unchanged URLs keep existing md5. Written back via `perl -i` with `\` continuation format preserved. Shared logic in `update_checksums` → `_process_download_var`. @@ -45,7 +45,7 @@ if [[ ! -d $TMP_DIR ]]; then mkdir $TMP_DIR fi -readonly MKHINT_VERSION="1.2.4" +readonly MKHINT_VERSION="1.2.5" # Variables VERSION="" @@ -81,6 +81,7 @@ Options: --fix-current, -F Add/merge DELREQUIRES for -current phantom deps across the whole repo --delete, -d FILE Delete a hint file (and .bak if present) --no-dl, -N Skip downloads; add NODOWNLOAD=yes to hint file (use with -f or -n) + --info, -i FILE Show category/program path and README for a package --force With --check: reconcile bundled deps even if the primary version is unchanged --help, -h Show this help message diff --git a/mkhint.1.gz b/mkhint.1.gz Binary files differindex 37815c5..8933bb3 100644 --- a/mkhint.1.gz +++ b/mkhint.1.gz diff --git a/mkhint.1.md b/mkhint.1.md index f01be66..593bfb3 100644 --- a/mkhint.1.md +++ b/mkhint.1.md @@ -1,4 +1,4 @@ -% MKHINT(1) mkhint 1.2.4 | User Commands +% MKHINT(1) mkhint 1.2.5 | User Commands % Danilo M. % July 2026 @@ -22,6 +22,8 @@ mkhint - manage hint files for slackrepo scripts **mkhint** **\--delete** *FILE*... +**mkhint** **\--info** *FILE* + **mkhint** **\--clean** **mkhint** {**\--version** | **\--help**} @@ -55,7 +57,11 @@ to *FILE*.bak first. `HOMEPAGE`, `MAINTAINER`, and `EMAIL`, comments out `REQUIRES`, and sets `ARCH="x86_64"`, keeping only the variables a hint needs. `VERSION` is kept from the `.info` unless **-V** is given. Appends an **nvchecker** section to the -config, autodetecting a github or pypi source or leaving a commented stub. +config, autodetecting the upstream source (github, gitlab, bitbucket, gitea, +codeberg, pagure, pypi, npm, gems, crates.io, cpan, hackage, packagist, or +cran) or leaving a commented stub when nothing matches. Prints the managed +**nvchecker** stanza on stdout, whether it was just added or was already +present. **\--check**, **-C** \[*FILE*...] : Check all (or the named) hints for upstream updates via **nvchecker** and @@ -80,6 +86,13 @@ show a diff and prompt **[K]eep / [D]elete / [S]kip**. **\--delete**, **-d** *FILE*... : Delete a hint file and its `.bak`. Accepts multiple names. +**\--info**, **-i** *FILE* +: Show a package's `category/program` path (green on a TTY), then its +`README`. Paged with a sticky header (`less --header=1`) only when the +`README` is taller than the terminal; printed inline when it fits or when +piped. Missing package exits 2; missing `README` prints `(no README)` and +exits 0. Mutually exclusive with **-V**, **-f**, **-n**. + **\--clean**, **-c** : Remove all `.bak` files from the hint directory. @@ -132,6 +145,7 @@ List, review, sweep, delete, clean: mkhint --review mkhint --fix-current mkhint --delete mypackage + mkhint --info mypackage mkhint --clean URLs set to `UNSUPPORTED` or `UNTESTED` are skipped during download. diff --git a/mkhint.bash-completion b/mkhint.bash-completion index 0de0115..b24992b 100644 --- a/mkhint.bash-completion +++ b/mkhint.bash-completion @@ -14,7 +14,7 @@ _mkhintfile_completions() { hint_dir="${HINT_DIR:-$hint_dir}" repo_dir="${repo_dir%/}"; hint_dir="${hint_dir%/}" - local all_flags="--version -v --set-version -V --hintfile -f --new -n --list -l --review -R --clean -c --check -C --fix-current -F --delete -d --no-dl -N --force --help -h" + local all_flags="--version -v --set-version -V --hintfile -f --new -n --list -l --review -R --clean -c --check -C --fix-current -F --delete -d --no-dl -N --info -i --force --help -h" # -R/--review and -l/--list take any number of hint names; complete them repeatedly. local w in_review="" |
