-if ! egrep -q '^[ ]*global[ ]+\$config_version' "$CONF"; then
- really_old_config=1
- #echo "CN: Adding \"global \$config_version;\" to config.php."
- perl -p -e 'print "global \$config_version;\n" if (/^\s*\$config_version/);' \
- "$CONF" > "$CONF.tmp"
- cp_mv "$CONF.tmp" "$CONF"
-fi
-
-# This was missing on some machines
-#
-if ! egrep -q '^[ ]*\$allow_thread_sort' $CONF; then
- to_add='\$allow_thread_sort = false;\n'
- cp_echo "CN: Adding \"\$allow_thread_sort\"."
- perl -p -e 'if (! $a && /^\s*\$edit_name/) {
- $_ .= "'"$to_add"'"; $a = 1; }
- elsif (! $a && /^\?>/) {
- $_ = "'"$to_add"'" . $_; $a = 1; }' \
- $CONF > "$CONF.tmp"
- cp_mv "$CONF.tmp" "$CONF"
-fi
-
-# Shouldn't use /etc/hostname, especially if it contains only the host part
-# replace
-# $domain = implode('', file('/etc/hostname'));
-# with
-# $domain = trim(implode('',file('/etc/'.(file_exists('/etc/mailname')?'mail':'host').'name')));
-#
-if egrep -q "^[[:blank:]]*\\\$domain[[:blank:]]*=[[:blank:]]*implode\\('',[[:blank:]]*file\\('/etc/hostname'\\)\\);" $CONF; then
- nodots=
- nomailname=
- grep -q '\.' /etc/hostname || nodots=1
- [ -e /etc/mailname ] || nomailname=1
- if cp_check_and_sed "^[[:blank:]]*\\\$domain[[:blank:]]*=[[:blank:]]*implode\\('',[[:blank:]]*file\\('/etc/hostname'\\)\\);" \
- "s|^[ \t]*\\\$domain[ \t]*=[ \t]*implode('',[ \t]*file('/etc/hostname'));|\$domain = trim(implode('',file('/etc/'.(file_exists('/etc/mailname')?'mail':'host').'name')));|" \
- $CONF; then
- cp_echo "CN: config.php updated to use either /etc/mailname or /etc/hostname"
- fi
-fi