]> Savannah Git Hosting - gnulib.git/commitdiff
Split ProjectQuirks out into its own file
authorSiddhesh Poyarekar <siddhesh@gotplt.org>
Thu, 20 Aug 2020 03:13:46 +0000 (08:43 +0530)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 20 Aug 2020 17:39:56 +0000 (10:39 -0700)
ProjectQuirks is used by external quirks files and importing it from
vcs-to-changelog.py is broken since it was renamed to use hyphens.  It
is cleaner to put it in its own file anyway.

* build-aux/vcstocl/projectquirks.py: A new file...
* build-aux/vcs-to-changelog.py (ProjectQuirks): ...to which
we move ProjectQuirks and import the file.

build-aux/vcs-to-changelog.py
build-aux/vcstocl/projectquirks.py [new file with mode: 0644]

index bf4bc7cf64c9897e4a56758209f5821434b377c4..edc6128a797336afc4b43192ce871b7f8981e823 100755 (executable)
@@ -55,29 +55,10 @@ import argparse
 from vcstocl.misc_util import *
 from vcstocl import frontend_c
 from vcstocl.vcs_git import *
+from vcstocl.projectquirks import ProjectQuirks
 
 debug = DebugUtil(False)
 
-class ProjectQuirks:
-    # This is a list of regex substitutions for C/C++ macros that are known to
-    # break parsing of the C programs.  Each member of this list is a dict with
-    # the key 'orig' having the regex and 'sub' having the substitution of the
-    # regex.
-    MACRO_QUIRKS = []
-
-    # This is a list of macro definitions that are extensively used and are
-    # known to break parsing due to some characteristic, mainly the lack of a
-    # semicolon at the end.
-    C_MACROS = []
-
-    # The repo type, defaults to git.
-    repo = 'git'
-
-    # List of files to ignore either because they are not needed (such as the
-    # ChangeLog) or because they are non-parseable.  For example, glibc has a
-    # header file that is only assembly code, which breaks the C parser.
-    IGNORE_LIST = ['ChangeLog']
-
 sys.path.append('/'.join([os.path.dirname(os.path.realpath(__file__)),
                 'vcstocl']))
 
diff --git a/build-aux/vcstocl/projectquirks.py b/build-aux/vcstocl/projectquirks.py
new file mode 100644 (file)
index 0000000..6561e38
--- /dev/null
@@ -0,0 +1,36 @@
+# Project quirks base class.
+# Copyright (C) 2020 Free Software Foundation, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+
+class ProjectQuirks:
+    # This is a list of regex substitutions for C/C++ macros that are known to
+    # break parsing of the C programs.  Each member of this list is a dict with
+    # the key 'orig' having the regex and 'sub' having the substitution of the
+    # regex.
+    MACRO_QUIRKS = []
+
+    # This is a list of macro definitions that are extensively used and are
+    # known to break parsing due to some characteristic, mainly the lack of a
+    # semicolon at the end.
+    C_MACROS = []
+
+    # The repo type, defaults to git.
+    repo = 'git'
+
+    # List of files to ignore either because they are not needed (such as the
+    # ChangeLog) or because they are non-parseable.  For example, glibc has a
+    # header file that is only assembly code, which breaks the C parser.
+    IGNORE_LIST = ['ChangeLog']