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
157 local short157 local short
158 local long158 local long
159 local args159 local args
160 local patch
160 161
161 short="hfj:o:vdS:T"162 short="hfj:o:vdS:T"
162 long="help,show-first-changed,jobs:,output:,no-replace,verbose,debug,short-circuit:,keep-tmp"163 long="help,show-first-changed,jobs:,output:,no-replace,verbose,debug,short-circuit:,keep-tmp"
@@ -235,6 +236,10 @@ process_args() { · 72 unmodified lines
235 236
236 KEEP_TMP="$keep_tmp"237 KEEP_TMP="$keep_tmp"
237 PATCHES=("$@")238 PATCHES=("$@")
239
240 for patch in "${PATCHES[@]}"; do
241 [[ -f "$patch" ]] || die "$patch doesn't exist"
242 done
238}243}
239 244
240# temporarily disable xtrace for especially verbose code245# temporarily disable xtrace for especially verbose code