diff options
| author | Danilo M. <danix@danix.xyz> | 2026-05-18 10:49:06 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-05-18 10:49:06 +0200 |
| commit | 9f1ad23a187a493ffa812064e6641061553e6386 (patch) | |
| tree | a164278161830d2f168f830f81fbafbb07670f9e /README.md | |
| parent | e647c20e9f387b250469cda2b515cf767d2955a8 (diff) | |
| download | mkhintfile-9f1ad23a187a493ffa812064e6641061553e6386.tar.gz mkhintfile-9f1ad23a187a493ffa812064e6641061553e6386.zip | |
- Add parse_multiline_var, prompt_continuation_urls, build_multiline_value,
_process_download_var; refactor update_checksums to handle multi-URL vars
- First URL always re-downloaded; continuation URLs prompt user, skip
re-download if unchanged
- Add tests/mkhint_test.sh: 44 cases covering all commands and edge cases
- Update README and CLAUDE.md: correct -N semantics, --new behavior,
multiline DOWNLOAD flow, test suite docs
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 88 |
1 files changed, 55 insertions, 33 deletions
@@ -25,6 +25,8 @@ REPO_DIR="/var/lib/sbopkg/SBo-danix/" # Repository containing .info files HINT_DIR="/etc/slackrepo/SBo-danix/hintfiles/" # Directory where .hint files are stored ``` +Keep the same paths in sync in `mkhint.bash-completion` (lines 8–9). + ## Usage ### Update an existing hint file @@ -32,47 +34,60 @@ HINT_DIR="/etc/slackrepo/SBo-danix/hintfiles/" # Directory where .hint files ar Updates the package version, downloads the archive, and recalculates the MD5 checksums: ```bash -mkhint --version 2.0.1 --hintfile mypackage +mkhint --hintfile mypackage --version 2.0.1 +mkhint -f mypackage -v 2.0.1 ``` -Replaces the old version with 2.0.1 in mypackage.hint and re-downloads the URLs from DOWNLOAD and DOWNLOAD_x86_64 to update MD5SUM and MD5SUM_x86_64. +Replaces the old version string with 2.0.1 everywhere in mypackage.hint, re-downloads the URLs from DOWNLOAD and DOWNLOAD_x86_64, and updates MD5SUM and MD5SUM_x86_64. Backs up the old file to mypackage.hint.bak first. + +URLs set to `UNSUPPORTED` or `UNTESTED` are skipped. -### Update without downloading +### Update and add NODOWNLOAD -Updates the version string and adds `NODOWNLOAD=yes` to skip checksum verification in slackrepo: +Downloads and recalculates checksums, then appends `NODOWNLOAD=yes` to tell slackrepo to skip checksum verification at build time: ```bash -mkhint --version 2.0.1 --hintfile mypackage --no-dl +mkhint -f mypackage -v 2.0.1 -N +mkhint --hintfile mypackage --version 2.0.1 --no-dl ``` ### Create a new hint file from .info -Generates a new hint file from the corresponding repository .info file: +Copies the corresponding .info file as a template, removes PRGNAM, HOMEPAGE, MAINTAINER, EMAIL, comments out REQUIRES, and sets ARCH to x86_64. If `-v` is given, the version string is updated and checksums are recalculated: ```bash -mkhint --version 1.2.3 --new mypackage +mkhint --new mypackage # copy .info as-is, keep VERSION from .info +mkhint -n mypackage -v 1.2.3 # copy .info, update version + recalculate md5 +mkhint -n mypackage -v 1.2.3 -N # same, also add NODOWNLOAD=yes +mkhint -n mypackage -N # copy .info, add NODOWNLOAD=yes, no downloads ``` -The .info file is copied as a template, unwanted variables (PRGNAM, HOMEPAGE, MAINTAINER, EMAIL) are removed, and ARCH is set to x86_64. - -### Create a new hint file with NODOWNLOAD +If no .info file exists in REPO_DIR, a skeleton hint with empty variables is created instead. -```bash -mkhint --new mypackage --no-dl -``` +If the hint file already exists it is backed up and a fresh empty skeleton is written. -### Create an empty hint file +### Multiline DOWNLOAD -Creates a fresh hint file with empty variables: +Some packages have multiple download URLs on continuation lines: -```bash -mkhint --new mypackage ``` +DOWNLOAD="https://example.com/foo-1.0.tar.gz \ + https://example.com/extra-data.tar.gz" +MD5SUM="aabbcc... \ + ddeeff..." +``` + +When updating a hint with multiline DOWNLOAD, mkhint: + +- Always re-downloads the first URL (version changed → new content) +- Prompts interactively for each continuation URL — enter a new URL or leave blank to keep the current one +- Only re-downloads continuation URLs that were changed; unchanged URLs keep their existing md5 ### List hint files ```bash mkhint --list +mkhint -l ``` ### Delete a hint file @@ -81,7 +96,7 @@ Removes the hint file and its .bak backup if present: ```bash mkhint --delete mypackage -mkhint --delete pkg1 pkg2 pkg3 +mkhint -d pkg1 pkg2 pkg3 ``` ### Clean backup files @@ -90,34 +105,41 @@ Removes all .bak files from HINT_DIR: ```bash mkhint --clean +mkhint -c ``` ### Help ```bash mkhint --help +mkhint -h ``` ## Exit Codes -- 0 - Success -- 1 - Invalid arguments -- 2 - File not found -- 3 - File already exists -- 4 - wget not available +| Code | Meaning | +|------|---------| +| 0 | Success | +| 1 | Invalid arguments | +| 2 | File not found | +| 3 | File already exists (unused — backup logic replaces this) | +| 4 | wget not available | ## Hint File Variables -- VERSION - Package version -- ARCH - Architecture -- DOWNLOAD - Download URL (generic/32-bit) -- MD5SUM - MD5 checksum of the generic archive -- DOWNLOAD_x86_64 - Download URL (x86_64 specific) -- MD5SUM_x86_64 - MD5 checksum of the x86_64 archive -- NODOWNLOAD - Set to `yes` to skip download/checksum verification in slackrepo +| Variable | Description | +|----------|-------------| +| VERSION | Package version | +| ARCH | Architecture (x86_64) | +| DOWNLOAD | Download URL for generic/32-bit build | +| MD5SUM | MD5 checksum of the generic archive | +| DOWNLOAD_x86_64 | Download URL for x86_64-specific build | +| MD5SUM_x86_64 | MD5 checksum of the x86_64 archive | +| NODOWNLOAD | Set to `yes` to skip download/checksum verification in slackrepo | ## Notes -- Old versions of hint files are backed up with a .bak extension before being modified. -- If a download URL is set to UNSUPPORTED or UNTESTED, the link is skipped during update. -- Bash completion for -f/--hintfile, -n/--new, and -d/--delete autocompletes package names from their respective directories. +- Hint files are backed up to `.bak` before any modification. +- 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. +- Bash completion for `-f`/`--hintfile`, `-n`/`--new`, and `-d`/`--delete` autocompletes package names from their respective directories. Short flags (`-v`, `-f`, `-n`, `-l`, `-c`, `-d`, `-N`, `-h`) are also completed. |
