{"id":1305,"date":"2021-02-10T15:29:09","date_gmt":"2021-02-10T14:29:09","guid":{"rendered":"http:\/\/blogs.gentoo.org\/mgorny\/?p=1305"},"modified":"2021-02-10T22:37:28","modified_gmt":"2021-02-10T21:37:28","slug":"lzip-decompression-support-for-xz-utils","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/mgorny\/2021\/02\/10\/lzip-decompression-support-for-xz-utils\/","title":{"rendered":"lzip decompression support for xz-utils"},"content":{"rendered":"<p>As of today, the most common implementation of the <a rel=\"external\" href=\"https:\/\/en.wikipedia.org\/wiki\/Lempel%E2%80%93Ziv%E2%80%93Markov_chain_algorithm\">LZMA<\/a> algorithm on open source operating systems is the <a rel=\"external\" href=\"https:\/\/tukaani.org\/xz\/\">xz<\/a> format.  However, there are a few others available.  Notably, a few packages found in the Gentoo repository use the superior <a rel=\"external\" href=\"https:\/\/www.nongnu.org\/lzip\/\">lzip<\/a> format.  Does this mean you may end up having to have separate decompressors for both formats installed?  Not necessarily.<\/p>\n<p>Back in 2017, I&#8217;ve entertained a curious idea.  Since both lzip and xz are both container formats built on top of the original LZMA algorithm, and xz features backwards-compatible support for the earlier container format used by <a rel=\"external\" href=\"https:\/\/tukaani.org\/lzma\/\">lzma-utils<\/a>, how hard would it be to implement a decoder for the lzip format as well?  Not very hard, it turned out.  After all, most of the code was already there \u2014 I&#8217;ve just had to implement the additional container format.  With some kind help of XZ upstream, I&#8217;ve done that.<\/p>\n<p>Sadly, the patches have not been merged yet.  More than three years have passed now in waiting.  Today I&#8217;ve rebased them and updated to follow changes in XZ itself.  For anyone interested, it can be found on the <a rel=\"external\" href=\"https:\/\/github.com\/mgorny\/xz\/tree\/lzip2\">lzip2 branch of my xz fork<\/a>.  After building xz with my patches, it now happily decompresses .lz files in addition to the regular set.  Thanks to a tiny patchset you don&#8217;t have to build yet another program to unpack a few distfiles.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As of today, the most common implementation of the LZMA algorithm on open source operating systems is the xz format. However, there are a few others available. Notably, a few packages found in the Gentoo repository use the superior lzip format. Does this mean you may end up having to have separate decompressors for both &hellip; <a href=\"https:\/\/blogs.gentoo.org\/mgorny\/2021\/02\/10\/lzip-decompression-support-for-xz-utils\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;lzip decompression support for xz-utils&#8221;<\/span><\/a><\/p>\n","protected":false},"author":137,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[3],"tags":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/mgorny\/wp-json\/wp\/v2\/posts\/1305"}],"collection":[{"href":"https:\/\/blogs.gentoo.org\/mgorny\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.gentoo.org\/mgorny\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/mgorny\/wp-json\/wp\/v2\/users\/137"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/mgorny\/wp-json\/wp\/v2\/comments?post=1305"}],"version-history":[{"count":6,"href":"https:\/\/blogs.gentoo.org\/mgorny\/wp-json\/wp\/v2\/posts\/1305\/revisions"}],"predecessor-version":[{"id":1311,"href":"https:\/\/blogs.gentoo.org\/mgorny\/wp-json\/wp\/v2\/posts\/1305\/revisions\/1311"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/mgorny\/wp-json\/wp\/v2\/media?parent=1305"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/mgorny\/wp-json\/wp\/v2\/categories?post=1305"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/mgorny\/wp-json\/wp\/v2\/tags?post=1305"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}