summaryrefslogtreecommitdiff
path: root/gr-utils
diff options
context:
space:
mode:
authorJosh Morman <mormjb@gmail.com>2020-05-28 11:32:51 -0400
committerJosh Morman <mormjb@gmail.com>2020-06-04 10:05:48 -0400
commit34d8e7281fd908f26e1c77830e7779bcaac0b5b7 (patch)
tree7764c378e1c0c726b5ce98ad80b5c6b0aebdd58d /gr-utils
parent8ad573a24bbdcb2b854a06e932e2d8228242e036 (diff)
modtool: add hash checking into initial block add
Diffstat (limited to 'gr-utils')
-rw-r--r--gr-utils/modtool/core/add.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/gr-utils/modtool/core/add.py b/gr-utils/modtool/core/add.py
index 712d44de48..872d0a08a9 100644
--- a/gr-utils/modtool/core/add.py
+++ b/gr-utils/modtool/core/add.py
@@ -254,10 +254,18 @@ class ModToolAdd(ModTool):
'interpolator', 'general', 'hier', 'tagged_stream'):
block_base = code_generator.GRTYPELIST[self.info['blocktype']]
+ import hashlib
+ header_file = self.info['blockname'] + '.h'
+ hasher = hashlib.md5()
+ with open(os.path.join(self.info['includedir'], header_file), 'rb') as file_in:
+ buf = file_in.read()
+ hasher.update(buf)
+ md5hash = hasher.hexdigest()
+
header_info = {
"module_name": self.info['modname'],
- "filename": self.info['blockname'] + '.h',
- "md5hash": "0",
+ "filename": header_file,
+ "md5hash": md5hash,
"namespace": {
"name": "::".join(['gr', self.info['modname']]),
"enums": [],