wok-current rev 2306

lighttpd: backup config files
author Christophe Lincoln <pankso@slitaz.org>
date Tue Feb 24 23:20:43 2009 +0100 (2009-02-24)
parents 443f1bfc5190
children e322190dbc40
files lighttpd/receipt
line diff
     1.1 --- a/lighttpd/receipt	Tue Feb 24 22:24:55 2009 +0100
     1.2 +++ b/lighttpd/receipt	Tue Feb 24 23:20:43 2009 +0100
     1.3 @@ -59,9 +59,6 @@
     1.4  		cp $_pkg/usr/lib/lighttpd/mod_${module}.so $fs/usr/lib/lighttpd
     1.5  		echo -n "Copying : mod_${module}.so" && status
     1.6  	done
     1.7 -	strip -s $fs/usr/bin/*
     1.8 -	strip -s $fs/usr/sbin/*
     1.9 -	strip -s $fs/usr/lib/lighttpd/*
    1.10  	
    1.11  	# Server root and config file.
    1.12  	cp -a stuff/var $fs
    1.13 @@ -80,10 +77,19 @@
    1.14  {
    1.15  	echo "Processing pre-install commands..."
    1.16  	[ -f /etc/init.d/$PACKAGE ] && /etc/init.d/$PACKAGE stop
    1.17 +	# Backup config file.
    1.18 +	if [ -d $1/$CONFIG_FILES ]; then
    1.19 +		cp -a $1/$CONFIG_FILES $1/$CONFIG_FILES.bak
    1.20 +	fi
    1.21  }
    1.22  post_install()
    1.23  {
    1.24  	echo "Processing post-install commands..."
    1.25 +	# Restore original config.
    1.26 +	if [ -d $1/$CONFIG_FILES.bak ]; then
    1.27 +		rm -rf $1/$CONFIG_FILES
    1.28 +		mv $1/$CONFIG_FILES.bak $1/$CONFIG_FILES
    1.29 +	fi
    1.30  	# Just in case.
    1.31  	chown www.www $1/var/log/$PACKAGE
    1.32  	if [ -z "$1" ]; then