diff options
| author | Mattias Andrée <m@maandree.se> | 2026-02-23 15:42:39 +0100 |
|---|---|---|
| committer | Mattias Andrée <m@maandree.se> | 2026-02-23 15:42:39 +0100 |
| commit | c94c083d07c61945765c5074f49c716a17d0e4c0 (patch) | |
| tree | bdd0c87dd3bddbd945bdf4fcb7bd8354fd3fde9f | |
| parent | Update validate-checksum to check $# and allow upstream project name as third argument (in case renamed to downstream name) (diff) | |
| download | release-scripts-c94c083d07c61945765c5074f49c716a17d0e4c0.tar.gz release-scripts-c94c083d07c61945765c5074f49c716a17d0e4c0.tar.bz2 release-scripts-c94c083d07c61945765c5074f49c716a17d0e4c0.tar.xz | |
m fixes
Signed-off-by: Mattias Andrée <m@maandree.se>
| -rw-r--r-- | LICENSE | 2 | ||||
| -rwxr-xr-x | validate-checksum | 8 |
2 files changed, 7 insertions, 3 deletions
@@ -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 |
