[arch-commits] CVS update of extra/devel/php (PKGBUILD php.install)

Pierre Schmitz pierre at archlinux.org
Sat Sep 22 17:06:08 UTC 2007


    Date: Saturday, September 22, 2007 @ 13:06:08
  Author: pierre
    Path: /home/cvs-extra/extra/devel/php

Modified: PKGBUILD (1.107 -> 1.108) php.install (1.6 -> 1.7)

make the update from old config dir smoother


-------------+
 PKGBUILD    |    4 ++--
 php.install |   30 ++++++++++++++++++++----------
 2 files changed, 22 insertions(+), 12 deletions(-)


Index: extra/devel/php/PKGBUILD
diff -u extra/devel/php/PKGBUILD:1.107 extra/devel/php/PKGBUILD:1.108
--- extra/devel/php/PKGBUILD:1.107	Sat Sep 22 08:25:41 2007
+++ extra/devel/php/PKGBUILD	Sat Sep 22 13:06:08 2007
@@ -1,4 +1,4 @@
-# $Id: PKGBUILD,v 1.107 2007/09/22 12:25:41 pierre Exp $
+# $Id: PKGBUILD,v 1.108 2007/09/22 17:06:08 pierre Exp $
 # Maintainer: Pierre Schmitz <pierre at archlinux.de>
 pkgname=php
 pkgver=5.2.4
@@ -8,7 +8,7 @@
 arch=('i686' 'x86_64')
 license=('PHP')
 url='http://www.php.net'
-backup=('etc/php.ini' 'etc/php/php.ini') # workaround: save old php.ini; remove this for later versions of php
+backup=('etc/php/php.ini')
 install=php.install
 depends=('glibc')
 makedepends=('apache' 'imap' 'postgresql-libs' 'mysql' 'libldap' 'smtp-server' \
Index: extra/devel/php/php.install
diff -u extra/devel/php/php.install:1.6 extra/devel/php/php.install:1.7
--- extra/devel/php/php.install:1.6	Sat Sep 22 08:25:41 2007
+++ extra/devel/php/php.install	Sat Sep 22 13:06:08 2007
@@ -1,6 +1,6 @@
 post_install() {
   echo '
-==> PHP modules
+    ==> PHP modules
 
     PHP has been built with optional modules. To enable these modules,
     uncomment the modules from php.ini
@@ -24,37 +24,47 @@
         * tidy               : tidyhtml
         * xsl                : libxslt
 
-==> PHP-CGI and FCGI
+    ==> PHP-CGI and FCGI
 
     There are several cgi relevant settings in your php.ini. Make sure to
     adjust them according to your needs. At least you should activate the
     cgi.fix_pathinfo directive in php.ini by uncommenting it.
-'
+    '
+}
+
+pre_upgrade() {
+  if [ -f /etc/php.ini ] && [ $(vercmp '5.2.4-2' $2) -ge 0 ];then
+    mv /etc/php.ini /etc/php.ini.pacsave.tmp
+  fi
 }
 
 post_upgrade() {
   post_install
   echo '
-==> Review your php.ini
+    ==> Review your php.ini
 
     Your php installation has been updated. You should review your current
     php.ini and check any upstream changes according to the default
     configuration which can be found at php.ini.pacnew.
-'
-  [ -f /etc/php.ini ] && mv /etc/php.ini /etc/php/php.ini.pacsave && echo '
-==> Location of php.ini has changed
+    '
+  if [ -f /etc/php.ini.pacsave.tmp ] && [ $(vercmp '5.2.4-2' $2) -ge 0 ]; then
+    mv /etc/php/php.ini /etc/php/php.ini.pacnew
+    mv /etc/php.ini.pacsave.tmp /etc/php/php.ini
+    echo '
+    ==> Location of php.ini has changed
 
     A previous configuration was found at /etc/php.ini. PHP stores its
     configuration at /etc/php/ now. Your old php.ini was moved to
-    /etc/php/php.ini.pacsave. You should merge your old file with the
-    default one that can be found at /etc/php/.
+    /etc/php/php.ini. You should merge your old file with the
+    default one that can be found at /etc/php/php.ini.pacnew.
 
     Make sure to enable the modules you need. A lot of them are shared
     objects now and not statically built into php.
 
     External modules store their configuration in /etc/php/conf.d/. PHP
     scans that directory for any ini files.
-'
+    '
+    fi
 }
 
 op=$1




More information about the arch-commits mailing list