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:
