From ff0999e469bb3eeee1f03556b95d577ced0c7dff Mon Sep 17 00:00:00 2001 From: Tobias Powalowski Date: Mon, 22 Jul 2024 20:22:43 +0200 Subject: [PATCH] reproducible package database --- usr/lib/archboot/common.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/usr/lib/archboot/common.sh b/usr/lib/archboot/common.sh index a4733418a..647fb687d 100644 --- a/usr/lib/archboot/common.sh +++ b/usr/lib/archboot/common.sh @@ -164,12 +164,14 @@ _run_update_environment() { } _kver() { - if [[ -f "${1}" ]]; then - # x86_64 default image - rg -Noazm 1 'ABCDEF\x00+(.*) \(.*@' -r '$1' ${1} || - # aarch64, works for compressed and uncompressed image - rg -Noazm 1 'Linux version (.*) \(.*@' -r '$1' ${1} || - # riscv64, rg cannot detect compression without suffix + # x86_64: rg -Noazm 1 'ABCDEF\x00+(.*) \(.*@' -r '$1' ${1} + # aarch64 compressed and uncompressed: + # rg -Noazm 1 'Linux version (.*) \(.*@' -r '$1' ${1} + # riscv64: zcat ${1} | rg -Noazm 1 'Linux version (.*) \(.*@' -r '$1' + if [[ -f ${1} ]]; then + #shellcheck disable=SC2086 + rg -Noazm 1 'ABCDEF\x00+(.*) \(.*@' -r '$1' ${1} ||\ + rg -Noazm 1 'Linux version (.*) \(.*@' -r '$1' ${1} ||\ zcat ${1} | rg -Noazm 1 'Linux version (.*) \(.*@' -r '$1' fi }