aboutsummaryrefslogtreecommitdiffstats
path: root/tools/make-dissector-reg.py
diff options
context:
space:
mode:
authorJörg Mayer <jmayer@loplof.de>2013-11-29 19:57:00 +0000
committerJörg Mayer <jmayer@loplof.de>2013-11-29 19:57:00 +0000
commitfb22ecce8dd4bced5f34440066d3590d1e31075a (patch)
treee66dd32f0308d02d7bab71446cbbf6ae64012c1a /tools/make-dissector-reg.py
parentd99fdfda639e78feffa3d9a1a6c758ae90539442 (diff)
Graham Bloice
I've now got tshark to build from a VS solution file, had to do some hacks to get there though, patch files attached for others to peruse, as I'm not sure if they are the optimal solutions: 3. As mentioned in my previous message, the VS solution chops out every 8192nd byte from the command line passed to make-dissector-reg.py. My patch (make-reg.patch) gets CMake to write out the required source file list to a file and modifies the python script to read in the file. The python changes *should* be backwards compatible. Me: Small fix to UseMakeDissectorReg.cmake (elseif() -> else()) svn path=/trunk/; revision=53654
Diffstat (limited to 'tools/make-dissector-reg.py')
-rwxr-xr-xtools/make-dissector-reg.py19
1 files changed, 14 insertions, 5 deletions
diff --git a/tools/make-dissector-reg.py b/tools/make-dissector-reg.py
index 521352fe81..c5d07a481f 100755
--- a/tools/make-dissector-reg.py
+++ b/tools/make-dissector-reg.py
@@ -32,7 +32,7 @@ srcdir = sys.argv[1]
# "dissectors", we build a register.c for libwireshark.
#
registertype = sys.argv[2]
-if registertype == "plugin" or registertype == "plugin_wtap":
+if registertype in ("plugin", "plugin_wtap"):
final_filename = "plugin.c"
cache_filename = None
preamble = """\
@@ -42,7 +42,7 @@ if registertype == "plugin" or registertype == "plugin_wtap":
* Generated automatically from %s.
*/
""" % (sys.argv[0])
-elif registertype == "dissectors":
+elif registertype in ("dissectors", "dissectorsinfile"):
final_filename = "register.c"
cache_filename = "register-cache.pkl"
preamble = """\
@@ -64,10 +64,19 @@ else:
#
-# All subsequent arguments are the files to scan.
+# All subsequent arguments are the files to scan
+# or the name of a file containing the files to scan
#
-files = sys.argv[3:]
-
+if registertype == "dissectorsinfile":
+ try:
+ with open(sys.argv[3]) as f:
+ files = [line.rstrip() for line in f]
+ except IOError:
+ print(("Unable to open input file '%s'" % sys.argv[3]))
+ sys.exit(1)
+else:
+ files = sys.argv[3:]
+
# Create the proper list of filenames
filenames = []
for file in files: