1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
From: Jochen Sprickerhof <git@jochen.sprickerhof.de>
Date: Sun, 14 Jun 2020 20:51:28 +0200
Subject: Strip path from strfile to make build reproducible
---
src/dynamic_reconfigure/parameter_generator_catkin.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/dynamic_reconfigure/parameter_generator_catkin.py b/src/dynamic_reconfigure/parameter_generator_catkin.py
index eed790c..1bedd81 100644
--- a/src/dynamic_reconfigure/parameter_generator_catkin.py
+++ b/src/dynamic_reconfigure/parameter_generator_catkin.py
@@ -113,7 +113,7 @@ class ParameterGenerator(object):
self.state = state
self.srcline = inspect.currentframe().f_back.f_lineno
- self.srcfile = inspect.getsourcefile(inspect.currentframe().f_back.f_code)
+ self.srcfile = os.path.basename(inspect.getsourcefile(inspect.currentframe().f_back.f_code))
self.instances[self.id] = self
@@ -137,7 +137,7 @@ class ParameterGenerator(object):
'min': min,
'max': max,
'srcline': inspect.currentframe().f_back.f_lineno,
- 'srcfile': inspect.getsourcefile(inspect.currentframe().f_back.f_code),
+ 'srcfile': os.path.basename(inspect.getsourcefile(inspect.currentframe().f_back.f_code)),
'edit_method': edit_method,
}
if (paramtype == str_t or paramtype == bool_t) and (max is not None or min is not None):
@@ -272,7 +272,7 @@ class ParameterGenerator(object):
'type': type,
'value': value,
'srcline': inspect.currentframe().f_back.f_lineno,
- 'srcfile': inspect.getsourcefile(inspect.currentframe().f_back.f_code),
+ 'srcfile': os.path.basename(inspect.getsourcefile(inspect.currentframe().f_back.f_code)),
'description': descr
}
check_description(descr)
@@ -457,7 +457,7 @@ class ParameterGenerator(object):
# Read the configuration manipulator template and insert line numbers and file name into template.
templatefile = os.path.join(self.dynconfpath, "templates", "ConfigType.h.template")
templatelines = []
- templatefilesafe = templatefile.replace('\\', '\\\\') # line directive does backslash expansion.
+ templatefilesafe = "ConfigType.h.template"
curline = 1
with open(templatefile) as f:
for line in f:
|