Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit f3becce7 authored by David Faure's avatar David Faure

Avoid matching the renamed class or file as a substring

parent cb65bfeb
......@@ -31,13 +31,13 @@ perl -pi -e '$_ .= "$1'$newfile.cpp'\n" if (m/^(\s*)'$oldfile'\.cpp/)' CMakeList
perl -pi -e '$_ .= "$1'$newfile.h'\n" if (m/^(\s*)'$oldfile'\.h/)' CMakeLists.txt
# Rename class
perl -pi -e "s/$oldname/$newname/g" $newfile.h $newfile.cpp
perl -pi -e "s/\b$oldname/$newname/g" $newfile.h $newfile.cpp
oldinclguard=`echo $oldname | tr a-z A-Z`
newinclguard=`echo $newname | tr a-z A-Z`
# Update include guard
perl -pi -e "s/$oldinclguard/$newinclguard/g" $newfile.h
perl -pi -e "s/\b$oldinclguard/$newinclguard/g" $newfile.h
# Update includes in cpp file
perl -pi -e 's/\b'$oldfile'\.h/'$newfile'\.h/' $newfile.cpp
......
......@@ -23,16 +23,16 @@ if [ ! -f $newfile.h ]; then
fi
# Update buildsystem
perl -pi -e "s/$oldfile\.cpp/$newfile.cpp/" CMakeLists.txt
perl -pi -e "s/\b$oldfile\.cpp/$newfile.cpp/" CMakeLists.txt
# Rename class
perl -pi -e "s/$oldname/$newname/g" $newfile.h $newfile.cpp
perl -pi -e "s/\b$oldname/$newname/g" $newfile.h $newfile.cpp
oldinclguard=`echo $oldname | tr a-z A-Z`
newinclguard=`echo $newname | tr a-z A-Z`
# Update include guard
perl -pi -e "s/$oldinclguard/$newinclguard/g" $newfile.h
perl -pi -e "s/\b$oldinclguard/$newinclguard/g" $newfile.h
# Update include in cpp file
perl -pi -e 's/\b'$oldfile'\.h/'$newfile'\.h/' $newfile.cpp
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment