fixing drupal info files on php 5.3
Submitted by clemens on Wed, 2011/08/03 - 4:56pm
Trying some Drupal 5 sites for upgrade script development on desktop PHP 5.3 I ran on *.info files causing annoyances.
function fix_d5_info {
# description containing the word : 'on'
# php message: syntax error, unexpected BOOL_FALSE in
local INFOS=`find ${ROOT_DIR} -type f -name "*.info" -exec grep -l "description.* on " {} \;`
perl -e "s/description = /description = "/g;" -pi $INFOS
perl -e "s/description = .*/$&"/g;" -pi $INFOS
# description containing the word : 'is'
# php message: syntax error, unexpected BOOL_FALSE in
local INFOS=`find ${ROOT_DIR} -type f -name "*.info" -exec grep -l "description.* is " {} \;`
perl -e "s/description = /description = "/g;" -pi $INFOS
perl -e "s/description = .*/$&"/g;" -pi $INFOS
# php message: Comments starting with '#' are deprecated
local INFOS=`find ${ROOT_DIR} -type f -name "*.info" -exec grep -l "^#" {} \;`
perl -e "s/^#/;/g;" -pi $INFOS
}