Commit a659ccd
authored
Use find -print0 and xargs -0 to fix file hashing (#279)
Example:
```
++ find images/hook-embedded -type f -not -type l -print
++ LC_ALL=C
++ sort
++ xargs sha256sum
++ sha256sum
++ cut '-d ' -f1
sha256sum: images/hook-embedded/images/overlay2/4f2b976a728e2f978ec5a0728e7a7de5ac8e86d05424567038829628a23a0787/diff/nix/store/q94x70qac6cnly6w60mlgfkaa8npk9xw-systemd-257.5/example/systemd/system/system-systemdx2dcryptsetup.slice: No such file or directory
```
File enumeration should use a null-terminated approach that safely preserves file names regardless of any whitespace or special characters.
`-print0` and `-0` Options: These ensure file names are treated as complete, atomic strings.
`LC_ALL=C sort -z`: This guarantees a consistent, bytewise sort order while preserving the null termination.
Fixes: #2601 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
0 commit comments