From 827f3c569526c4ea46db0622ccd862c15e983641 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20R=C3=BCger?= Date: Mon, 20 Feb 2017 16:08:44 +0100 Subject: [PATCH] Add support for zstandard decompression X-Gentoo-Bug: 609462 X-Gentoo-Bug-Url: https://bugs.gentoo.org/show_bug.cgi?id=609462 diff --git a/pym/portage/util/compression_probe.py b/pym/portage/util/compression_probe.py index 74f74b163..5d4cef04b 100644 --- a/pym/portage/util/compression_probe.py +++ b/pym/portage/util/compression_probe.py @@ -18,6 +18,7 @@ _decompressors = { "lzip": "lzip -d", "lzop": "lzop -d", "xz": "xz -d", + "zstd": "zstd -d", } _compression_re = re.compile(b'^(' + @@ -26,7 +27,8 @@ _compression_re = re.compile(b'^(' + b'(?P(?:\x04\x22\x4d\x18|\x02\x21\x4c\x18))|' + b'(?PLZIP)|' + b'(?P\x89LZO\x00\x0d\x0a\x1a\x0a)|' + - b'(?P\xfd\x37\x7a\x58\x5a\x00))') + b'(?P\xfd\x37\x7a\x58\x5a\x00)|' + + b'(?P(?:([\x22-\x28]\xb5\x2f\xfd)|(\x50\x2a\x4d\x18]))))') _max_compression_re_len = 9 @@ -41,6 +43,7 @@ def compression_probe(f): lzip lzop xz + zst @param f: a file path, or file-like object @type f: str or file -- 2.11.0