History

klp-build: Validate patch file existence

Make sure all patch files actually exist. Otherwise there can be confusing errors later.

Josh Poimboeuf committed 7 months ago

Commit b3ece301 parent 946d3511 file · +5 −0Browse files

Showing the changes to scripts/livepatch (1 of 1 file). Show all

Unified · Split

scripts/livepatch/klp-build+5−0
@@ -157,6 +157,7 @@ process_args() { · 156 unmodified lines
157157 local short
158158 local long
159159 local args
160+ local patch
160161
161162 short="hfj:o:vdS:T"
162163 long="help,show-first-changed,jobs:,output:,no-replace,verbose,debug,short-circuit:,keep-tmp"
@@ -235,6 +236,10 @@ process_args() { · 72 unmodified lines
235236
236237 KEEP_TMP="$keep_tmp"
237238 PATCHES=("$@")
239+
240+ for patch in "${PATCHES[@]}"; do
241+ [[ -f "$patch" ]] || die "$patch doesn't exist"
242+ done
238243 }
239244
240245 # temporarily disable xtrace for especially verbose code