wok-6.x rev 5062

xz: set size for lzma_alone
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Mar 11 12:07:58 2010 +0100 (2010-03-11)
parents b4fa2f5e2632
children 782e21486f94
files xz/stuff/lzma
line diff
     1.1 --- a/xz/stuff/lzma	Wed Mar 10 11:52:09 2010 +0100
     1.2 +++ b/xz/stuff/lzma	Thu Mar 11 12:07:58 2010 +0100
     1.3 @@ -66,7 +66,7 @@
     1.4  		shift
     1.5  	done
     1.6  	for i in $files; do
     1.7 -		xz $args $i || break
     1.8 +		xz $args $i || exit
     1.9  		[ "lzma" == "$suffix" ] || mv ${i%.*}.lzma ${i%.*}.$suffix
    1.10  	done
    1.11  	exit
    1.12 @@ -101,4 +101,16 @@
    1.13  done
    1.14  
    1.15  # fake lzma_alone (-eos -mt1)
    1.16 -eval exec xz $args --format=lzma --$mode$extra --stdout $input $output
    1.17 +eval xz $args --format=lzma --$mode$extra --stdout $input $output
    1.18 +status=$?
    1.19 +if [ -n "$input" -a -n "$output" ]; then
    1.20 +	size=$(stat -c "%s" ${input#< })
    1.21 +	ascii="00000 "
    1.22 +	for i in 1 2 3 4 5 6 7 8; do
    1.23 +		ascii="$ascii $(printf "%02x" $((size % 256)) )"
    1.24 +		size=$(( $size / 256 ))
    1.25 +	done
    1.26 +	echo "$ascii | .." | hexdump -R | \
    1.27 +	dd of=${output#> } seek=5 bs=1 conv=notrunc 2> /dev/null
    1.28 +fi
    1.29 +exit $status