9 print('Usage: update-ctags.py <universal ctags directory> <geany ctags directory>')
12 srcdir
= os
.path
.abspath(sys
.argv
[1])
13 dstdir
= os
.path
.abspath(sys
.argv
[2])
15 os
.chdir(dstdir
+ '/parsers')
16 parser_dst_files
= glob
.glob('*.c') + glob
.glob('*.h')
17 parser_dst_files
= list(filter(lambda x
: not x
.startswith('geany_'), parser_dst_files
))
18 cxx_parser_dst_files
= glob
.glob('cxx/*.c') + glob
.glob('cxx/*.h')
19 for f
in cxx_parser_dst_files
:
22 os
.chdir(srcdir
+ '/parsers')
23 print('Copying parsers... ({} files)'.format(len(parser_dst_files
)))
24 for f
in parser_dst_files
:
25 shutil
.copy(f
, dstdir
+ '/parsers')
27 cxx_parser_src_files
= glob
.glob('cxx/*.c') + glob
.glob('cxx/*.h')
28 print('Copying cxx parser files... ({} files)'.format(len(cxx_parser_src_files
)))
29 for f
in cxx_parser_src_files
:
30 shutil
.copy(f
, dstdir
+ '/parsers/cxx')
32 print('Copying dsl files...')
33 for f
in ['dsl/es.c', 'dsl/es.h', 'dsl/optscript.c', 'dsl/optscript.h']:
34 shutil
.copy(srcdir
+ '/' + f
, dstdir
+ '/' + f
)
37 main_src_files
= glob
.glob('main/*.c') + glob
.glob('main/*.h')
39 main_dst_files
= glob
.glob('main/*.c') + glob
.glob('main/*.h')
41 for f
in main_dst_files
:
44 print('Copying main... ({} files)'.format(len(main_src_files
)))
45 for f
in main_src_files
:
46 shutil
.copy(f
, dstdir
+ '/main')
48 main_diff
= set(main_dst_files
) - set(main_src_files
)
50 print('Files removed from main: ' + str(main_diff
))
51 main_diff
= set(main_src_files
) - set(main_dst_files
)
53 print('Files added to main: ' + str(main_diff
))