use file's python bindings
This commit is contained in:
+4
-2
@@ -17,6 +17,7 @@ import os
|
|||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
import sha
|
import sha
|
||||||
|
import magic
|
||||||
import shutil
|
import shutil
|
||||||
import string
|
import string
|
||||||
import statvfs
|
import statvfs
|
||||||
@@ -532,8 +533,9 @@ def strip_directory(top, excludelist=[]):
|
|||||||
|
|
||||||
def strip_file(filepath, outpath):
|
def strip_file(filepath, outpath):
|
||||||
"""Strip an elf file from debug symbols."""
|
"""Strip an elf file from debug symbols."""
|
||||||
p = os.popen("file \"%s\"" % filepath)
|
ms = magic.open(magic.MAGIC_NONE)
|
||||||
o = p.read()
|
ms.load()
|
||||||
|
o = ms.file(filepath)
|
||||||
|
|
||||||
def run_strip(f, flags=""):
|
def run_strip(f, flags=""):
|
||||||
p = os.popen("strip %s %s" %(flags, f))
|
p = os.popen("strip %s %s" %(flags, f))
|
||||||
|
|||||||
Reference in New Issue
Block a user