Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 618712 - app-arch/tar-1.29: (Update): Add lbzip2 support
Summary: app-arch/tar-1.29: (Update): Add lbzip2 support
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement
Assignee: Gentoo's Team for Core System packages
URL: https://lists.gnu.org/archive/html/bu...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-17 04:37 UTC by Hung-Te Lin
Modified: 2021-11-04 05:17 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
app-arch/tar: Support using lbzip2 as default bzip2 compressor. (0001-app-arch-tar-Support-using-lbzip2-as-default-bzip2-c.patch,1.59 KB, patch)
2017-05-17 04:37 UTC, Hung-Te Lin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hung-Te Lin 2017-05-17 04:37:01 UTC
Created attachment 472880 [details, diff]
app-arch/tar: Support using lbzip2 as default bzip2 compressor.

GNU tar supports using lbzip2 by default for bz2 type compression (-j and -a) instead of standard bzip2. This is a pretty nice feature to optimize all scripts and programs using tar without changing the tar command to something like "-I lbzip2" one by one.

The attachment adds a new use flag "lbzip2" for app-arch/tar so when the flag is defined, tar will be compiled with --with-bzip2=lbzip2 and use lbzip2 by default.
Comment 1 Thomas Deutschmann (RETIRED) gentoo-dev 2018-06-19 12:13:46 UTC
@ vapier: Can you please comment on this? Looks like you had the same topic already https://chromium-review.googlesource.com/c/chromiumos/overlays/portage-stable/+/502867

From my POV: Just an additional USE flag (i.e. no patch or something we would need to maintain)... so at the moment I have no arguments against that change request.
Comment 2 SpanKY gentoo-dev 2018-06-19 14:30:13 UTC
imo, none of this should be USE flags.  the tar program should be smart enough to discover parallel implementations automatically by default.

something like this untested patch:
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -320,12 +320,14 @@ static struct zip_program zip_program[] = {
   { ct_compress, COMPRESS_PROGRAM, "-Z" },
   { ct_compress, GZIP_PROGRAM,     "-z" },
   { ct_gzip,     GZIP_PROGRAM,     "-z" },
-  { ct_bzip2,    BZIP2_PROGRAM,    "-j" },
   { ct_bzip2,    "lbzip2",         "-j" },
+  { ct_bzip2,    "pbzip2",         "-j" },
+  { ct_bzip2,    BZIP2_PROGRAM,    "-j" },
   { ct_lzip,     LZIP_PROGRAM,     "--lzip" },
   { ct_lzma,     LZMA_PROGRAM,     "--lzma" },
   { ct_lzma,     XZ_PROGRAM,       "-J" },
   { ct_lzop,     LZOP_PROGRAM,     "--lzop" },
+  { ct_xz,       "pixz",           "-J" },
   { ct_xz,       XZ_PROGRAM,       "-J" },
   { ct_zstd,     ZSTD_PROGRAM,     "--zstd" },
   { ct_none }

if that works as i think it does, that's something we can send upstream, and it'd make all tar implementations select a parallel version by default.
Comment 3 SpanKY gentoo-dev 2021-11-04 05:17:11 UTC
started a thread upstream on the topic