getWinDLLs.py 544 Bytes
Newer Older
Daniel Brown's avatar
Daniel Brown committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
from subprocess import Popen, PIPE
import shutil
import os

p = Popen(['cygcheck', 'kat'], stdin=PIPE, stdout=PIPE, stderr=PIPE)

out, err = p.communicate()

a = out.split("\n")
b = [c.strip() for c in a if c.find("cygwin") >= 0]

if os.path.exists(".windlls"):
    shutil.rmtree(".windlls")
    
shutil.os.mkdir(".windlls")

for file in b:
18 19
    print "cp ", file.replace('\\','\\\\'), "."
    shutil.copy2(file, os.path.join("./.windlls", os.path.basename(file.replace('\\','/'))))
Daniel Brown's avatar
Daniel Brown committed
20 21

print "Copied dlls into .windlls folder."