Repository navigation
Commit d50d176
committed
fix(arcup): accept checksum files without a trailing newline
verify_checksum_file() decided emptiness from the exit status of
`read -r expected_checksum expected_name < "$checksum_path"`. `read`
returns non-zero when it reaches EOF before a newline, even though it has
already populated the variables. A .sha256 whose single line lacks a
trailing newline is valid, but arcup rejected it with
"Checksum file is empty", aborting a correct install.
Decide emptiness from the parsed hash instead of read's exit status.
A genuinely empty file still yields an empty hash and is still rejected.
Adds regression tests covering the no-trailing-newline and empty cases.1 parent 90d71dc commit d50d176
2 files changed
Lines changed: 15 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
656 | 656 | | |
657 | 657 | | |
658 | 658 | | |
659 | | - | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
660 | 665 | | |
661 | 666 | | |
662 | 667 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
122 | 131 | | |
123 | 132 | | |
124 | 133 | | |
| |||
0 commit comments