diff options
author | Dmitry Bogatov <KAction@debian.org> | 2018-12-02 05:36:56 +0000 |
---|---|---|
committer | Dmitry Bogatov <KAction@debian.org> | 2018-12-02 05:36:56 +0000 |
commit | a17df1c35c397d008c7990ea7ba8b8a2d9525c8c (patch) | |
tree | 4d649ad69e4497a33518aa77a2886b78ea311806 | |
parent | 11470c63662bffe68b6b5fbfccdf5f34d208bcb6 (diff) |
Import Upstream version 6.6
-rw-r--r-- | INSTALL | 7 | ||||
-rw-r--r-- | NEWS | 16 | ||||
-rw-r--r-- | PKG-INFO | 4 | ||||
-rwxr-xr-x | scripts/dtrx | 12 | ||||
-rw-r--r-- | setup.py | 4 | ||||
-rw-r--r-- | tests/compare.py | 4 | ||||
-rw-r--r-- | tests/test-text.xz | bin | 0 -> 60 bytes | |||
-rw-r--r-- | tests/tests.yml | 18 |
8 files changed, 48 insertions, 17 deletions
@@ -54,6 +54,9 @@ Files compressed with bzip2 Files compressed with lzma lzcat +Files compressed with xz + xzcat + Installation ------------ @@ -73,9 +76,9 @@ Simply run the following command from the dtrx source directory:: python tests/compare.py -To run the tests, you'll need the `syck module`_. +To run the tests, you'll need the `PyYAML module`_. -.. _syck module: http://whytheluckystiff.net/syck/ +.. _PyYAML module: http://pyyaml.org/ If everything's in order, all the tests should pass. Note that some of them will fail if some of the programs listed above aren't installed on @@ -1,6 +1,22 @@ Changes in dtrx =============== +Version 6.6 +----------- + +Enhancements +~~~~~~~~~~~~ + + * dtrx can now handle `xz compression`_. + +.. _xz compression: http://tukaani.org/xz/ + +Other changes +~~~~~~~~~~~~~ + + * The tests now use the PyYAML library, instead of the abandoned Syck. + Thanks to Miguelangel Jose Freitas Loreto for a patch. + Version 6.5 ----------- @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: dtrx -Version: 6.5 +Version: 6.6 Summary: Script to intelligently extract multiple archive types Home-page: http://www.brettcsmith.org/2007/dtrx/ Author: Brett Smith @@ -11,7 +11,7 @@ Description: dtrx extracts archives in a number of different formats; it currently supports tar, zip (including self-extracting .exe files), cpio, rpm, deb, gem, 7z, cab, rar, and InstallShield files. It can also decompress files compressed with gzip, bzip2, - lzma, or compress. + lzma, xz, or compress. In addition to providing one command to handle many different archive types, dtrx also aids the user by extracting contents consistently. diff --git a/scripts/dtrx b/scripts/dtrx index f053989..7a98ba5 100755 --- a/scripts/dtrx +++ b/scripts/dtrx @@ -44,7 +44,7 @@ try: except NameError: from sets import Set as set -VERSION = "6.5" +VERSION = "6.6" VERSION_BANNER = """dtrx version %s Copyright © 2006-2009 Brett Smith <brettcsmith@brettcsmith.org> Copyright © 2008 Peter Kelemen <Peter.Kelemen@gmail.com> @@ -80,6 +80,7 @@ RECURSE_LIST = 5 mimetypes.encodings_map.setdefault('.bz2', 'bzip2') mimetypes.encodings_map.setdefault('.lzma', 'lzma') +mimetypes.encodings_map.setdefault('.xz', 'xz') mimetypes.types_map.setdefault('.gem', 'application/x-ruby-gem') logger = logging.getLogger('dtrx-log') @@ -138,7 +139,7 @@ EXTRACTION_ERRORS = (ExtractorError, ExtractorUnusable, OSError, IOError) class BaseExtractor(object): decoders = {'bzip2': 'bzcat', 'gzip': 'zcat', 'compress': 'zcat', - 'lzma': 'lzcat'} + 'lzma': 'lzcat', 'xz': 'xzcat'} name_checker = DirectoryChecker def __init__(self, filename, encoding): @@ -884,17 +885,20 @@ class ExtractorBuilder(object): for mapping in (('tar', 'bzip2', 'tar.bz2', 'tbz2', 'tb2', 'tbz'), ('tar', 'gzip', 'tar.gz', 'tgz'), ('tar', 'lzma', 'tar.lzma', 'tlz'), + ('tar', 'xz', 'tar.xz'), ('tar', 'compress', 'tar.Z', 'taz'), ('compress', 'gzip', 'Z', 'gz'), ('compress', 'bzip2', 'bz2'), - ('compress', 'lzma', 'lzma')): + ('compress', 'lzma', 'lzma'), + ('compress', 'xz', 'xz')): for extension in mapping[2:]: extension_map.setdefault(extension, []).append(mapping[:2]) magic_encoding_map = {} for mapping in (('bzip2', 'bzip2 compressed'), ('gzip', 'gzip compressed'), - ('lzma', 'LZMA compressed')): + ('lzma', 'LZMA compressed'), + ('xz', 'xz compressed')): for pattern in mapping[1:]: magic_encoding_map[re.compile(pattern)] = mapping[0] @@ -3,7 +3,7 @@ from distutils.core import setup setup(name="dtrx", - version = "6.5", + version = "6.6", description = "Script to intelligently extract multiple archive types", author = "Brett Smith", author_email = "brettcsmith@brettcsmith.org", @@ -24,7 +24,7 @@ setup(name="dtrx", formats; it currently supports tar, zip (including self-extracting .exe files), cpio, rpm, deb, gem, 7z, cab, rar, and InstallShield files. It can also decompress files compressed with gzip, bzip2, - lzma, or compress. + lzma, xz, or compress. In addition to providing one command to handle many different archive types, dtrx also aids the user by extracting contents consistently. diff --git a/tests/compare.py b/tests/compare.py index 7927467..56122aa 100644 --- a/tests/compare.py +++ b/tests/compare.py @@ -20,7 +20,7 @@ import os import re import subprocess -import syck +import yaml import sys import tempfile @@ -220,7 +220,7 @@ class ExtractorTest(object): test_db = open('tests.yml') -test_data = syck.load(test_db.read(-1)) +test_data = yaml.load(test_db.read(-1)) test_db.close() tests = [ExtractorTest(**data) for data in test_data] for original_data in test_data: diff --git a/tests/test-text.xz b/tests/test-text.xz Binary files differnew file mode 100644 index 0000000..75ef861 --- /dev/null +++ b/tests/test-text.xz diff --git a/tests/tests.yml b/tests/tests.yml index a0758f0..95f0aef 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -107,6 +107,14 @@ posttest: | if [ "x`cat test-text`" != "xhi" ]; then exit 1; fi +- name: decompressing xz + directory: inside-dir + filenames: ../test-text.xz + baseline: | + xzcat $1 >test-text + posttest: | + if [ "x`cat test-text`" != "xhi" ]; then exit 1; fi + - name: decompression with -r directory: inside-dir filenames: ../test-text.gz @@ -191,7 +199,7 @@ filenames: tests.yml options: -n -qq error: true - antigrep: . + antigrep: '.' - name: can't write to directory directory: inside-dir @@ -461,7 +469,7 @@ input: | h o - grep: "contains 2 other archive file\(s\), out of 2 file\(s\)" + grep: 'contains 2 other archive file\(s\), out of 2 file\(s\)' baseline: | tar -xf $1 cd subdir @@ -511,7 +519,7 @@ filenames: trickery.tar.gz prerun: cp ${1}test-1.23.zip ${1}trickery.tar.gz cleanup: rm -f ${1}trickery.tar.gz - antigrep: . + antigrep: '.' baseline: | mkdir trickery cd trickery @@ -646,7 +654,7 @@ r l n - grep: "^test-deep-recursion/subsubdir/test-text\.gz$" + grep: '^test-deep-recursion/subsubdir/test-text\.gz$' - name: partly failed extraction options: -n @@ -682,4 +690,4 @@ - name: listing empty archive filenames: test-empty.tar.bz2 options: -l - antigrep: . + antigrep: '.' |