24 lines
804 B
Python
24 lines
804 B
Python
#! /usr/bin/evn python3
|
|
|
|
if __name__ == '__main__':
|
|
import os
|
|
import subprocess
|
|
import sys
|
|
|
|
def parse_path(path):
|
|
if os.path.islink(path):
|
|
return
|
|
elif os.path.isfile(path):
|
|
if open(path, "rb").read(4) == b"\x7FELF":
|
|
print("Compress: " + path)
|
|
subprocess.call(["cp", "-a", path, "tmp.so"])
|
|
subprocess.call(["strip", "--strip-debug", "tmp.so"])
|
|
subprocess.call(["cp", "-a", "tmp.so", path])
|
|
subprocess.call(["eu-elfcompress", "-vt", "gnu", path])
|
|
elif os.path.isdir(path):
|
|
for i in map(lambda x: os.path.join(path, x),
|
|
sorted(os.listdir(path))):
|
|
parse_path(i)
|
|
for i in sys.argv[1:]:
|
|
parse_path(i)
|