From 5d688d633267d560c343168380db835044dfb920 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Wed, 24 Jun 2026 16:41:11 +0200 Subject: Add version_of .info reader + test Co-Authored-By: Claude Opus 4.8 --- sbo-batch-test | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'sbo-batch-test') diff --git a/sbo-batch-test b/sbo-batch-test index c5e6cf1..01280a3 100755 --- a/sbo-batch-test +++ b/sbo-batch-test @@ -397,6 +397,17 @@ read_requires() { ( set +u; source "$info"; echo "${REQUIRES:-}" ) } +# Echo the VERSION field from a SlackBuild dir's .info (empty if unreadable). +# Used as the cache key's version component. +version_of() { + local dir="$1" + local info="$dir/$(basename "$dir").info" + [[ -f "$info" ]] || return + # .info lines look like: VERSION="1.2.3" + local v; v="$(grep -m1 '^VERSION=' "$info" | cut -d'"' -f2)" + echo "$v" +} + # ============================================================================= # DEPENDENCY RESOLUTION # Builds a topological order over the local SBo tree. -- cgit v1.2.3