summaryrefslogtreecommitdiffstats
path: root/debian/lzip.README.Debian
blob: ba77528cc4914676d4131198d94f7a6019b2f30f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
Lzip for Debian
===============

1. Lzip implementations
-----------------------

Lzip is available in different implementations:

  lzip           original C++ implementation
  plzip          parallel C++ implementation

  lziprecover    C++ implementation with extra recovery functionality
  clzip          C implementation

  lunzip         C implementation, decompressor only
  xlunzip        C implementation using lzip_decompress kernel module, decompressor only

  lzd            simple C implementation, decompressor only, educational purpose
  minilzip       simple C implementation using lzlib library
  pdlzip         simple C implementation, Public Domain

All Lzip implementations are fully compatible (files can be compressed and
decompressed with any implementation interchangeably).

All Lzip implementations support the same command line switches (except for lzd):
if an option is not implemented it is silently ignored (e.g. the -n option to set
the number of threads is accepted by all implementations but only plzip makes
use of it).


2. update-alternatives
----------------------

On Debian based systems all Lzip implementations are installed as
lzip.$implementation (e.g. /usr/bin/lzip.plzip) and /usr/bin/lzip is a symlink
managed by update-altenatives to point to the currently selected
implementation. All Lzip packages provide the virtual lzip-alternatives package.

The following automatic priorities are used:

  Decompressors:
    xlunzip        -2000
    lunzip         -1000

  Compressor and decompressors:
    minilzip       1000
    pdlzip         2000
    clzip          3000
    lziprecover    4000
    lzip           5000
    plzip          6000


This allows:

  * users to manually switch the implementation conveniently with:

      sudo update-alternative --config lzip

    if more than one Lzip imlementation is installed.

  * automatically have the system use the 'best' implementation installed
    (using the priorities listed above, e.g. installing plzip will superseed
    lzip automatically).

  * switching transparently between implementations, e.g. globally using
    the multi-threaded plzip instead of the single-threaded lzip requires only
    one command:

       sudo update-alternatives --set lzip /usr/bin/lzip.plzip

    No scripts or commands need to be changed. If you were using lzip
    before, install plzip and all your Lzip operations are now parallelized
    automatically.

Additional lzip-compressor and lzip-decompressor are provided, both as virtual
packages as well as alternatives in /usr/bin. This allows one to use a mixed
mode of setting lzip alternatives globally, such as using plzip for
decompression and lzip for compression.

Note: lzd (decompressor only, educational purpose) doesn't provide the '--test'
parameter to verify compressed file integrity (which now is the base-line
requirement for all lzip variants providing alternatives) and is therefore
not providing any update-alternative handling.


3. Best practice
----------------

To make the best use of Lzip, the following should be considered:

  * use lzip in scripts and commands, don't hardcode a specific implementation
    (e.g. use lzip, not plzip).

  * use alternative depends in debian packages, don't depend on a specific
    implementation (e.g. use 'Depends: lzip-alternative | lzip' or
    'Depends: lzip-alternative | plzip', not 'Depends: lzip').

  * use compressor or decompressor explicitly (e.g. use
    'Depends: lzip-decompressor | lunzip' if you don't need to compress files).


4. See also
-----------

  * tarlz: archiver with multimember lzip compression
  * zutils: utilities for dealing with compressed files transparently

  * Xz format inadequate for long-term archiving
    http://lzip.nongnu.org/xz_inadequate.html

 -- Daniel Baumann <daniel.baumann@progress-linux.org>  Sun, 26 Aug 2018 11:06:17 +0200