kpatch-build: check if gawk is installed

kpatch-build uses gawk to find special section, but gawk is not
always installed. So check if gawk is installed.

Signed-off-by: Hongchen Zhang <zhanghongchen@loongson.cn>
This commit is contained in:
Hongchen Zhang 2023-12-06 13:55:23 +08:00
parent 922cd45809
commit e4da489e7e

View File

@ -674,6 +674,10 @@ usage() {
echo " (not recommended)" >&2
}
if ! command -v gawk &> /dev/null; then
die "gawk not installed"
fi
options="$(getopt -o ha:r:s:c:v:j:t:n:o:dR -l "help,archversion:,sourcerpm:,sourcedir:,config:,vmlinux:,jobs:,target:,name:,output:,oot-module:,oot-module-src:,debug,skip-gcc-check,skip-compiler-check,skip-cleanup,non-replace" -- "$@")" || die "getopt failed"
eval set -- "$options"