diff options
author | Leah Rowe <leah@libreboot.org> | 2024-05-15 00:37:12 +0100 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2024-05-15 00:37:12 +0100 |
commit | 08c9f94a1abbff54d601f31519b70cdda7074ec4 (patch) | |
tree | cdbe299e1e28c0f480a582084fca8e8308556a80 /include/option.sh | |
parent | 1ce7e339769c4fd38ce5a3818e5b5835a867422a (diff) |
unified sha512sum creation for tarballs
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include/option.sh')
-rwxr-xr-x | include/option.sh | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/include/option.sh b/include/option.sh index b974c630..c42327d4 100755 --- a/include/option.sh +++ b/include/option.sh @@ -196,10 +196,15 @@ mktarball() tar -c "$1" | xz -T$threads -9e > "$2" || \ $err "mktarball 2, $1" fi + mksha512sum "${2}" "${2##*/}.sha512" +} + +mksha512sum() +{ ( - [ "${2%/*}" != "${2}" ] && x_ cd "${2%/*}" - sha512sum "${2##*/}" > "${2##*/}.sha512" || \ - $err "!sha512sum \"${2##*/}\" > \"${2##*/}.sha512\"" + [ "${1%/*}" != "${1}" ] && x_ cd "${1%/*}" + sha512sum ./"${1##*/}" >> "${2}" || \ + $err "!sha512sum \"${1}\" > \"${2}\"" ) || $err "failed to create tarball checksum" } |