Monday, May 24, 2010

Linux: Commands Used for Deprecating ConditionType etc

I had to rename ConditionType to ConditionType_Deprecated, and similarly for ConditionInstance, ContributionType and ContributionInstance.

I did the following:

find . \( -name "*.h" -or -name "*.cpp" \) | xargs sed -i "s/ConditionInstance/ConditionInstance_Deprecated/g"

But then the header file inclusions were also renamed. To undo these:

find . \( -name "*.h" -or -name "*.cpp" \) | xargs sed -i "s/ConditionInstance_Deprecated\.h/ConditionInstance.h/g"

Neither do we wanted the name changes for the functions with names like getConditionInstance. These had to be undone too.

No comments: