tazlito rev 405

iso2flavor: take care of files with space
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Nov 24 14:44:12 2015 +0100 (2015-11-24)
parents b24f0f72ecf8
children 1bfe19fbb289
files tazlito
line diff
     1.1 --- a/tazlito	Tue Nov 24 12:56:25 2015 +0100
     1.2 +++ b/tazlito	Tue Nov 24 14:44:12 2015 +0100
     1.3 @@ -1143,9 +1143,9 @@
     1.4  	# Verify md5
     1.5  	cat $1$INSTALLED/*/md5sum | \
     1.6  	while read md5 file; do
     1.7 -		[ -e $1$file ] || continue
     1.8 -		[ "$(md5sum < $1$file)" == "$md5  -" ] &&
     1.9 -		rm -f $1$file
    1.10 +		[ -e "$1$file" ] || continue
    1.11 +		[ "$(md5sum < "$1$file")" == "$md5  -" ] &&
    1.12 +		rm -f "$1$file"
    1.13  	done
    1.14  
    1.15  	# Check configuration files
    1.16 @@ -1155,18 +1155,18 @@
    1.17  		zcat $i | ( cd /tmp/volatile$$ ; cpio -idmu > /dev/null 2>&1 )
    1.18  		( cd /tmp/volatile$$ ; find * -type f 2> /dev/null) | \
    1.19  		while read file ; do
    1.20 -			[ -e $1/$file ] || continue
    1.21 -			cmp -s /tmp/volatile$$/$file $1/$file && rm -f $1/$file
    1.22 +			[ -e "$1/$file" ] || continue
    1.23 +			cmp -s "/tmp/volatile$$/$file" "$1/$file" && rm -f "$1/$file"
    1.24  		done
    1.25  		rm -rf /tmp/volatile$$
    1.26  	done
    1.27  
    1.28  	# Remove other files blindly
    1.29  	for i in $1$INSTALLED/*/files.list; do
    1.30 -		for file in $(cat $i); do
    1.31 -			[ $1$file -nt $i ] && continue
    1.32 -			[ -f $1$file -a ! -L $1$file ] && continue
    1.33 -			[ -d $1$file ] || rm -f $1$file
    1.34 +		for file in $(cat "$i"); do
    1.35 +			[ "$1$file" -nt "$i" ] && continue
    1.36 +			[ -f "$1$file" -a ! -L "$1$file" ] && continue
    1.37 +			[ -d "$1$file" ] || rm -f "$1$file"
    1.38  		done
    1.39  	done
    1.40  
    1.41 @@ -1180,7 +1180,7 @@
    1.42  	# Cleanup directory tree
    1.43  	cd $1
    1.44  	find * -type d | sort -r | while read dir; do
    1.45 -		rmdir $dir 2> /dev/null
    1.46 +		rmdir "$dir" 2> /dev/null
    1.47  	done
    1.48  	cd - > /dev/null
    1.49  }