[packages/php] use "System/Localtime" tzname (which uses /etc/localtime) if configuration can not be found

glen glen at pld-linux.org
Fri Aug 10 08:42:02 CEST 2012


commit 6aa905153af8c6e0b011740bc328c3360c963d23
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Fri Aug 10 09:39:29 2012 +0300

    use "System/Localtime" tzname (which uses /etc/localtime) if configuration can not be found

 php.spec | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/php.spec b/php.spec
index 4b93a84..e1d243d 100644
--- a/php.spec
+++ b/php.spec
@@ -2533,12 +2533,15 @@ fi
 
 %post common
 # PHP 5.3 requires timezone being setup, try setup it from tzdata
-if ! grep -q '^date.timezone[[:space:]]*=' %{_sysconfdir}/php.ini && [ -f /etc/sysconfig/timezone ]; then
-	TIMEZONE=
-	. /etc/sysconfig/timezone
-	if [ "$TIMEZONE" ]; then
-		%{__sed} -i -e "s,^;date.timezone[[:space:]]*=.*,date.timezone = $TIMEZONE," %{_sysconfdir}/php.ini
+if ! grep -q '^date.timezone[[:space:]]*=' %{_sysconfdir}/php.ini; then
+	if [ -f /etc/sysconfig/timezone ]; then
+		TIMEZONE=
+		. /etc/sysconfig/timezone
+	else
+		TIMEZONE=System/Localtime
 	fi
+
+	%{__sed} -i -e "s,^;date.timezone[[:space:]]*=.*,date.timezone = $TIMEZONE," %{_sysconfdir}/php.ini
 fi
 
 %posttrans common


More information about the pld-cvs-commit mailing list