11#!/usr/bin/python
22from __future__ import print_function
33
4- r"""depends.py - find the ordered dependancies of a library/executable (deepest first)
4+ r"""depends.py - find the ordered dependencies of a library/executable (deepest first)
55
66To use this:
77 depends.py [options]+ <pathtolibrary/pathtoexecutable/pathotoapp>
@@ -51,7 +51,7 @@ def depend(execdir,loaddir,libname,dependdict):
5151 if os .path .isfile (libpath ):
5252 if not dependdict .has_key (libpath ):
5353 dependdict [libpath ]= Set ([]) # push now to prevent infinite loop in recursion
54- cmd = 'otool -L "%s"' % libpath # otool -L prints library dependancies :
54+ cmd = 'otool -L "%s"' % libpath # otool -L prints library dependencies :
5555 # libpath:
5656 # <tab>dependency (metadata) ...
5757 if options .verbose or options .dryrun :
@@ -60,7 +60,7 @@ def depend(execdir,loaddir,libname,dependdict):
6060 if line [:1 ]== '\t ' : # parse <tab>dependency (metadata)
6161 dependency = line .split ()[0 ]
6262 # print libpath,' => ',dependency
63- # recurse to find dependancies of dependency
63+ # recurse to find dependencies of dependency
6464 dpath = depend (execdir ,loaddir ,dependency ,dependdict )
6565 dependdict [libpath ].add (dpath ) # update dependdict from recursion
6666 else :
@@ -91,7 +91,7 @@ def deploy(execdir,loaddir,libname):
9191 libpath = os .path .abspath (libname )
9292
9393 if os .path .isfile (libpath ):
94- cmd = 'otool -L "%s"' % libpath # otool -L prints library dependancies :
94+ cmd = 'otool -L "%s"' % libpath # otool -L prints library dependencies :
9595 # libpath:
9696 # <tab>dependency (metadata) ...
9797 for line in os .popen (cmd ).readlines (): # run cmd
@@ -180,7 +180,7 @@ def main():
180180 parser .add_option ('-V' , '--version' , action = 'store_true' , dest = 'version' ,help = 'report version' )
181181 parser .add_option ('-v' , '--verbose' , action = 'store_true' , dest = 'verbose' ,help = 'verbose output' )
182182 parser .add_option ('-d' , '--deploy' , action = 'store_true' , dest = 'deploy' ,help = 'update the bundle' )
183- parser .add_option ('-D' , '--depends' , action = 'store_true' , dest = 'depends' ,help = 'report dependancies ' )
183+ parser .add_option ('-D' , '--depends' , action = 'store_true' , dest = 'depends' ,help = 'report dependencies ' )
184184 parser .add_option ('-X' , '--dryrun' , action = 'store_true' , dest = 'dryrun' ,help = 'do not execute commands' )
185185 parser .add_option ('-q' , '--qt' , action = 'store' , dest = 'qt' ,help = 'qt directory' ,default = os .environ ['HOME' ]+ '/Qt/5.9/clang_64/lib' )
186186
0 commit comments