check_php_version () {
if pkg php4-cn && ! pkg php5-cn; then
+ # prepare for php upgrade by installing php5 extensions
+ install_php5_extensions
+
notice "
Prije prelaska na Debian Lenny potrebno je napraviti nadogradnju sa PHP 4 na PHP 5.
fi
}
+# install php5 extensions based on installed php4 extensions
+install_php5_extensions () {
+ local php4_list php5_pkg
+
+ # get a list of installed php4 packages
+ php4_list=$(mktemp /var/lib/carnet-upgrade/php4_list.XXXXXX)
+ dpkg -l php4-\* | awk '/^ii/ {
+ pkg=$2; sub("^php4", "php5", pkg); print pkg }' > $php4_list
+
+ # compare it with the list of available php5 packages
+ php5_pkg=$(apt-cache search -n ^php5- | cut -d' ' -f 1 \
+ | grep -F -x -f $php4_list | grep -F -x -v php5-cn)
+
+ # handle special cases
+ if pkg php4-xslt; then
+ php5_pkg="$php5_pkg php5-xsl"
+ fi
+
+ # install the required php5 modules
+ if [ "$php5_pkg" ]; then
+ pkgadd $php5_pkg
+ fi
+
+ # cleanup
+ rm -f $php4_list
+}
+
# if grsec is installed make sure it is fresh
check_grsec_kernel () {
local ver=`uname -r`