Vincent Ladeuil wrote: > The attached patch does a better job than my first shot: it relies on > 'xz -lvv --robot' do get as much information as possible from the file > itself. > > That reduces the guessing to --extreme and one of (3/4) or (5/6) if > their associated dict size is recognized. > > I've disabled the multi-block (--block-split) parameter as xz-utils does > not provide it yet (but I've tested a patch from upstream to that effect > and will follow up when it becomes available). > > The attached patch still reduces the number of xz tries and fallback to > the previous guessing is something goes wrong during the file > reading. > > I've successfully used it (*with* --block-split) for ~140 multi-block files.
Looks promising, thanks..
> + if (scalar(@filters) != 1 || $filters[0] !~ /^--lzma2=/) {
> + die "Only LZMA2 is supported" ;
> + die "Unkown dict size: $dict_size\n" if (!defined($presets)) ;
> + my $check_kwd = $check_kwd_of{$check_name} ;
> + die "Unknown xz check: $check_name\n" if (!defined($check_kwd)) ;
Could it just fall back to the old guessing behavior instead of dying?
> + foreach my $program (@supported_xz_programs) {
> + # try to guess the xz arguments that are needed
> foreach my $args (predictxzargs($possible_levels, $program)) {
> - testvariant($orig, $tmpin, $program, @$args)
> - && return $program, @$args;
> + testvariant($orig, $tmpin, $program, @$args)
> + && return $program, @$args;
Your editor is replacing tabs with spaces..
--
see shy jo
signature.asc
Description: Digital signature

