mirror of
https://github.com/EnumeratedDev/bpm.git
synced 2026-09-16 10:36:12 +00:00
Do not strip files that use ELF as a container format
This commit is contained in:
@@ -261,6 +261,17 @@ func CompileSourcePackage(archiveFilename, outputDirectory string, skipChecks, k
|
||||
fmt.Printf("Stripped %s (%s)\n", path, mimetype)
|
||||
}
|
||||
} else if strings.HasPrefix(mimetype, "application/x-pie-executable") || strings.HasPrefix(mimetype, "application/x-sharedlib") {
|
||||
cmd = exec.Command("file", "-b", path)
|
||||
cmd.Stderr = os.Stderr
|
||||
output, err = cmd.Output()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// Skip files that use ELF as a container format
|
||||
if strings.Contains(string(output), "no machine") {
|
||||
return nil
|
||||
}
|
||||
|
||||
cmd := exec.Command("strip", "--strip-unneeded", path)
|
||||
cmd.Stderr = os.Stderr
|
||||
err = cmd.Run()
|
||||
|
||||
Reference in New Issue
Block a user