From 2b3c7f80218d950c833df2f7be5cdf9da73e7988 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 5 Jun 2026 10:27:06 +0200 Subject: feat: prompt to run slackrepo after --hintfile update Saves the round-trip of manually invoking slackrepo after every hint version bump. Co-Authored-By: Claude Sonnet 4.6 --- README.md | 1 + mkhint | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/README.md b/README.md index e2fb4a3..db659a8 100644 --- a/README.md +++ b/README.md @@ -142,4 +142,5 @@ mkhint -h - 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. +- After a successful `--hintfile` update, mkhint prompts `Run 'slackrepo update '? [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 ` 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. diff --git a/mkhint b/mkhint index 62e6d05..3fa58f0 100755 --- a/mkhint +++ b/mkhint @@ -404,6 +404,17 @@ update_hint_file() { echo; echo "==========================================" } +# Prompt to run slackrepo update after a hint file update +prompt_slackrepo() { + local pkg="$1" + local answer + read -r -p "Run 'slackrepo update $pkg'? [Y/n] " answer + answer="${answer:-Y}" + if [[ "$answer" =~ ^[Yy]$ ]]; then + slackrepo update "$pkg" + fi +} + # Delete a hint file (and .bak if present) delete_hint_file() { local file="$1" @@ -537,6 +548,7 @@ main() { update) check_wget update_hint_file "$HINT_FILE" "$VERSION" + prompt_slackrepo "$HINT_FILE" ;; new) if [[ -n "$VERSION" ]]; then -- cgit v1.2.3