﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
2155	"patch for ""compressdoc"" to automatically use best compression method"	Lars Bamberger	dnicholson@…	"In chapter 3 of the book (Compressing Man and Info Pages) there is a script called ""compressdoc"".
I have added an option '--automatic'. The idea is: Compress using either gzip or bzip2, depending on the size of the file to be compressed. Files larger than 5 kB are bziped, files larger than 1 kB are gziped and files smaller than 1 kB are not compressed.

Here follows the diff from version 20060311.0028 of the script to my version:
{{{
2c2
< # VERSION: 20060311.0028
---
> # VERSION: 20060903.2149
27a28,30
> # Modified 20060903 by Lars Bamberger to (sort of) automatically choose
> # a compression method based on the size of the manpage.
> #
31,33d33
< #     - offer an option to automagically choose the best compression
< #       methed on a per page basis (eg. check which of
< #       gzip/bzip2/whatever is the most effective, page per page);
51a52,57
>   --automatic
>               Compress using either gzip or bzip2, depending on the
>               size of the file to be compressed. Files larger than 5
>               kB are bziped, files larger than 1 kB are gziped and
>               files smaller than 1 kB are not compressed.
>
181a188,192
>     --automatic)
>       COMP_SUF=TBD
>       COMP_METHOD=$1
>       shift
>       ;;
288a300
>     --automatic) echo -n ""depending on file size"";;
429a442,453
>       # Find out which compression method to use
>       if COMP_METHOD=""--automatic"" ;
>       then
>               # filter the size of the file from the output of 'ls'
>               if (($(ls -k -s $FILE | sed ""s@\([[:digit:]]\+\)\(.*\)@\1@"") >=
5)) ;
>                 then COMP_SUF=.bz2 ;
>               elif (($(ls -k -s $FILE | sed ""s@\([[:digit:]]\+\)\(.*\)@\1@"") >= 1)) ;
>               then COMP_SUF=.gz ;
>               else COMP_SUF="""" ;
>                 fi ;
>       fi
>
}}}



"	enhancement	closed	low	6.3	BOOK	SVN	low	fixed		
