Skip to content

Commit

Permalink
kpatch-build: check if gawk is installed
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Hongchen Zhang committed Dec 12, 2023
1 parent 922cd45 commit e4da489
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kpatch-build/kpatch-build
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit e4da489

Please sign in to comment.