tazpkg rev 712

tazpkg: backup "official" configuration files with "--newconf" anyway.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Mon Dec 15 04:33:27 2014 +0200 (2014-12-15)
parents 63fb1f016ece
children 8e52f1e7263c
files tazpkg
line diff
     1.1 --- a/tazpkg	Mon Dec 15 04:00:54 2014 +0200
     1.2 +++ b/tazpkg	Mon Dec 15 04:33:27 2014 +0200
     1.3 @@ -785,7 +785,8 @@
     1.4  	if grep -q ^pre_install $ROOT$INSTALLED/$PACKAGE/receipt; then
     1.5  		pre_install $ROOT
     1.6  	fi
     1.7 -	if [ -n "$CONFIG_FILES" ] && ! [ "$newconf" ]; then
     1.8 +
     1.9 +	if [ -n "$CONFIG_FILES" ]; then
    1.10  		# save 'official' configuration files
    1.11  		action 'Saving configuration files...'
    1.12  		for i in $CONFIG_FILES; do
    1.13 @@ -793,13 +794,15 @@
    1.14  		done | { cd fs ; cpio -o -H newc --quiet | gzip -9; cd ..; } > \
    1.15  			$ROOT$INSTALLED/$PACKAGE/volatile.cpio.gz
    1.16  
    1.17 -		# keep user configuration files
    1.18 -		for i in $CONFIG_FILES; do
    1.19 -			{ cd fs ; find ${i#/} -type f 2> /dev/null; cd ..; }
    1.20 -		done | while read i; do
    1.21 -			[ -e $ROOT/$i ] || continue
    1.22 -			cp -a $ROOT/$i fs/$i
    1.23 -		done
    1.24 +		if [ -z "$newconf" ]; then
    1.25 +			# keep user configuration files
    1.26 +			for i in $CONFIG_FILES; do
    1.27 +				{ cd fs ; find ${i#/} -type f 2> /dev/null; cd ..; }
    1.28 +			done | while read i; do
    1.29 +				[ -e $ROOT/$i ] || continue
    1.30 +				cp -a $ROOT/$i fs/$i
    1.31 +			done
    1.32 +		fi
    1.33  		status
    1.34  	fi
    1.35