Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 574422 | Differences between
and this patch

Collapse All | Expand All

(-)a/DeComp/compress.py (-3 / +6 lines)
Lines 18-24 Maintained in full by: Link Here
18
import os
18
import os
19
19
20
from DeComp.definitions import (DEFINITION_FIELDS, EXTENSION_SEPARATOR,
20
from DeComp.definitions import (DEFINITION_FIELDS, EXTENSION_SEPARATOR,
21
    COMPRESSOR_PROGRAM_OPTIONS)
21
    COMPRESSOR_PROGRAM_OPTIONS, DECOMPRESSOR_PROGRAM_OPTIONS)
22
from DeComp import log
22
from DeComp import log
23
from DeComp.utils import create_classes, subcmd, check_available
23
from DeComp.utils import create_classes, subcmd, check_available
24
24
Lines 33-39 class CompressMap(object): Link Here
33
33
34
    def __init__(self, definitions=None, env=None, default_mode=None,
34
    def __init__(self, definitions=None, env=None, default_mode=None,
35
                 separator=EXTENSION_SEPARATOR, search_order=None, logger=None,
35
                 separator=EXTENSION_SEPARATOR, search_order=None, logger=None,
36
                 comp_prog=COMPRESSOR_PROGRAM_OPTIONS['linux']):
36
                 comp_prog=COMPRESSOR_PROGRAM_OPTIONS['linux'],
37
                 decomp_opt=DECOMPRESSOR_PROGRAM_OPTIONS['linux']):
37
        """Class init
38
        """Class init
38
39
39
        :param definitions: dictionary of
40
        :param definitions: dictionary of
Lines 78-83 class CompressMap(object): Link Here
78
            self.search_order = self.search_order.split()
79
            self.search_order = self.search_order.split()
79
        self.logger = logger or log
80
        self.logger = logger or log
80
        self.comp_prog = comp_prog
81
        self.comp_prog = comp_prog
82
        self.decomp_opt = decomp_opt
81
        self.logger.info("COMPRESS: __init__(), search_order = %s",
83
        self.logger.info("COMPRESS: __init__(), search_order = %s",
82
                         str(self.search_order))
84
                         str(self.search_order))
83
        # create the (de)compression definition namedtuple classes
85
        # create the (de)compression definition namedtuple classes
Lines 341-347 class CompressMap(object): Link Here
341
            'mode': mode or self.mode,
343
            'mode': mode or self.mode,
342
            'auto-ext': auto_extension,
344
            'auto-ext': auto_extension,
343
            'other_options': other_options,
345
            'other_options': other_options,
344
            'comp_prog': self.comp_prog
346
            'comp_prog': self.comp_prog,
347
            'decomp_opt': self.decomp_opt
345
            }
348
            }
346
349
347
350
(-)a/DeComp/contents.py (-4 / +11 lines)
Lines 19-25 import os Link Here
19
from subprocess import Popen, PIPE
19
from subprocess import Popen, PIPE
20
20
21
from DeComp.definitions import (CONTENTS_SEARCH_ORDER, DEFINITION_FIELDS,
21
from DeComp.definitions import (CONTENTS_SEARCH_ORDER, DEFINITION_FIELDS,
22
                                EXTENSION_SEPARATOR, COMPRESSOR_PROGRAM_OPTIONS)
22
                                EXTENSION_SEPARATOR, COMPRESSOR_PROGRAM_OPTIONS,
23
                                DECOMPRESSOR_PROGRAM_OPTIONS, LIST_XATTRS_OPTIONS)
23
from DeComp import log
24
from DeComp import log
24
from DeComp.utils import create_classes, check_available
25
from DeComp.utils import create_classes, check_available
25
26
Lines 36-42 class ContentsMap(object): Link Here
36
37
37
    def __init__(self, definitions=None, env=None, default_mode=None,
38
    def __init__(self, definitions=None, env=None, default_mode=None,
38
                 separator=EXTENSION_SEPARATOR, search_order=None, logger=None,
39
                 separator=EXTENSION_SEPARATOR, search_order=None, logger=None,
39
                 comp_prog=COMPRESSOR_PROGRAM_OPTIONS['linux']):
40
                 comp_prog=COMPRESSOR_PROGRAM_OPTIONS['linux'],
41
                 decomp_opt=DECOMPRESSOR_PROGRAM_OPTIONS['linux'],
42
                 list_xattrs_opt=LIST_XATTRS_OPTIONS['linux']):
40
        """Class init
43
        """Class init
41
44
42
        :param definitions: dictionary of
45
        :param definitions: dictionary of
Lines 66-71 class ContentsMap(object): Link Here
66
            self.search_order = self.search_order.split()
69
            self.search_order = self.search_order.split()
67
        self.logger = logger or log
70
        self.logger = logger or log
68
        self.comp_prog = comp_prog
71
        self.comp_prog = comp_prog
72
        self.decomp_opt = decomp_opt
73
        self.list_xattrs_opt = list_xattrs_opt
69
        self.logger.info("ContentsMap: __init__(), search_order = %s",
74
        self.logger.info("ContentsMap: __init__(), search_order = %s",
70
                         str(self.search_order))
75
                         str(self.search_order))
71
        # create the contents definitions namedtuple classes
76
        # create the contents definitions namedtuple classes
Lines 155-165 class ContentsMap(object): Link Here
155
        :returns: string, list of the contents
160
        :returns: string, list of the contents
156
        """
161
        """
157
        _cmd = [cmd]
162
        _cmd = [cmd]
158
        _cmd.extend((' '.join(args)
163
        _cmd.extend(('\t'.join(args)
159
                     % {'source': source, "destination": destination,
164
                     % {'source': source, "destination": destination,
160
                        'comp_prog': self.comp_prog,
165
                        'comp_prog': self.comp_prog,
166
                        'decomp_opt': self.decomp_opt,
167
                        'list_xattrs_opt': self.list_xattrs_opt,
161
                       }
168
                       }
162
                    ).split()
169
                    ).split('\t')
163
                   )
170
                   )
164
        try:
171
        try:
165
            proc = Popen(_cmd, stdout=PIPE, stderr=PIPE)
172
            proc = Popen(_cmd, stdout=PIPE, stderr=PIPE)
(-)a/DeComp/definitions.py (-10 / +18 lines)
Lines 77-82 COMPRESSOR_PROGRAM_OPTIONS = {"linux": "-I", Link Here
77
                              "bsd": "--use-compress-program",
77
                              "bsd": "--use-compress-program",
78
                             }
78
                             }
79
79
80
DECOMPRESSOR_PROGRAM_OPTIONS = {"linux": "",
81
                                "bsd": " -d",
82
                               }
83
84
LIST_XATTRS_OPTIONS = {"linux": "--xattrs",
85
                       "bsd": "",
86
                      }
87
80
DEFAULT_TAR="linux-tar"
88
DEFAULT_TAR="linux-tar"
81
89
82
COMPRESS_DEFINITIONS = {
90
COMPRESS_DEFINITIONS = {
Lines 217-223 DECOMPRESS_DEFINITIONS = { Link Here
217
    "lbzip2": [
225
    "lbzip2": [
218
                "_common", "tar",
226
                "_common", "tar",
219
                [
227
                [
220
                    "other_options", "%(comp_prog)s", "lbzip2", "-xpf",
228
                    "other_options", "%(comp_prog)s", '"lbzip2%(decomp_opt)s"', "-xpf",
221
                    "%(source)s", "-C", "%(destination)s"
229
                    "%(source)s", "-C", "%(destination)s"
222
                ],
230
                ],
223
                "LBZIP2", ["tar.bz2", "bz2", "tbz2"], {"tar", "lbzip2"},
231
                "LBZIP2", ["tar.bz2", "bz2", "tbz2"], {"tar", "lbzip2"},
Lines 226-232 DECOMPRESS_DEFINITIONS = { Link Here
226
                    "_common", "tar",
234
                    "_common", "tar",
227
                    [
235
                    [
228
                        "--xattrs", "--xattrs-include=security.capability",
236
                        "--xattrs", "--xattrs-include=security.capability",
229
                        "--xattrs-include=user.pax.flags", "%(comp_prog)s", "lbzip2",
237
                        "--xattrs-include=user.pax.flags", "%(comp_prog)s", '"lbzip2%(decomp_opt)s"',
230
                        "-xpf", "%(source)s", "-C", "%(destination)s"
238
                        "-xpf", "%(source)s", "-C", "%(destination)s"
231
                    ],
239
                    ],
232
                    "LBZIP2", ["tar.bz2", "bz2", "tbz2"], {"tar", "lbzip2"},
240
                    "LBZIP2", ["tar.bz2", "bz2", "tbz2"], {"tar", "lbzip2"},
Lines 279-285 DECOMPRESS_DEFINITIONS = { Link Here
279
    "pixz": [
287
    "pixz": [
280
                "_common", "tar",
288
                "_common", "tar",
281
                [
289
                [
282
                    "other_options", "%(comp_prog)s", "pixz", "-xpf",
290
                    "other_options", "%(comp_prog)s", '"pixz%(decomp_opt)s"', "-xpf",
283
                    "%(source)s", "-C", "%(destination)s"
291
                    "%(source)s", "-C", "%(destination)s"
284
                ],
292
                ],
285
                "PIXZ", ["tar.xz", "xz"], {"tar", "pixz"},
293
                "PIXZ", ["tar.xz", "xz"], {"tar", "pixz"},
Lines 288-294 DECOMPRESS_DEFINITIONS = { Link Here
288
                "_common", "tar",
296
                "_common", "tar",
289
                [
297
                [
290
                    "--xattrs", "--xattrs-include=security.capability",
298
                    "--xattrs", "--xattrs-include=security.capability",
291
                    "--xattrs-include=user.pax.flags", "%(comp_prog)s", "pixz", "-xpf",
299
                    "--xattrs-include=user.pax.flags", "%(comp_prog)s", '"pixz%(decomp_opt)s"', "-xpf",
292
                    "%(source)s", "-C", "%(destination)s"
300
                    "%(source)s", "-C", "%(destination)s"
293
                ],
301
                ],
294
                "PIXZ", ["tar.xz", "xz"], {"tar", "pixz"},
302
                "PIXZ", ["tar.xz", "xz"], {"tar", "pixz"},
Lines 337-368 EXTENSION_SEPARATOR = '.' Link Here
337
CONTENTS_DEFINITIONS = {
345
CONTENTS_DEFINITIONS = {
338
    "tar": [
346
    "tar": [
339
                "_common", "tar",
347
                "_common", "tar",
340
                ["--xattrs", "-tvf", "%(source)s"],
348
                ["%(list_xattrs_opt)s", "-tvf", "%(source)s"],
341
                "TAR", [".tar"], {"tar"},
349
                "TAR", [".tar"], {"tar"},
342
           ],
350
           ],
343
    "gzip": [
351
    "gzip": [
344
                "_common", "tar",
352
                "_common", "tar",
345
                ["--xattrs", "-tvzf", "%(source)s"],
353
                ["%(list_xattrs_opt)s", "-tvzf", "%(source)s"],
346
                "GZIP", [".tgz", ".tar.gz", "gz"], {"tar"},
354
                "GZIP", [".tgz", ".tar.gz", "gz"], {"tar"},
347
            ],
355
            ],
348
    "lbzip2": [
356
    "lbzip2": [
349
                "_common", "tar",
357
                "_common", "tar",
350
                ["--xattrs", "%(comp_prog)s", "lbzip2", "-tvf", "%(source)s"],
358
                ["%(list_xattrs_opt)s", "%(comp_prog)s", "lbzip2%(decomp_opt)s", "-tvf", "%(source)s"],
351
                "LBZIP2", [".tbz2", "bz2", ".tar.bz2"], {"tar", "lbzip2"},
359
                "LBZIP2", [".tbz2", "bz2", ".tar.bz2"], {"tar", "lbzip2"},
352
              ],
360
              ],
353
    "bzip2": [
361
    "bzip2": [
354
                "_common", "tar",
362
                "_common", "tar",
355
                ["--xattrs", "-tvf", "%(source)s"],
363
                ["%(list_xattrs_opt)s", "-tvf", "%(source)s"],
356
                "BZIP2", [".tbz2", "bz2", ".tar.bz2"], {"tar", "bzip2"},
364
                "BZIP2", [".tbz2", "bz2", ".tar.bz2"], {"tar", "bzip2"},
357
             ],
365
             ],
358
    "xz": [
366
    "xz": [
359
            "_common", "tar",
367
            "_common", "tar",
360
            ["--xattrs", "-tvf", "%(source)s"],
368
            ["%(list_xattrs_opt)s", "-tvf", "%(source)s"],
361
            "XZ", ["tar.xz", "xz"], {"tar"},
369
            "XZ", ["tar.xz", "xz"], {"tar"},
362
          ],
370
          ],
363
    "pixz": [
371
    "pixz": [
364
                "_common", "tar",
372
                "_common", "tar",
365
                ["--xattrs", "%(comp_prog)s", "pixz", "-tvf", "%(source)s"],
373
                ["%(list_xattrs_opt)s", "%(comp_prog)s", "pixz%(decomp_opt)s", "-tvf", "%(source)s"],
366
                "PIXZ", ["tar.xz", "xz"], {"tar", "pixz"},
374
                "PIXZ", ["tar.xz", "xz"], {"tar", "pixz"},
367
            ],
375
            ],
368
    "isoinfo_l": [
376
    "isoinfo_l": [

Return to bug 574422