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 /README.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 'README.md')
| -rw-r--r-- | README.md | 44 |
1 files changed, 42 insertions, 2 deletions
@@ -16,6 +16,12 @@ sudo cp mkhint /usr/local/bin/mkhint sudo cp mkhint.bash-completion /etc/bash-completion.d/mkhint ``` +### Dependencies + +- `wget` — for downloading archives and calculating checksums +- `nvchecker` — for checking upstream versions (provides `nvchecker` and `nvtake`) +- `jq` — for parsing version check results + ### Configuration Edit the paths at the top of mkhint to match your setup (lines 16–17): @@ -27,6 +33,16 @@ HINT_DIR="/etc/slackrepo/SBo-danix/hintfiles/" # Directory where .hint files ar Keep the same paths in sync in `mkhint.bash-completion` (lines 8–9). +nvchecker reads its configuration from `~/.config/nvchecker/nvchecker.toml`. You must set up the `[__config__]` section with oldver and newver keyfile paths before using version-checking features: + +```toml +[__config__] +oldver = "/var/lib/nvchecker/oldver" +newver = "/var/lib/nvchecker/newver" +``` + +mkhint only appends package-specific `[section]` entries to this file; the `[__config__]` section must be created manually once. + ## Usage ### Update an existing hint file @@ -108,6 +124,30 @@ mkhint --clean mkhint -c ``` +### Check for upstream updates + +When creating a new hint file with `--new`, mkhint automatically appends an nvchecker configuration section, auto-detecting the source (github, pypi, etc.) or providing a commented template. A notice is printed so you can review and fill in any missing details: + +```bash +mkhint --new mypackage # adds [mypackage] section to nvchecker config +``` + +When updating an existing hint file with `--hintfile` but without `-v`, mkhint queries nvchecker for the latest version, shows you the current and latest versions, and prompts to accept the latest, type a different version, or decline. After accepting an update, it runs `nvtake` to sync nvchecker's keyfile: + +```bash +mkhint --hintfile mypackage # suggests latest version via nvchecker (no -v flag) +``` + +Check one or more packages for upstream updates with `--check`. mkhint runs nvchecker for all (or named) hint files, reports outdated packages, prompts per-package to update, applies updates with `nvtake`, and finishes with a single `slackrepo update` prompt for all updated packages: + +```bash +mkhint --check # check all hints for upstream updates +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 @@ -123,7 +163,7 @@ mkhint -h | 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) | ## Hint File Variables @@ -143,4 +183,4 @@ mkhint -h - If DOWNLOAD or DOWNLOAD_x86_64 is `UNSUPPORTED` or `UNTESTED`, that URL is skipped and its MD5SUM is left unchanged. - `--no-dl` / `-N` does **not** skip downloads — it downloads and recalculates checksums as normal, then appends `NODOWNLOAD=yes` to the hint file. - After a successful `--hintfile` update, mkhint prompts `Run 'slackrepo update <package>'? [Y/n]`. Enter or `y` runs slackrepo immediately; `n` skips. -- Bash completion for `-f`/`--hintfile`, `-n`/`--new`, and `-d`/`--delete` autocompletes package names from their respective directories. When `-f <package>` is already on the command line, `-v [TAB]` suggests the current `VERSION` from that package's hint file. If the hint file is absent, no version is suggested. Short flags (`-v`, `-f`, `-n`, `-l`, `-c`, `-d`, `-N`, `-h`) are also completed. +- Bash completion for `-f`/`--hintfile`, `-n`/`--new`, `-d`/`--delete`, and `-C`/`--check` autocompletes package names from their respective directories. When `-f <package>` is already on the command line, `-v [TAB]` suggests the current `VERSION` from that package's hint file. If the hint file is absent, no version is suggested. Short flags (`-v`, `-f`, `-n`, `-l`, `-c`, `-d`, `-C`, `-N`, `-h`) are also completed. |
