| 261 | } |
| 262 | |
| 263 | func (d *DerivationBuilder) needsGlibcPatch(file *bufio.Reader, filePath string) bool { |
| 264 | if d.Glibc == "" || d.glibcPatcher == nil { |
| 265 | return false |
| 266 | } |
| 267 | if path.Dir(filePath) != "bin" { |
| 268 | return false |
| 269 | } |
| 270 | |
| 271 | // ELF binaries are identifiable by the first 4 magic bytes: |
| 272 | // 0x7F E L F |
| 273 | magic, err := file.Peek(4) |
| 274 | if err != nil { |
| 275 | return false |
| 276 | } |
| 277 | return magic[0] == 0x7F && magic[1] == 'E' && magic[2] == 'L' && magic[3] == 'F' |
| 278 | } |
| 279 | |
| 280 | func (d *DerivationBuilder) findRemovedRefs(ctx context.Context, pkg *packageFS) ([]fileSlice, error) { |
| 281 | var refs []fileSlice |