diff --git a/lib/functions/artifacts/artifact-armbian-config.sh b/lib/functions/artifacts/artifact-armbian-config.sh index c3b156ce7..e3e2cee9d 100644 --- a/lib/functions/artifacts/artifact-armbian-config.sh +++ b/lib/functions/artifacts/artifact-armbian-config.sh @@ -27,6 +27,9 @@ function artifact_armbian-config_prepare_version() { run_memoized GIT_INFO_ARMBIAN_CONFIG "git2info" memoized_git_ref_to_info debug_dict GIT_INFO_ARMBIAN_CONFIG + # Sanity check, the SHA1 gotta be sane. + [[ "${GIT_INFO_ARMBIAN_CONFIG[SHA1]}" =~ ^[0-9a-f]{40}$ ]] || exit_with_error "SHA1 is not sane: '${GIT_INFO_ARMBIAN_CONFIG[SHA1]}'" + declare fake_unchanging_base_version="1" declare short_sha1="${GIT_INFO_ARMBIAN_CONFIG[SHA1]:0:${short_hash_size}}" diff --git a/lib/functions/artifacts/artifact-armbian-zsh.sh b/lib/functions/artifacts/artifact-armbian-zsh.sh index 78d5229eb..3269266dd 100644 --- a/lib/functions/artifacts/artifact-armbian-zsh.sh +++ b/lib/functions/artifacts/artifact-armbian-zsh.sh @@ -28,6 +28,9 @@ function artifact_armbian-zsh_prepare_version() { run_memoized GIT_INFO_ARMBIAN_ZSH "git2info" memoized_git_ref_to_info debug_dict GIT_INFO_ARMBIAN_ZSH + # Sanity check, the SHA1 gotta be sane. + [[ "${GIT_INFO_ARMBIAN_ZSH[SHA1]}" =~ ^[0-9a-f]{40}$ ]] || exit_with_error "SHA1 is not sane: '${GIT_INFO_ARMBIAN_ZSH[SHA1]}'" + declare fake_unchanging_base_version="1" declare short_sha1="${GIT_INFO_ARMBIAN_ZSH[SHA1]:0:${short_hash_size}}" diff --git a/lib/functions/artifacts/artifact-firmware.sh b/lib/functions/artifacts/artifact-firmware.sh index 6918039c2..555dd99f3 100644 --- a/lib/functions/artifacts/artifact-firmware.sh +++ b/lib/functions/artifacts/artifact-firmware.sh @@ -28,6 +28,9 @@ function artifact_firmware_prepare_version() { run_memoized GIT_INFO_ARMBIAN_FIRMWARE "git2info" memoized_git_ref_to_info debug_dict GIT_INFO_ARMBIAN_FIRMWARE + # Sanity check, the SHA1 gotta be sane. + [[ "${GIT_INFO_ARMBIAN_FIRMWARE[SHA1]}" =~ ^[0-9a-f]{40}$ ]] || exit_with_error "SHA1 is not sane: '${GIT_INFO_ARMBIAN_FIRMWARE[SHA1]}'" + declare fake_unchanging_base_version="1" declare short_sha1="${GIT_INFO_ARMBIAN_FIRMWARE[SHA1]:0:${short_hash_size}}" diff --git a/lib/functions/artifacts/artifact-full_firmware.sh b/lib/functions/artifacts/artifact-full_firmware.sh index bedd60c93..5f07f0ef2 100644 --- a/lib/functions/artifacts/artifact-full_firmware.sh +++ b/lib/functions/artifacts/artifact-full_firmware.sh @@ -30,10 +30,16 @@ function artifact_full_firmware_prepare_version() { run_memoized GIT_INFO_ARMBIAN_FIRMWARE "git2info" memoized_git_ref_to_info debug_dict GIT_INFO_ARMBIAN_FIRMWARE + # Sanity check, the SHA1 gotta be sane. + [[ "${GIT_INFO_ARMBIAN_FIRMWARE[SHA1]}" =~ ^[0-9a-f]{40}$ ]] || exit_with_error "SHA1 is not sane: '${GIT_INFO_ARMBIAN_FIRMWARE[SHA1]}'" + declare -A GIT_INFO_MAINLINE_FIRMWARE=([GIT_SOURCE]="${MAINLINE_FIRMWARE_SOURCE}" [GIT_REF]="branch:main") run_memoized GIT_INFO_MAINLINE_FIRMWARE "git2info" memoized_git_ref_to_info debug_dict GIT_INFO_MAINLINE_FIRMWARE + # Sanity check, the SHA1 gotta be sane. + [[ "${GIT_INFO_MAINLINE_FIRMWARE[SHA1]}" =~ ^[0-9a-f]{40}$ ]] || exit_with_error "SHA1 is not sane: '${GIT_INFO_MAINLINE_FIRMWARE[SHA1]}'" + declare fake_unchanging_base_version="1" declare short_sha1="${GIT_INFO_ARMBIAN_FIRMWARE[SHA1]:0:${short_hash_size}}" diff --git a/lib/functions/artifacts/artifact-kernel.sh b/lib/functions/artifacts/artifact-kernel.sh index 3d9d352c0..2fb792b45 100644 --- a/lib/functions/artifacts/artifact-kernel.sh +++ b/lib/functions/artifacts/artifact-kernel.sh @@ -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... diff --git a/lib/functions/artifacts/artifact-uboot.sh b/lib/functions/artifacts/artifact-uboot.sh index 69e396dfd..571ddf2eb 100644 --- a/lib/functions/artifacts/artifact-uboot.sh +++ b/lib/functions/artifacts/artifact-uboot.sh @@ -44,6 +44,9 @@ function artifact_uboot_prepare_version() { run_memoized GIT_INFO_UBOOT "git2info" memoized_git_ref_to_info "include_makefile_body" debug_dict GIT_INFO_UBOOT + # Sanity check, the SHA1 gotta be sane. + [[ "${GIT_INFO_UBOOT[SHA1]}" =~ ^[0-9a-f]{40}$ ]] || exit_with_error "SHA1 is not sane: '${GIT_INFO_UBOOT[SHA1]}'" + declare short_sha1="${GIT_INFO_UBOOT[SHA1]:0:${short_hash_size}}" # get the uboot patches hash...