use --block-list
authorJoey Hess <joey@kitenet.net>
Thu, 12 Jul 2012 16:15:20 +0000 (12:15 -0400)
committerJoey Hess <joey@kitenet.net>
Thu, 12 Jul 2012 16:15:20 +0000 (12:15 -0400)
debian/changelog
pristine-xz

index 115e4bfb6be552ebf3515675592a893312269974..c843436c2ed10c9c3e11abfd2a5ab6ffacc52cdf 100644 (file)
@@ -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 <joeyh@debian.org>  Tue, 19 Jun 2012 09:24:30 -0400
index 28cf247f0491b569f9a4d8d8036f626b57e67235..830559bd3edba284cf5261de3fd5e2ee750e5533 100755 (executable)
@@ -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});