artifacts: add git SHA1 sanity checking

This commit is contained in:
Ricardo Pardini
2023-04-16 20:16:50 +02:00
committed by Igor Pečovnik
parent 8cd830d6e1
commit b73ced7dc0
6 changed files with 21 additions and 0 deletions

View File

@@ -81,6 +81,9 @@ function artifact_kernel_prepare_version() {
fi
debug_dict GIT_INFO_KERNEL
# Sanity check, the SHA1 gotta be sane.
[[ "${GIT_INFO_KERNEL[SHA1]}" =~ ^[0-9a-f]{40}$ ]] || exit_with_error "SHA1 is not sane: '${GIT_INFO_KERNEL[SHA1]}'"
declare short_sha1="${GIT_INFO_KERNEL[SHA1]:0:${short_hash_size}}"
# get the drivers hash...