40 cmd =
"find . -type f ! -name '*.svn-base' -a ! -name '*.hg' -a ! -name '*.git' -a " \
41 "\( -name '*.c*' -o -name '*.h*' \)"
44 'pluginlib/class_desc.h':
'pluginlib/class_desc.hpp',
45 'pluginlib/class_list_macros.h':
'pluginlib/class_list_macros.hpp',
46 'pluginlib/class_loader_base.h':
'pluginlib/class_loader_base.hpp',
47 'pluginlib/class_loader.h':
'pluginlib/class_loader.hpp',
48 'pluginlib/class_loader_imp.h':
'pluginlib/class_loader_imp.hpp',
49 'pluginlib/pluginlib_exceptions.h':
'pluginlib/exceptions.hpp',
55 include_prefix =
'#include '
56 sed_cmd_prefix =
' -exec sed -i \' s'
57 sed_cmd_suffix =
' {} \; '
60 for old_header, new_header
in header_mappings.items():
61 for leading_token, ending_token
in include_tokens.items():
63 sed_cmd_prefix + sed_separator + \
64 include_prefix + leading_token + old_header + ending_token + sed_separator + \
65 include_prefix + leading_token + new_header + ending_token + sed_separator + \
67 print(
"Looking for '%s' to replace with '%s'" % (old_header, new_header))
69 print(
'Running %s' % full_cmd)
70 ret_code = subprocess.call(full_cmd, shell=
True)