spk rev 156 1.4.2

Fix saving config installed config files
author Christophe Lincoln <pankso@slitaz.org>
date Wed Apr 30 00:03:26 2014 +0200 (2014-04-30)
parents faf8a6708713
children 611b9d4fcd73
files spk-add
line diff
     1.1 --- a/spk-add	Fri Apr 25 18:41:41 2014 +0100
     1.2 +++ b/spk-add	Wed Apr 30 00:03:26 2014 +0200
     1.3 @@ -72,7 +72,8 @@
     1.4  install_package() {
     1.5  	local package_file=$1
     1.6  
     1.7 -	# Set by receipt: pre_depends() DEPENDS SELF_INSTALL CONFIG_FILES post_install()
     1.8 +	# Set by receipt: pre_depends() DEPENDS SELF_INSTALL CONFIG_FILES 
     1.9 +	# pre_install post_install()
    1.10  
    1.11  	local package_name=$PACKAGE
    1.12  	local package_dir="$installed/$package_name"
    1.13 @@ -195,10 +196,17 @@
    1.14  	# Handle Config Files set in receipt. Keep system configs: they can
    1.15  	# be modified/customized by users, slitaz-config, etc.
    1.16  	if [ "$CONFIG_FILES" ] && [ ! "$newconf" ]; then
    1.17 -		gettext "Keeping configuration files..."
    1.18 +		ccf="$(echo $CONFIG_FILES | wc -l)"
    1.19 +		colorize 34 "$(gettext 'Keeping configuration files: '; echo $ccf)"
    1.20  		for file in ${CONFIG_FILES}; do
    1.21 -			cp -f ${file} fs/ 2>/dev/null
    1.22 -		done; status
    1.23 +			if [ -f "${file}" ]; then
    1.24 +				gettext "Keeping:"; echo -n " $file"
    1.25 +				dir=$(dirname $file)
    1.26 +				cp -f ${file} fs/${dir}; 2>/dev/null status
    1.27 +				debug "cp -f ${file} fs/${dir}"
    1.28 +			fi
    1.29 +		done
    1.30 +		unset CONFIG_FILES
    1.31  	fi
    1.32  	
    1.33  	# Merge package FS with $root