mkhint
activeManage slackrepo hint files: bump versions, recompute checksums, track upstream releases.
mkhint is a single Bash script that takes the tedium out of maintaining slackrepo hint files. A hint file overrides build details for an SBo package: which version to build, where to download the source, and the checksums to verify it. Keeping those in sync by hand, across dozens of packages, is exactly the kind of repetitive work a script should own.
What it does
- Update a hint
-f package -v 2.0.1: bump the version everywhere in the file, re-download the source fromDOWNLOAD/DOWNLOAD_x86_64, and recomputeMD5SUM/MD5SUM_x86_64. The old file is backed up to.bakfirst. - Create a hint
-n package: generate a new hint from the matching repository.infofile, stripping the fields slackrepo does not want and defaultingARCHtox86_64. With no.info, it writes an empty skeleton. - List
-l: print every hint with itsHintVer(version in the hint) next to theSBOVer(version in the repo.info), highlighting the rows where the two are byte-equal so you can spot hints that have become redundant with upstream. - Review
-R: walk only those matched hints, showing each hint side by side with its.info(git diff --no-index, falling back todiff -y), and prompt to keep, delete, or skip. - Check
-C [package...]: query nvchecker for the latest upstream version of one, several, or all hints; report what is outdated; update accepted packages withnvtake; and finish with a singleslackrepo updateprompt for everything that changed. - Housekeeping
-d package/-c: delete a hint and its backup, or clean every.bakfrom the hint directory in one go.
Command reference
|
|
How it works
mkhint is plain Bash with three small dependencies, each doing one job:
wgetdownloads archives so their MD5 can be computed,nvchecker(and its companionnvtake) tracks upstream versions,jqparses nvchecker’s JSON output.
Everything else is shell. Paths to the repository and the hint directory are
two variables at the top of the script. The bash-completion file mirrors them,
so -f, -n, -d, and -C autocomplete package names from the right
directory, and -v even suggests the current version pulled straight from the
named hint file.
Multiline DOWNLOAD entries (a package with several source URLs) are handled
carefully: the first URL is always re-fetched because the version changed,
while each continuation URL is offered interactively so unchanged sources keep
their existing checksum instead of being downloaded again for nothing.
Why it exists
Maintaining a personal SBo overlay means a steady trickle of version bumps.
Each one is the same dance: edit the version string, fetch the new tarball,
recompute the checksum, hope you did not fat-finger a digit. mkhint turns that
dance into one command, and the --check / --list / --review trio turns
“which of my hints are now stale or pointless?” from a manual audit into a
glance. It is the kind of small, sharp tool Slackware encourages: no daemon,
no database, no framework, just a script that does one annoying job well.
Quick start
|
|
Edit the REPO_DIR and HINT_DIR paths at the top of the script (and in the
completion file) to match your setup before first use.
I hope you find it useful. If you maintain your own slackrepo overlay, mkhint might save you the same tedium it saves me. Patches and ideas are welcome.
Browse the source