From: Joey Hess Date: Thu, 12 Jul 2012 16:15:20 +0000 (-0400) Subject: use --block-list X-Git-Tag: 1.26~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9310dc78f6cb55ad68ec343b021af839083bef70;p=tools%2Fpristine-tar.git use --block-list --- diff --git a/debian/changelog b/debian/changelog index 115e4bf..c843436 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,8 @@ pristine-tar (1.26) UNRELEASED; urgency=low * pristine-xz: Use xz --robot to extract information from xz files, - avoiding the need to do more expensive guessing. Will also later - allow supporting files needing --block-split (once upstream xz - provides that option; a patch has been submitted). + avoiding the need to do more expensive guessing. Support --block-list + when available to reproduce multi block files. Closes: #677250 Thanks, Vincent Ladeuil -- Joey Hess Tue, 19 Jun 2012 09:24:30 -0400 diff --git a/pristine-xz b/pristine-xz index 28cf247..830559b 100755 --- a/pristine-xz +++ b/pristine-xz @@ -168,7 +168,7 @@ sub scan_xz_lvv_robot { sub predict_xz_args { my ($xz) = @_; my $presets = undef; - my $block_split = undef; + my $block_list = undef; my $blocks = $xz->{blocks}; if (scalar(@$blocks)) { # There is at least one block. We assume the same compression @@ -199,13 +199,13 @@ sub predict_xz_args { } if (scalar(@$blocks) > 1) { # Gather the block uncompressed sizes - $block_split = join(',', map {$_->{uncompressed_size}} + $block_list = join(',', map {$_->{uncompressed_size}} @$blocks); } } - # FIXME: none is missing my %check_kwd_of = - (CRC32 => 'crc32', + (None => 'none', + CRC32 => 'crc32', CRC64 => 'crc64', 'SHA-256' => 'sha256', ); @@ -215,11 +215,8 @@ sub predict_xz_args { my $possible_args = []; my $common = ["--check=$check_kwd", "-z"]; - # FIXME: --block-split is not (yet) part of xz-utils upstream - if (0 && defined($block_split)) { - # We put the block list in front of the parameters to make it - # easier to filter it later. - unshift @$common, "--block-split=$block_split"; + if (defined($block_list)) { + unshift @$common, "--block-list=$block_list"; } foreach my $preset (@$presets) { push @$possible_args, [@$common, "-$preset"]; @@ -350,8 +347,11 @@ sub genxz { next if $param=~/^(-[0-9]e?)$/; next if $param eq '-z'; + next if $param eq '--check=none'; next if $param eq '--check=crc32'; + next if $param eq '--check=crc64'; next if $param eq '--check=sha256'; + next if $param=~/^(--block-list=[0-9,]+)$/; die "paranoia check failed on params from delta (@params)"; } @params=split(' ', $delta->{params});