#!/usr/bin/perl -w
use common::sense;

use IO::Uncompress::AnyUncompress qw( anyuncompress $AnyUncompressError );

my $tb = shift; $tb =~ s:^\./::;
my $of = "install/".$tb;
my $zf = "install-zstd/".$tb;
$zf =~ s/\.(xz|bz2)/.zst/;
#exit 0 if -s $zf;
#say "$tb\n\t$of\n  ==>\t$zf";
#exit 0;
my $fh_o = IO::Uncompress::AnyUncompress->new( $of );
open my $fh_z, "|-", qw( /usr/bin/zstd -19 -fo ), $zf;
binmode $fh_z;
select $fh_z;
while (<$fh_o>) {
 print;
}
    
