1#!/bin/bash 2# \author Hans J. Johnson 3# 4# Script to process a directory to replace 5# outdated macro names with their modern 6# conformant names 7 8function ReplaceCXXString() 9{ 10oldstring="$1" 11newstring="$2" 12 13# NOTE: Skip processing this file 14# NOTE: Skip processing the Migration directory in ITK 15git grep -l "${oldstring}" | \ 16 fgrep -v ReplaceOutdatedMacroNames.sh | \ 17 fgrep -v Migration | \ 18 fgrep -v ReplaceITK_OVERRIDEMacroNames.sh | \ 19 fgrep -v itk_compiler_detection.h | fgrep -v CMakeLists.txt |fgrep -v .cmake | \ 20 xargs sed -i '' -e "s/${oldstring}/${newstring}/g" 21 22git add -A 23git commit -m"COMP: Use C++11 ${newstring} directly 24 25git grep -l \"${oldstring}\" | \ 26 fgrep -v itk_compiler_detection.h | fgrep -v CMakeLists.txt |fgrep -v .cmake | \ 27 xargs sed -i '' -e \"s/${oldstring}/${newstring}/g\" 28" 29 30echo "WARNING: This script is not intended to be bullet-proof." 31echo "WARNING: Please carefully review all changes made to ensure proper behavior." 32} 33 34ReplaceCXXString ITK_OVERRIDE override 35