Commit 53bc492
authored
Make shell command substitutions safe with || true (#13279)
Add defensive fallbacks (|| true) to multiple command substitutions to prevent non-zero exits when commands produce no output or are unavailable. Changes touch misc/api.func, misc/build.func and misc/tools.func and cover places like lspci, /proc/cpuinfo parsing, /etc/os-release reads, hostname -I usage, grep reads from vars files and maps, pct config parsing, storage/template lookups, tool version detection, NVIDIA driver version extraction, and MeiliSearch config parsing. These edits do not change functional behavior aside from ensuring the scripts continue running (variables will be empty) instead of failing in stricter shells or when commands return non-zero status.1 parent de356fa commit 53bc492
3 files changed
+22
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
504 | 504 | | |
505 | 505 | | |
506 | 506 | | |
507 | | - | |
| 507 | + | |
508 | 508 | | |
509 | 509 | | |
510 | 510 | | |
| |||
543 | 543 | | |
544 | 544 | | |
545 | 545 | | |
546 | | - | |
| 546 | + | |
547 | 547 | | |
548 | 548 | | |
549 | 549 | | |
| |||
557 | 557 | | |
558 | 558 | | |
559 | 559 | | |
560 | | - | |
| 560 | + | |
561 | 561 | | |
562 | 562 | | |
563 | 563 | | |
| |||
1347 | 1347 | | |
1348 | 1348 | | |
1349 | 1349 | | |
1350 | | - | |
1351 | | - | |
| 1350 | + | |
| 1351 | + | |
1352 | 1352 | | |
1353 | 1353 | | |
1354 | 1354 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | | - | |
| 176 | + | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
| 179 | + | |
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| |||
1704 | 1704 | | |
1705 | 1705 | | |
1706 | 1706 | | |
1707 | | - | |
1708 | | - | |
| 1707 | + | |
| 1708 | + | |
1709 | 1709 | | |
1710 | 1710 | | |
1711 | 1711 | | |
| |||
1840 | 1840 | | |
1841 | 1841 | | |
1842 | 1842 | | |
1843 | | - | |
| 1843 | + | |
1844 | 1844 | | |
1845 | 1845 | | |
1846 | 1846 | | |
| |||
3322 | 3322 | | |
3323 | 3323 | | |
3324 | 3324 | | |
3325 | | - | |
| 3325 | + | |
3326 | 3326 | | |
3327 | 3327 | | |
3328 | 3328 | | |
| |||
3349 | 3349 | | |
3350 | 3350 | | |
3351 | 3351 | | |
3352 | | - | |
| 3352 | + | |
3353 | 3353 | | |
3354 | 3354 | | |
3355 | 3355 | | |
| |||
4050 | 4050 | | |
4051 | 4051 | | |
4052 | 4052 | | |
4053 | | - | |
| 4053 | + | |
4054 | 4054 | | |
4055 | 4055 | | |
4056 | 4056 | | |
| |||
5142 | 5142 | | |
5143 | 5143 | | |
5144 | 5144 | | |
5145 | | - | |
| 5145 | + | |
5146 | 5146 | | |
5147 | 5147 | | |
5148 | 5148 | | |
| |||
5181 | 5181 | | |
5182 | 5182 | | |
5183 | 5183 | | |
5184 | | - | |
| 5184 | + | |
5185 | 5185 | | |
5186 | 5186 | | |
5187 | 5187 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
524 | 524 | | |
525 | 525 | | |
526 | 526 | | |
527 | | - | |
| 527 | + | |
528 | 528 | | |
529 | 529 | | |
530 | 530 | | |
531 | 531 | | |
532 | | - | |
| 532 | + | |
533 | 533 | | |
534 | 534 | | |
535 | 535 | | |
| |||
539 | 539 | | |
540 | 540 | | |
541 | 541 | | |
542 | | - | |
| 542 | + | |
543 | 543 | | |
544 | 544 | | |
545 | 545 | | |
| |||
4837 | 4837 | | |
4838 | 4838 | | |
4839 | 4839 | | |
4840 | | - | |
| 4840 | + | |
4841 | 4841 | | |
4842 | 4842 | | |
4843 | 4843 | | |
| |||
7321 | 7321 | | |
7322 | 7322 | | |
7323 | 7323 | | |
7324 | | - | |
| 7324 | + | |
7325 | 7325 | | |
7326 | 7326 | | |
7327 | 7327 | | |
| |||
7387 | 7387 | | |
7388 | 7388 | | |
7389 | 7389 | | |
7390 | | - | |
| 7390 | + | |
7391 | 7391 | | |
7392 | 7392 | | |
7393 | 7393 | | |
| |||
7407 | 7407 | | |
7408 | 7408 | | |
7409 | 7409 | | |
7410 | | - | |
| 7410 | + | |
7411 | 7411 | | |
7412 | 7412 | | |
7413 | 7413 | | |
| |||
0 commit comments