On Sun, 15 Nov 2009, Clint Adams wrote:
> I'll ask for xz support.
> 
> This won't work until http://bugs.python.org/issue6715 is resolved.

This is going to be in python3 only apparently. So we should find a
work-around in the mean time I think.

> @@ -198,6 +198,8 @@ class Binary(object):
>                          data = tarfile.open(os.path.join(self.tmpdir, 
> "data.tar.gz"), "r:gz")
>                      elif self.chunks[2] == "data.tar.bz2":
>                          data = tarfile.open(os.path.join(self.tmpdir, 
> "data.tar.bz2" ), "r:bz2")
> +                    elif self.chunks[2] == "data.tar.xz":
> +                        data = tarfile.open(os.path.join(self.tmpdir, 
> "data.tar.xz" ), "r:xz")


That's the only place where it's needed. We could try to extract it on the
fly (xzcat or xz --decompress --stdout) and pass the uncompressed stream with:
tarfile.open(None, "r|", stream)

Quoting http://docs.python.org/library/tarfile.html there's a limitation though:
| For special purposes, there is a second format for mode:
| 'filemode|[compression]'. tarfile.open() will return a TarFile object that
| processes its data as a stream of blocks. No random seeking will be done on 
the
| file. If given, fileobj may be any object that has a read() or write() method
| (depending on the mode). bufsize specifies the blocksize and defaults to 20 *
| 512 bytes. Use this variant in combination with e.g. sys.stdin, a socket file
| object or a tape device. However, such a TarFile object is limited in that it
| does not allow to be accessed randomly, see Examples. The currently possible
| modes:

I haven't checked whether it requires more changes later in the code.

It would be nice to allow data.tar.xz as soon as wheezy opens.

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Follow my Debian News ▶ http://RaphaelHertzog.com (English)
                      ▶ http://RaphaelHertzog.fr (Français)



--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to