Commit 6d7a2bc
authored
fix(install): fix nightly digest extraction on macOS (#331)
## Summary
The nightly install script fails on macOS with:
```
gunzip: (stdin): unexpected end of file
```
The OCI manifest digest extraction in Step 4 used `sed 's/},{/}\\n{/g'`
to
split layers onto separate lines before awk extracted the digest. This
had
two bugs:
1. **BSD sed (macOS)** treats `\\n` as literal characters, not a newline
—
the manifest stays on one line and awk always finds the config digest
(`sha256:44136fa...`, a 2-byte empty `{}` blob) instead of the binary.
2. **First-layer edge case**: the first layer shares a line with the
config
block because the array starts with `[{`, not `},{`.
The result: downloading 2 bytes of `{}` instead of the ~23 MB compressed
binary.
## Fix
Replace the `sed` + `awk` pipeline with a single `awk` pass that tracks
the last-seen `"digest"` value and prints it when the target filename
matches in `"org.opencontainers.image.title"`. No `sed` needed, works
on both GNU and BSD awk.1 parent fe7d51d commit 6d7a2bc
1 file changed
+10
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | | - | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
131 | 134 | | |
132 | 135 | | |
133 | | - | |
134 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
135 | 142 | | |
136 | 143 | | |
137 | 144 | | |
| |||
0 commit comments