Bazaar doesn't support .tar.xz

Bug #551714 reported by TDJACR
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Jelmer Vernooij

Bug Description

I've noticed many distributions of Linux starting to support and use .tar.xz for various utilities. It'd be great if the export command were to accept such a function.

Related branches

TDJACR (thedjatclubrock)
Changed in bzr:
status: New → Confirmed
tags: added: compression export wishlist
Revision history for this message
TDJACR (thedjatclubrock) wrote :

Looking at the code more closely, it appears if that part of the export function is implemented with the python tarfile library, which doesn't appear to support .xz at the moment. Continuing to investigate further.

Revision history for this message
TDJACR (thedjatclubrock) wrote :

Feature request upstream: http://bugs.python.org/issue8266 for the tarfile library and http://bugs.python.org/issue6715 for xz in general. Suggested they take a look at https://launchpad.net/pyliblzma

Revision history for this message
TDJACR (thedjatclubrock) wrote :

Linked to a completed branch pending inclusion in Python's tarfile library in the same manner as gzip ang bzip2.

Changed in bzr:
status: Confirmed → In Progress
assignee: nobody → thedjatclubrock (thedjatclubrock)
Revision history for this message
TDJACR (thedjatclubrock) wrote :

The upstream bug was a duplicate, see http://bugs.python.org/issue5689 for the main discussion.

Revision history for this message
TDJACR (thedjatclubrock) wrote :

=== modified file 'bzrlib/export/__init__.py'
--- bzrlib/export/__init__.py 2010-03-25 09:39:03 +0000
+++ bzrlib/export/__init__.py 2010-03-30 14:50:10 +0000
@@ -181,5 +181,6 @@
 register_lazy_exporter('tar', ['.tar'], 'bzrlib.export.tar_exporter', 'tar_exporter')
 register_lazy_exporter('tgz', ['.tar.gz', '.tgz'], 'bzrlib.export.tar_exporter', 'tgz_exporter')
 register_lazy_exporter('tbz2', ['.tar.bz2', '.tbz2'], 'bzrlib.export.tar_exporter', 'tbz_exporter')
+register_lazy_exporter('txz', ['.tar.xz', '.txz'], 'bzrlib.export.tar_exporter', 'txz_exporter')
 register_lazy_exporter('zip', ['.zip'], 'bzrlib.export.zip_exporter', 'zip_exporter')

=== modified file 'bzrlib/export/tar_exporter.py'
--- bzrlib/export/tar_exporter.py 2010-03-25 09:39:03 +0000
+++ bzrlib/export/tar_exporter.py 2010-03-30 14:50:25 +0000
@@ -102,3 +102,11 @@
                  per_file_timestamps=False):
     tar_exporter(tree, dest, root, subdir, compression='bz2',
                  filtered=filtered, per_file_timestamps=per_file_timestamps)
+
+
+def txz_exporter(tree, dest, root, subdir, filtered=False,
+ per_file_timestamps=False):
+ tar_exporter(tree, dest, root, subdir, compression='xz',
+ filtered=filtered, per_file_timestamps=per_file_timestamps)
+
+

Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 551714] Re: Bazaar doesn't support .tar.xz

Thanks for that.

We should probably add a test for this, which can check both that it
works if xz is supported, and that it fails cleanly if you're using a
Python without it. Please have a look in the existing test_export.

--
Martin <http://launchpad.net/~mbp/>

Revision history for this message
TDJACR (thedjatclubrock) wrote :

Taking a look right now -- if I understand correctly, xz isn't supported in Python at all at the moment, and that patch would only work pending xz's inclusion in the tarfile library in the same manner as gz and bz2.

Thanks

Revision history for this message
Martin Pool (mbp) wrote :

On 31 March 2010 12:00, TDJACR <email address hidden> wrote:
> Taking a look right now -- if I understand correctly, xz isn't supported
> in Python at all at the moment, and that patch would only work pending
> xz's inclusion in the tarfile library in the same manner as gz and bz2.

If you wanted you could try running xz as a subprocess, so this could
work on any Python if you have the program installed...

--
Martin <http://launchpad.net/~mbp/>

Jelmer Vernooij (jelmer)
Changed in bzr:
assignee: TDJACR (thedjatclubrock) → Jelmer Vernooij (jelmer)
Jelmer Vernooij (jelmer)
Changed in bzr:
importance: Undecided → Medium
Jelmer Vernooij (jelmer)
Changed in bzr:
status: In Progress → Fix Released
milestone: none → 2.4b1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.