Make sure all patch files actually exist. Otherwise there can be confusing errors later.
Showing the changes to scripts/livepatch (1 of 1 file). Show all
Unified · Split
| @@ -157,6 +157,7 @@ process_args() { · 156 unmodified lines | ||
| 157 | 157 | local short |
| 158 | 158 | local long |
| 159 | 159 | local args |
| 160 | + local patch | |
| 160 | 161 | |
| 161 | 162 | short="hfj:o:vdS:T" |
| 162 | 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 | 237 | KEEP_TMP="$keep_tmp" |
| 237 | 238 | PATCHES=("$@") |
| 239 | + | |
| 240 | + for patch in "${PATCHES[@]}"; do | |
| 241 | + [[ -f "$patch" ]] || die "$patch doesn't exist" | |
| 242 | + done | |
| 238 | 243 | } |
| 239 | 244 | |
| 240 | 245 | # temporarily disable xtrace for especially verbose code |