Truncate ex2.bam irrespective of its size
authorDebian Med Packaging Team <debian-med-packaging@lists.alioth.debian.org>
Sun, 2 Oct 2022 09:41:36 +0000 (11:41 +0200)
committerÉtienne Mollier <emollier@debian.org>
Sun, 2 Oct 2022 09:41:36 +0000 (11:41 +0200)
commitf4a32d44d70adb5a795f7f69f58e3ec42dbc18c2
tree7ca1baa3e674bd6b2d20f3b5ace8b362aab4f296
parent66914d0ae51816309747a181716af4c2175d4a6b
Truncate ex2.bam irrespective of its size

Bug: https://github.com/pysam-developers/pysam/issues/1128
Applied-Upstream: 56b1624c21b02762fdcea3aa5f657a4152ca178e
Reviewed-by: Étienne Mollier <emollier@debian.org>
Last-Update: 2022-10-02

The Makefile also builds ex2.bam from ex2.sam via `samtools view`.
Samtools as traditionally built using zlib typically generates a
124703-byte file, whereas when built using libdeflate it typically
generates a 122804-byte file -- but `head -c 124000` leaves that unchanged
and the test cases fail because ex2_truncated.bam is unexpectedly valid.

Rewrite the truncation rule to remove the final 512 bytes, irrespective
of ex2.bam's length. (No practical compression will reduce it to less
than 512 bytes in total, so this is safe.) Fixes #1128.
Last-Update: 2022-10-02
Gbp-Pq: Name test-truncated-bam.patch
tests/pysam_data/Makefile