[geany/geany] 3f0bb8: Add a script performing update of Geany ctags from universal ctags
Jiří Techet
git-noreply at xxxxx
Sun Feb 7 21:32:01 UTC 2021
Branch: refs/heads/master
Author: Jiří Techet <techet at gmail.com>
Committer: Jiří Techet <techet at gmail.com>
Date: Sat, 21 Nov 2020 21:43:20 UTC
Commit: 3f0bb8ed4c2073387eba6686774497f974da7424
https://github.com/geany/geany/commit/3f0bb8ed4c2073387eba6686774497f974da7424
Log Message:
-----------
Add a script performing update of Geany ctags from universal ctags
The script:
1. Copies all parsers from universal ctags not starting with geany_
2. Copies all files from universal ctags main
3. Prints files which were added/removed to/from main so the corresponding
changes can be done manually in Makefile.am
4. Patches main with the provided patch
Modified Paths:
--------------
scripts/update-ctags.py
Modified: scripts/update-ctags.py
42 lines changed, 42 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,42 @@
+#!/usr/bin/env python3
+
+import glob
+import os
+import shutil
+import sys
+
+if len(sys.argv) != 3:
+ print('Usage: update-ctags.py <universal ctags directory> <geany ctags directory>')
+
+srcdir = os.path.abspath(sys.argv[1])
+dstdir = os.path.abspath(sys.argv[2])
+
+os.chdir(dstdir + '/parsers')
+parser_dst_files = glob.glob('*.c') + glob.glob('*.h')
+parser_dst_files = list(filter(lambda x: not x.startswith('geany_'), parser_dst_files))
+os.chdir(srcdir + '/parsers')
+print('Copying parsers... ({} files)'.format(len(parser_dst_files)))
+for f in parser_dst_files:
+ shutil.copy(f, dstdir + '/parsers')
+
+os.chdir(srcdir)
+main_src_files = glob.glob('main/*.c') + glob.glob('main/*.h')
+os.chdir(dstdir)
+main_dst_files = glob.glob('main/*.c') + glob.glob('main/*.h')
+
+for f in main_dst_files:
+ os.remove(f)
+os.chdir(srcdir)
+print('Copying main... ({} files)'.format(len(main_src_files)))
+for f in main_src_files:
+ shutil.copy(f, dstdir + '/main')
+
+main_diff = set(main_dst_files) - set(main_src_files)
+if main_diff:
+ print('Files removed from main: ' + str(main_diff))
+main_diff = set(main_src_files) - set(main_dst_files)
+if main_diff:
+ print('Files added to main: ' + str(main_diff))
+
+os.chdir(dstdir)
+os.system('patch -p1 <ctags_changes.patch')
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
More information about the Commits
mailing list