diff --git a/scripts/fix_homebrew_paths_in_standalone_zip.py b/scripts/fix_homebrew_paths_in_standalone_zip.py index 03cc617ef..95120f760 100755 --- a/scripts/fix_homebrew_paths_in_standalone_zip.py +++ b/scripts/fix_homebrew_paths_in_standalone_zip.py @@ -44,21 +44,20 @@ import subprocess import sys def readDependencies(fname): - with open(fname) as f: - with subprocess.Popen(['otool', '-L', fname], stdout=subprocess.PIPE) as o: - for line in o.stdout: - if line[0] == '\t': - library = line.split(' ', 1)[0][1:] - if (library.startswith("/usr/local/lib") or - library.startswith("/usr/local/opt") or - library.startswith("/Users/")): - if (os.path.basename(library) != os.path.basename(fname)): - command = "install_name_tool -change " + \ - library + " @executable_path/./" + \ - os.path.basename(library) + " " + fname - print(command) - os.system("chmod +w " + fname) - os.system(command) + with subprocess.Popen(['otool', '-L', fname], stdout=subprocess.PIPE) as o: + for line in o.stdout: + if line[0] == '\t': + library = line.split(' ', 1)[0][1:] + if (library.startswith("/usr/local/lib") or + library.startswith("/usr/local/opt") or + library.startswith("/Users/")): + if (os.path.basename(library) != os.path.basename(fname)): + command = "install_name_tool -change " + \ + library + " @executable_path/./" + \ + os.path.basename(library) + " " + fname + print(command) + os.system("chmod +w " + fname) + os.system(command) root = sys.argv[1] for (dirpath, dirnames, filenames) in os.walk(root):