1Dpkg::Compression(3perl) libdpkg-perl Dpkg::Compression(3perl)
2
3
4
6 Dpkg::Compression - simple database of available compression methods
7
9 This modules provides a few public functions and a public regex to
10 interact with the set of supported compression methods.
11
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 compression_guess_from_filename($filename)
30 Returns the compression method that is likely used on the indicated
31 filename based on its file extension.
32
33 $regex = compression_get_file_extension_regex()
34 Returns a regex that matches a file extension of a file compressed
35 with one of the supported compression methods.
36
37 $comp = compression_get_default()
38 Return the default compression method. It is "xz" unless
39 "compression_set_default" has been used to change it.
40
41 compression_set_default($comp)
42 Change the default compression method. Errors out if the given
43 compression method is not supported.
44
45 $level = compression_get_default_level()
46 Return the default compression level used when compressing data.
47 It's "9" for "gzip" and "bzip2", "6" for "xz" and "lzma", unless
48 "compression_set_default_level" has been used to change it.
49
50 compression_set_default_level($level)
51 Change the default compression level. Passing undef as the level
52 will reset it to the compressor specific default, otherwise errors
53 out if the level is not valid (see "compression_is_valid_level").
54
55 compression_is_valid_level($level)
56 Returns a boolean indicating whether $level is a valid compression
57 level (it must be either a number between 1 and 9 or "fast" or
58 "best")
59
61 Version 2.00 (dpkg 1.20.0)
62 Hide variables: $default_compression, $default_compression_level and
63 $compression_re_file_ext.
64
65 Version 1.02 (dpkg 1.17.2)
66 New function: compression_get_file_extension_regex()
67
68 Deprecated variables: $default_compression, $default_compression_level
69 and $compression_re_file_ext
70
71 Version 1.01 (dpkg 1.16.1)
72 Default compression level is not global any more, it is per compressor
73 type.
74
75 Version 1.00 (dpkg 1.15.6)
76 Mark the module as public.
77
78
79
801.20.9 2021-05-10 Dpkg::Compression(3perl)