|
44 | 44 | import sys
|
45 | 45 |
|
46 | 46 | def readDependencies(fname):
|
47 |
| - with open(fname) as f: |
48 |
| - with subprocess.Popen(['otool', '-L', fname], stdout=subprocess.PIPE) as o: |
49 |
| - for line in o.stdout: |
50 |
| - if line[0] == '\t': |
51 |
| - library = line.split(' ', 1)[0][1:] |
52 |
| - if (library.startswith("/usr/local/lib") or |
53 |
| - library.startswith("/usr/local/opt") or |
54 |
| - library.startswith("/Users/")): |
55 |
| - if (os.path.basename(library) != os.path.basename(fname)): |
56 |
| - command = "install_name_tool -change " + \ |
57 |
| - library + " @executable_path/./" + \ |
58 |
| - os.path.basename(library) + " " + fname |
59 |
| - print(command) |
60 |
| - os.system("chmod +w " + fname) |
61 |
| - os.system(command) |
| 47 | + with subprocess.Popen(['otool', '-L', fname], stdout=subprocess.PIPE) as o: |
| 48 | + for line in o.stdout: |
| 49 | + if line[0] == '\t': |
| 50 | + library = line.split(' ', 1)[0][1:] |
| 51 | + if (library.startswith("/usr/local/lib") or |
| 52 | + library.startswith("/usr/local/opt") or |
| 53 | + library.startswith("/Users/")): |
| 54 | + if (os.path.basename(library) != os.path.basename(fname)): |
| 55 | + command = "install_name_tool -change " + \ |
| 56 | + library + " @executable_path/./" + \ |
| 57 | + os.path.basename(library) + " " + fname |
| 58 | + print(command) |
| 59 | + os.system("chmod +w " + fname) |
| 60 | + os.system(command) |
62 | 61 |
|
63 | 62 | root = sys.argv[1]
|
64 | 63 | for (dirpath, dirnames, filenames) in os.walk(root):
|
|
0 commit comments