From c94c083d07c61945765c5074f49c716a17d0e4c0 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 23 Feb 2026 15:42:39 +0100 Subject: m fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- LICENSE | 2 +- validate-checksum | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/LICENSE b/LICENSE index fcdd716..d2ba2dc 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright © 2024, 2025 Mattias Andrée (m@maandree.se) +Copyright © 2024, 2025, 2026 Mattias Andrée (m@maandree.se) Copying and distribution of these scripts, with or without modification, are permitted in any medium without royalty provided the copyright diff --git a/validate-checksum b/validate-checksum index ee94401..94c2730 100755 --- a/validate-checksum +++ b/validate-checksum @@ -44,7 +44,7 @@ hasher="$(printf '%s\n' "$1" | sed 's/s$//')" file="$2" proj="$3" -if ! algo="$(get_algo "${hasher}")" || test ! -f "${file}"; then +if ! algo="$(get_algo "${hasher}")" || test ! -f "${file}"; then usage fi @@ -54,11 +54,15 @@ hash="$(${hasher} -- "${file}" | cut -d ' ' -f 1 | tr A-F a-f)" pkgname="$(basename -- "${file}" | sed -n 's/-[^-]*\.tar\.gz$//p')" pkgver="$(basename -- "${file}" | sed -n 's/^.*-\([^-]*\)\.tar\.gz$/\1/p')" +if test -z "${pkgver}"; then + pkgver="$(basename -- "${file}" | sed -n '$s/^\([0-9.]*\)\.tar\.gz$/\1/p')" +fi + if test -z "${proj}"; then proj="${pkgname}" fi -if test -z "${pkgname}" || test -z "${pkgver}"; then +if test -z "${proj}" || test -z "${pkgver}"; then usage fi -- cgit v1.2.3-70-g09d2