[packages/lighttpd] print deprecated warning of url.rewrite or url.rewrite-final from config

glen glen at pld-linux.org
Fri Sep 28 16:54:07 CEST 2012


commit 0ba2e99cdddea434151bdf7c34f673acf6b30665
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Fri Sep 28 17:53:51 2012 +0300

    print deprecated warning of url.rewrite or url.rewrite-final from config

 lighttpd.init | 12 +++++++++++-
 lighttpd.spec |  2 +-
 2 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/lighttpd.spec b/lighttpd.spec
index 7de75c5..ae27142 100644
--- a/lighttpd.spec
+++ b/lighttpd.spec
@@ -29,7 +29,7 @@ Summary:	Fast and light HTTP server
 Summary(pl.UTF-8):	Szybki i lekki serwer HTTP
 Name:		lighttpd
 Version:	1.4.31
-Release:	2
+Release:	3
 License:	BSD
 Group:		Networking/Daemons/HTTP
 Source0:	http://download.lighttpd.net/lighttpd/releases-1.4.x/%{name}-%{version}.tar.bz2
diff --git a/lighttpd.init b/lighttpd.init
index 0ea7629..aaf4d5f 100755
--- a/lighttpd.init
+++ b/lighttpd.init
@@ -33,6 +33,16 @@ else
 fi
 
 configtest() {
+	# check for deprecated config options that cause bad side effects
+	# TODO: should remove the deprecated options in pld after some time being warned out
+	local out
+	out=$(env SHELL=/bin/sh $DAEMON -f $CONFIGFILE $HTTPD_OPTS -p 2>&1 | grep -oE '(url.rewrite|url.rewrite-final)[[:space:]]')
+	if [ -n "$out" ]; then
+		# make it unique, format nicely
+		out=$(echo "$out" | sort -u | xargs | sed -e 's/ /, /g')
+		echo >&2 "WARNING: found deprecated '$out', convert to 'url.rewrite-final' recommented, See http://redmine.lighttpd.net/issues/2379"
+	fi
+
 	env SHELL=/bin/sh $DAEMON -t -f $CONFIGFILE $HTTPD_OPTS
 }
 
@@ -132,7 +142,7 @@ reload() {
 		return
 	fi
 
-	checkconfig
+	checkconfig 1
 	msg_reloading "Lighttpd Web Server"
 
 	if is_yes "${LIGHT_ANGEL}"; then
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/lighttpd.git/commitdiff/0ba2e99cdddea434151bdf7c34f673acf6b30665



More information about the pld-cvs-commit mailing list