예제 #1
0
파일: tasks.py 프로젝트: hotgloupi/8cube
def fix_windows_libraries(ctx, dest_dir):
    ctx.log(" - Copying redistributables")
    shutil.copy(which('msvcr120.dll'), join(dest_dir, 'bin'))
    shutil.copy(which('msvcp120.dll'), join(dest_dir, 'bin'))
    shutil.copy(which('python34.dll'), join(dest_dir, 'bin'))
예제 #2
0

def is_binary(path):
    if IS_WINDOWS and any(path.lower().endswith(ext) for ext in [".exe", ".dll", ".pyd"]):
        return True
    if path.endswith(".py") or path.endswith(".sh") or path.endswith(".bat"):
        return False
    if not stat.S_IXUSR & os.stat(path)[stat.ST_MODE]:
        return False
    with open(path, "rb") as f:
        if f.read(2) == b"#!":
            return False
    return True


if which("otool"):

    def get_binary_dependencies(arg):
        deps = cmd_output("otool", "-L", arg).split("\n")[2:]
        for path in (dep.strip().split(" ")[0] for dep in deps):
            if path:
                yield path


elif which("ldd"):

    def get_binary_dependencies(arg):
        deps = cmd_output("ldd", arg)
        deps = deps.split("\n")
        if not deps:
            return