diff --git a/brew.py b/brew.py index 17b2be4..f0fef64 100755 --- a/brew.py +++ b/brew.py @@ -1939,6 +1939,8 @@ class Fixer: if File.isMachO(fname): Dylib(fname).fix() + elif File.isBinary(fname): + pass # skip other binary (.a, .class, .png, ...) else: # replace all @@homebrew@@ placeholders Fixer.inreplace(fname) @@ -2677,6 +2679,11 @@ class File: with open(fname, 'rb') as fp: return fp.read(4) == b'\xcf\xfa\xed\xfe' + @staticmethod + def isBinary(fname: str) -> bool: + with open(fname, 'rb') as fp: + return b'\0' in fp.read(4096) + @staticmethod def isOutdated(fname: str, maxage: int) -> bool: ''' Check if `fname` is older than `maxage` '''