[jhbuild] Tarball Repository: add xz support, fix lzma (GNOME bug 615801)



commit 100ab4670fa2ce9313179342ac5a0206e6578a36
Author: Dmitrijs Ledkovs <dmitrij ledkov ubuntu com>
Date:   Thu Apr 15 00:19:52 2010 +0100

    Tarball Repository: add xz support, fix lzma (GNOME bug 615801)

 jhbuild/utils/unpack.py           |    5 ++++-
 jhbuild/versioncontrol/tarball.py |    2 ++
 2 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/jhbuild/utils/unpack.py b/jhbuild/utils/unpack.py
index cca8f67..d20d3bb 100644
--- a/jhbuild/utils/unpack.py
+++ b/jhbuild/utils/unpack.py
@@ -113,7 +113,10 @@ def unpack_archive(buildscript, localfile, target_directory):
     if ext == '.lzma' and has_command('lzcat') and has_command('tar'):
         buildscript.execute('lzcat -d "%s" | tar xf -' % localfile,
                 cwd = target_directory)
-    if ext == '.bz2' and has_command('bunzip2') and has_command('tar'):
+    elif ext == '.xz' and has_command('xzcat') and has_command('tar'):
+        buildscript.execute('xzcat -d "%s" | tar xf -' % localfile,
+                cwd = target_directory)
+    elif ext == '.bz2' and has_command('bunzip2') and has_command('tar'):
         buildscript.execute('bunzip2 -dc "%s" | tar xf -' % localfile,
                 cwd = target_directory)
     elif ext in ('.gz', '.tgz') and has_command('gunzip') and has_command('tar'):
diff --git a/jhbuild/versioncontrol/tarball.py b/jhbuild/versioncontrol/tarball.py
index ae4ab22..53095a7 100644
--- a/jhbuild/versioncontrol/tarball.py
+++ b/jhbuild/versioncontrol/tarball.py
@@ -136,6 +136,8 @@ class TarballBranch(Branch):
             localdir = localdir[:-8]
         elif localdir.endswith('.tar.lzma'):
             localdir = localdir[:-9]
+        elif localdir.endswith('.tar.xz'):
+            localdir = localdir[:-7]
         elif localdir.endswith('.tgz'):
             localdir = localdir[:-4]
         elif localdir.endswith('.zip'):



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]