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.
@ 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.
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.
started a thread upstream on the topic