Ticket #16759: patch-lzma.diff

File patch-lzma.diff, 1.5 KB (added by jay-macports@…, 16 years ago)

Future LZMA support

  • magic/Magdir/compress

    # adapted from lzma-4.42.0alphaX/extra/tar/file-4.21.patch
    # 2008-10-05 lzma doesn't write this new format yet (as of
    #   lzma 4.43 revision 2), but when it does, file will be ready
    #   See discussion at 
    #   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=364260
    #
    old new  
    189189# bug #364260)
    190190#0      string          ]\000\000\200\000       LZMA compressed data
    191191
     192# LZMA (Lempel-Ziv-Markov chain-Algorithm) file format supported by:
     193#   - 7-Zip <http://7-zip.org/>
     194#   - LZMA SDK <http://7-zip.org/sdk.html>
     195#   - LZMA Utils <http://tukaani.org/lzma/>
     196#
     197# Note that this is different format than the original format created
     198# by LZMA_Alone from older versions of LZMA SDK. These files are
     199# non-trivial to detect, because they have no magic bytes.
     200#
     2010       ustring         \xFFLZMA\x00    lzma compressed data,
     202>6      ubyte&0x10      0x00            single-block stream
     203>6      ubyte&0x10      0x10            multi-block stream
     204
    192205# AFX compressed files (Wolfram Kleff)
    1932062       string          -afx-           AFX compressed file data
    194207
  • src/compress.c

     
    old new  
    7676        { "PK\3\4",   4, { "gzip", "-cdq", NULL }, 1 },         /* pkzipped, */
    7777                                            /* ...only first file examined */
    7878        { "BZh",      3, { "bzip2", "-cd", NULL }, 1 },         /* bzip2-ed */
     79        { "\xFFLZMA\x00", 6, { "lzma", "-cd", NULL }, 1 },      /* new LZMA */
    7980};
    8081
    8182private size_t ncompr = sizeof(compr) / sizeof(compr[0]);