37 from __future__
import print_function
41 cmd =
"find . -type f ! -name '*.svn-base' -a ! -name '*.hg' -a ! -name '*.git' -a " \
42 "\( -name '*.c*' -o -name '*.h*' \)" 45 'pluginlib/class_desc.h':
'pluginlib/class_desc.hpp',
46 'pluginlib/class_list_macros.h':
'pluginlib/class_list_macros.hpp',
47 'pluginlib/class_loader_base.h':
'pluginlib/class_loader_base.hpp',
48 'pluginlib/class_loader.h':
'pluginlib/class_loader.hpp',
49 'pluginlib/class_loader_imp.h':
'pluginlib/class_loader_imp.hpp',
50 'pluginlib/pluginlib_exceptions.h':
'pluginlib/exceptions.hpp',
56 include_prefix =
'#include ' 57 sed_cmd_prefix =
' -exec sed -i \' s' 58 sed_cmd_suffix =
' {} \; ' 61 for old_header, new_header
in header_mappings.iteritems():
62 for leading_token, ending_token
in include_tokens.iteritems():
64 sed_cmd_prefix + sed_separator + \
65 include_prefix + leading_token + old_header + ending_token + sed_separator + \
66 include_prefix + leading_token + new_header + ending_token + sed_separator + \
68 print(
"Looking for '%s' to replace with '%s'" % (old_header, new_header))
70 print(
'Running %s' % full_cmd)
71 ret_code = subprocess.call(full_cmd, shell=
True)