--- doc/texinfo.txi +++ doc/texinfo.txi @@ -16489,14 +16489,15 @@ @cindex Compressed dir files, reading @cindex Bzipped dir files, reading @cindex LZMA-compressed dir files, reading +@cindex xz-compressed dir files, reading @cindex Dir files, compressed If any input file is compressed with @code{gzip} (@pxref{Top,,,gzip, Gzip}), @code{install-info} automatically uncompresses it for reading. And if @var{dir-file} is compressed, @code{install-info} also automatically leaves it compressed after writing any changes. If @var{dir-file} itself does not exist, @code{install-info} tries to -open @file{@var{dir-file}.gz}, @file{@var{dir-file}.bz2}, and -@file{@var{dir-file}.lzma}, in that order. +open @file{@var{dir-file}.gz}, @file{@var{dir-file}.bz2}, +@file{@var{dir-file}.lzma}, and @file{@var{dir-file}.xz}, in that order. Options: --- info/filesys.c +++ info/filesys.c @@ -56,6 +56,7 @@ { ".gz", "gunzip" }, { ".bz2", "bunzip2" }, { ".lzma", "unlzma" }, + { ".xz", "unxz" }, { ".z", "gunzip" }, { ".Z", "uncompress" }, { ".Y", "unyabba" }, --- install-info/install-info.c +++ install-info/install-info.c @@ -410,6 +410,11 @@ len -= 5; ret[len] =0; } + else if (len > 3 && FILENAME_CMP (ret + len - 3, ".xz") == 0) + { + len -= 3; + ret[len] =0; + } if (len > 5 && FILENAME_CMP (ret + len - 5, ".info") == 0) { @@ -671,6 +676,12 @@ *opened_filename = concat (filename, ".lzma", ""); f = fopen (*opened_filename, FOPEN_RBIN); } + if (!f) + { + free (*opened_filename); + *opened_filename = concat (filename, ".xz", ""); + f = fopen (*opened_filename, FOPEN_RBIN); + } #ifdef __MSDOS__ if (!f) @@ -739,6 +750,13 @@ #else *compression_program = "bzip"; #endif + else if (data[0] == (char)0xFD && data[1] == '7' && data[2] == 'z' + && data[3] == 'X' && data[4] == 'Z' && data[5] == 0x00) +#ifndef STRIP_DOT_EXE + *compression_program = "xz.exe"; +#else + *compression_program = "xz"; +#endif /* We (try to) match against old lzma format (which lacks proper header, two first matches), as well as the new format (last match). */ else if ((data[9] == 0x00 && data[10] == 0x00 && data[11] == 0x00