1Dpkg::Compression(3perl)         libdpkg-perl         Dpkg::Compression(3perl)
2
3
4

NAME

6       Dpkg::Compression - simple database of available compression methods
7

DESCRIPTION

9       This modules provides a few public functions and a public regex to
10       interact with the set of supported compression methods.
11

FUNCTIONS

13       @list = compression_get_list()
14           Returns a list of supported compression methods (sorted
15           alphabetically).
16
17       compression_is_supported($comp)
18           Returns a boolean indicating whether the give compression method is
19           known and supported.
20
21       compression_get_property($comp, $property)
22           Returns the requested property of the compression method. Returns
23           undef if either the property or the compression method doesn't
24           exist. Valid properties currently include "file_ext" for the file
25           extension, "default_level" for the default compression level,
26           "comp_prog" for the name of the compression program and
27           "decomp_prog" for the name of the decompression program.
28
29           This function is deprecated, please switch to one of the new
30           specialized getters instead.
31
32       compression_guess_from_filename($filename)
33           Returns the compression method that is likely used on the indicated
34           filename based on its file extension.
35
36       $regex = compression_get_file_extension_regex()
37           Returns a regex that matches a file extension of a file compressed
38           with one of the supported compression methods.
39
40       $ext = compression_get_file_extension($comp)
41           Return the file extension for the compressor $comp.
42
43       $comp = compression_get_default()
44           Return the default compression method. It is "xz" unless
45           "compression_set_default" has been used to change it.
46
47       compression_set_default($comp)
48           Change the default compression method. Errors out if the given
49           compression method is not supported.
50
51       $level = compression_get_default_level()
52           Return the global default compression level used when compressing
53           data if it has been set, otherwise the default level for the
54           default compressor.
55
56           It's "9" for "gzip" and "bzip2", "6" for "xz" and "lzma", unless
57           "compression_set_default_level" has been used to change it.
58
59       compression_set_default_level($level)
60           Change the global default compression level. Passing undef as the
61           level will reset it to the global default compressor specific
62           default, otherwise errors out if the level is not valid (see
63           "compression_is_valid_level").
64
65       $level = compression_get_level($comp)
66           Return the compression level used when compressing data with a
67           specific compressor. The value returned is the specific compression
68           level if it has been set, otherwise the global default compression
69           level if it has been set, falling back to the specific default
70           compression level.
71
72       compression_set_level($comp, $level)
73           Change the compression level for a specific compressor. Passing
74           undef as the level will reset it to the specific default compressor
75           level, otherwise errors out if the level is not valid (see
76           "compression_is_valid_level").
77
78       compression_is_valid_level($level)
79           Returns a boolean indicating whether $level is a valid compression
80           level (it must be either a number between 1 and 9 or "fast" or
81           "best")
82
83       $threads = compression_get_threads()
84           Return the number of threads to use for compression and
85           decompression.
86
87       compression_set_threads($threads)
88           Change the threads to use for compression and decompression.
89           Passing "undef" or 0 requests to use automatic mode, based on the
90           current CPU cores on the system.
91
92       @exec = compression_get_cmdline_compress($comp)
93           Returns a list ready to be passed to "exec", its first element is
94           the program name for compression and the following elements are
95           parameters for the program.
96
97           When executed the program will act as a filter between its standard
98           input and its standard output.
99
100       @exec = compression_get_cmdline_decompress($comp)
101           Returns a list ready to be passed to "exec", its first element is
102           the program name for decompression and the following elements are
103           parameters for the program.
104
105           When executed the program will act as a filter between its standard
106           input and its standard output.
107

CHANGES

109   Version 2.01 (dpkg 1.21.14)
110       New functions: compression_get_file_extension(),
111       compression_get_level(), compression_set_level(),
112       compression_get_cmdline_compress(),
113       compression_get_cmdline_decompress(), compression_get_threads() and
114       compression_set_threads().
115
116       Deprecated functions: compression_get_property().
117
118   Version 2.00 (dpkg 1.20.0)
119       Hide variables: $default_compression, $default_compression_level and
120       $compression_re_file_ext.
121
122   Version 1.02 (dpkg 1.17.2)
123       New function: compression_get_file_extension_regex()
124
125       Deprecated variables: $default_compression, $default_compression_level
126       and $compression_re_file_ext
127
128   Version 1.01 (dpkg 1.16.1)
129       Default compression level is not global any more, it is per compressor
130       type.
131
132   Version 1.00 (dpkg 1.15.6)
133       Mark the module as public.
134
135
136
1371.21.21                           2023-03-28          Dpkg::Compression(3perl)
Impressum