Bug#506861: python-debian: support data.tar.xz member

Guillem Jover guillem at debian.org
Sat Dec 15 07:26:59 UTC 2012


Hi!

On Fri, 2012-06-29 at 00:57:03 +0100, Stuart Prescott wrote:
> For python < 3.3, the unxz utility from the xz-utils package is used to 
> decompress the member which is then fed into the python tarfile module as would 
> be done for gz or bz2 members. This is crude but works fine. Perhaps python-
> debian and python3-debian (until python 3.3 at least) should Recommend xz-
> utils as a result. Perhaps better error handling around the subprocess would 
> be advisable for the absence of unxz(1) on the system.

I think this should really be fixed for wheezy, as there's an
increasing number of .xz compressed binary packages in the archive
already, not doing so will mean python-debian is not usable there.

> diff --git a/lib/debian/debfile.py b/lib/debian/debfile.py
> index a728a77..84b88aa 100644
> --- a/lib/debian/debfile.py
> +++ b/lib/debian/debfile.py
> @@ -27,7 +28,7 @@ from debian.deb822 import Deb822
>  
>  DATA_PART = 'data.tar'      # w/o extension
>  CTRL_PART = 'control.tar'
> -PART_EXTS = ['gz', 'bz2']   # possible extensions
> +PART_EXTS = ['gz', 'bz2', 'xz']   # possible extensions

I guess it would make sense to handle .lzma compressed members too, as
dpkg-deb has supported generating those up to now, they might be found
in the wild, although creating new such .debs has been deprecated, but
that still does not make existing packages disappear, so at least
dpkg-deb will continue supporting extraction for the forseeable future.

Thanks,
Guillem



More information about the pkg-python-debian-maint mailing list