Compare commits

..

12 Commits

2 changed files with 31 additions and 37 deletions

52
arclog
View File

@ -1620,7 +1620,7 @@ sub open_write : method {
} }
($self->{"file"}, $self->{"FH"}) = ($file, $FH); ($self->{"file"}, $self->{"FH"}) = ($file, $FH);
print STDERR " Attaching file with IO::Compress::Gzip ... " if $VERBOSE > 2; print STDERR " Attaching file with IO::Compress::Gzip ... " if $VERBOSE > 2;
$self->{"gz"} = IO::Compress::Gzip->new($FH) $self->{"gz"} = IO::Compress::Gzip->new($FH, -Level => 9)
or die "$THIS_FILE: $file: $IO::Compress::Gzip::GzipError"; or die "$THIS_FILE: $file: $IO::Compress::Gzip::GzipError";
print STDERR "done\n" if $VERBOSE > 2; print STDERR "done\n" if $VERBOSE > 2;
return; return;
@ -1665,7 +1665,7 @@ sub open_append : method {
or die "$THIS_FILE: tempfile: $IO::Uncompress::Gunzip::GunzipError"; or die "$THIS_FILE: tempfile: $IO::Uncompress::Gunzip::GunzipError";
print STDERR "done\n" if $VERBOSE > 2; print STDERR "done\n" if $VERBOSE > 2;
print STDERR " Attaching file with IO::Compress::Gzip ... " if $VERBOSE > 2; print STDERR " Attaching file with IO::Compress::Gzip ... " if $VERBOSE > 2;
$gz = IO::Compress::Gzip->new($FH) $gz = IO::Compress::Gzip->new($FH, -Level => 9)
or die "$THIS_FILE: $file: $IO::Compress::Gzip::GzipError"; or die "$THIS_FILE: $file: $IO::Compress::Gzip::GzipError";
print STDERR "done\n" if $VERBOSE > 2; print STDERR "done\n" if $VERBOSE > 2;
@ -1682,7 +1682,7 @@ sub open_append : method {
# A whole new file # A whole new file
} else { } else {
print STDERR " Attaching file with IO::Compress::Gzip ... " if $VERBOSE > 2; print STDERR " Attaching file with IO::Compress::Gzip ... " if $VERBOSE > 2;
$gz = IO::Compress::Gzip->new($FH) $gz = IO::Compress::Gzip->new($FH, -Level => 9)
or die "$THIS_FILE: $file: $IO::Compress::Gzip::GzipError"; or die "$THIS_FILE: $file: $IO::Compress::Gzip::GzipError";
print STDERR "done\n" if $VERBOSE > 2; print STDERR "done\n" if $VERBOSE > 2;
} }
@ -1692,9 +1692,7 @@ sub open_append : method {
} }
# Read a line from the I/O stream # Read a line from the I/O stream
sub readline : method { sub readline : method { $_[0]->{"gz"}->getline; }
return $_[0]->{"gz"}->getline();
}
# Output data to the I/O stream # Output data to the I/O stream
sub write : method { sub write : method {
@ -1724,7 +1722,7 @@ sub close : method {
# Create empty compressed content # Create empty compressed content
print STDERR " Applying empty compressed content ... " if $VERBOSE > 2; print STDERR " Applying empty compressed content ... " if $VERBOSE > 2;
$_ = IO::Compress::Gzip->new($FH, Append => 0) $_ = IO::Compress::Gzip->new($FH, -Level => 9)
or die "$THIS_FILE: $file: $IO::Compress::Gzip::GzipError"; or die "$THIS_FILE: $file: $IO::Compress::Gzip::GzipError";
$_->close or die "$THIS_FILE: $file: $IO::Compress::Gzip::GzipError"; $_->close or die "$THIS_FILE: $file: $IO::Compress::Gzip::GzipError";
undef $_; undef $_;
@ -2077,7 +2075,7 @@ sub open_write : method {
} }
($self->{"file"}, $self->{"FH"}) = ($file, $FH); ($self->{"file"}, $self->{"FH"}) = ($file, $FH);
print STDERR " Attaching file with IO::Compress::Bzip2 ... " if $VERBOSE > 2; print STDERR " Attaching file with IO::Compress::Bzip2 ... " if $VERBOSE > 2;
$self->{"bz"} = IO::Compress::Bzip2->new($FH) $self->{"bz"} = IO::Compress::Bzip2->new($FH, BlockSize100K => 9)
or die "$THIS_FILE: $file: $IO::Compress::Bzip2::Bzip2Error"; or die "$THIS_FILE: $file: $IO::Compress::Bzip2::Bzip2Error";
print STDERR "done\n" if $VERBOSE > 2; print STDERR "done\n" if $VERBOSE > 2;
return; return;
@ -2122,7 +2120,7 @@ sub open_append : method {
or die "$THIS_FILE: $file: $IO::Uncompress::Bunzip2::Bunzip2Error"; or die "$THIS_FILE: $file: $IO::Uncompress::Bunzip2::Bunzip2Error";
print STDERR "done\n" if $VERBOSE > 2; print STDERR "done\n" if $VERBOSE > 2;
print STDERR " Attaching file with IO::Compress::Bzip2 ... " if $VERBOSE > 2; print STDERR " Attaching file with IO::Compress::Bzip2 ... " if $VERBOSE > 2;
$bz = IO::Compress::Bzip2->new($FH) $bz = IO::Compress::Bzip2->new($FH, BlockSize100K => 9)
or die "$THIS_FILE: $file: $IO::Compress::Bzip2::Bzip2Error"; or die "$THIS_FILE: $file: $IO::Compress::Bzip2::Bzip2Error";
print STDERR "done\n" if $VERBOSE > 2; print STDERR "done\n" if $VERBOSE > 2;
@ -2139,7 +2137,7 @@ sub open_append : method {
# A whole new file # A whole new file
} else { } else {
print STDERR " Attaching file with IO::Compress::Bzip2 ... " if $VERBOSE > 2; print STDERR " Attaching file with IO::Compress::Bzip2 ... " if $VERBOSE > 2;
$bz = IO::Compress::Bzip2->new($FH) $bz = IO::Compress::Bzip2->new($FH, BlockSize100K => 9)
or die "$THIS_FILE: $file: $IO::Compress::Bzip2::Bzip2Error"; or die "$THIS_FILE: $file: $IO::Compress::Bzip2::Bzip2Error";
print STDERR "done\n" if $VERBOSE > 2; print STDERR "done\n" if $VERBOSE > 2;
} }
@ -2149,9 +2147,7 @@ sub open_append : method {
} }
# Read a line from the I/O stream # Read a line from the I/O stream
sub readline : method { sub readline : method { $_[0]->{"bz"}->getline; }
return $_[0]->{"bz"}->getline();
}
# Output data to the I/O stream # Output data to the I/O stream
sub write : method { sub write : method {
@ -2181,7 +2177,7 @@ sub close : method {
# Create empty compressed content # Create empty compressed content
print STDERR " Applying empty compressed content ... " if $VERBOSE > 2; print STDERR " Applying empty compressed content ... " if $VERBOSE > 2;
$_ = IO::Compress::Bzip2->new($FH) $_ = IO::Compress::Bzip2->new($FH, BlockSize100K => 9)
or die "$THIS_FILE: $file: $IO::Compress::Bzip2::Bzip2Error"; or die "$THIS_FILE: $file: $IO::Compress::Bzip2::Bzip2Error";
$_->close or die "$THIS_FILE: $file: $IO::Compress::Bzip2::Bzip2Error"; $_->close or die "$THIS_FILE: $file: $IO::Compress::Bzip2::Bzip2Error";
undef $_; undef $_;
@ -2285,7 +2281,7 @@ sub open_write : method {
($self->{"file"}, $self->{"FH"}) = ($file, $FH); ($self->{"file"}, $self->{"FH"}) = ($file, $FH);
$EXEC = where_is "bzip2" if !defined $EXEC; $EXEC = where_is "bzip2" if !defined $EXEC;
@_ = ($EXEC, "-9f"); @_ = ($EXEC, "-c9f");
@_ = map "\"$_\"", @_ if $^O eq "MSWin32"; @_ = map "\"$_\"", @_ if $^O eq "MSWin32";
$CMD = join " ", @_; $CMD = join " ", @_;
print STDERR " Starting $CMD to file ... " if $VERBOSE > 2; print STDERR " Starting $CMD to file ... " if $VERBOSE > 2;
@ -2356,7 +2352,7 @@ sub open_append : method {
open STDIN, "<&", $STDIN or die "$THIS_FILE: STDIN: $!"; open STDIN, "<&", $STDIN or die "$THIS_FILE: STDIN: $!";
print STDERR "done\n" if $VERBOSE > 2; print STDERR "done\n" if $VERBOSE > 2;
@_ = ($EXEC, "-9f"); @_ = ($EXEC, "-c9f");
@_ = map "\"$_\"", @_ if $^O eq "MSWin32"; @_ = map "\"$_\"", @_ if $^O eq "MSWin32";
$CMD = join " ", @_; $CMD = join " ", @_;
print STDERR " Starting $CMD to file ... " if $VERBOSE > 2; print STDERR " Starting $CMD to file ... " if $VERBOSE > 2;
@ -2384,7 +2380,7 @@ sub open_append : method {
# A whole new file # A whole new file
} else { } else {
@_ = ($EXEC, "-9f"); @_ = ($EXEC, "-c9f");
@_ = map "\"$_\"", @_ if $^O eq "MSWin32"; @_ = map "\"$_\"", @_ if $^O eq "MSWin32";
$CMD = join " ", @_; $CMD = join " ", @_;
print STDERR " Starting $CMD to file ... " if $VERBOSE > 2; print STDERR " Starting $CMD to file ... " if $VERBOSE > 2;
@ -2444,7 +2440,7 @@ sub close : method {
# Create empty compressed content # Create empty compressed content
print STDERR " Applying empty compressed content ... " if $VERBOSE > 2; print STDERR " Applying empty compressed content ... " if $VERBOSE > 2;
$EXEC = where_is "bzip2" if !defined $EXEC; $EXEC = where_is "bzip2" if !defined $EXEC;
@_ = ($EXEC, "-9f"); @_ = ($EXEC, "-c9f");
@_ = map "\"$_\"", @_ if $^O eq "MSWin32"; @_ = map "\"$_\"", @_ if $^O eq "MSWin32";
$CMD = join " ", @_; $CMD = join " ", @_;
# Redirect STDOUT to $FH # Redirect STDOUT to $FH
@ -2535,7 +2531,7 @@ sub open_write : method {
} }
($self->{"file"}, $self->{"FH"}) = ($file, $FH); ($self->{"file"}, $self->{"FH"}) = ($file, $FH);
print STDERR " Attaching file with IO::Compress::Xz ... " if $VERBOSE > 2; print STDERR " Attaching file with IO::Compress::Xz ... " if $VERBOSE > 2;
$self->{"xz"} = IO::Compress::Xz->new($FH) $self->{"xz"} = IO::Compress::Xz->new($FH, Extreme => 1)
or die "$THIS_FILE: $file: $IO::Compress::Xz::XzError"; or die "$THIS_FILE: $file: $IO::Compress::Xz::XzError";
print STDERR "done\n" if $VERBOSE > 2; print STDERR "done\n" if $VERBOSE > 2;
return; return;
@ -2580,7 +2576,7 @@ sub open_append : method {
or die "$THIS_FILE: tempfile: $IO::Uncompress::UnXz::UnXzError"; or die "$THIS_FILE: tempfile: $IO::Uncompress::UnXz::UnXzError";
print STDERR "done\n" if $VERBOSE > 2; print STDERR "done\n" if $VERBOSE > 2;
print STDERR " Attaching file with IO::Compress::Xz ... " if $VERBOSE > 2; print STDERR " Attaching file with IO::Compress::Xz ... " if $VERBOSE > 2;
$xz = IO::Compress::Xz->new($FH) $xz = IO::Compress::Xz->new($FH, Extreme => 1)
or die "$THIS_FILE: $file: $IO::Compress::Xz::XzError"; or die "$THIS_FILE: $file: $IO::Compress::Xz::XzError";
print STDERR "done\n" if $VERBOSE > 2; print STDERR "done\n" if $VERBOSE > 2;
@ -2597,7 +2593,7 @@ sub open_append : method {
# A whole new file # A whole new file
} else { } else {
print STDERR " Attaching file with IO::Compress::Xz ... " if $VERBOSE > 2; print STDERR " Attaching file with IO::Compress::Xz ... " if $VERBOSE > 2;
$xz = IO::Compress::Xz->new($FH) $xz = IO::Compress::Xz->new($FH, Extreme => 1)
or die "$THIS_FILE: $file: $IO::Compress::Xz::XzError"; or die "$THIS_FILE: $file: $IO::Compress::Xz::XzError";
print STDERR "done\n" if $VERBOSE > 2; print STDERR "done\n" if $VERBOSE > 2;
} }
@ -2607,9 +2603,7 @@ sub open_append : method {
} }
# Read a line from the I/O stream # Read a line from the I/O stream
sub readline : method { sub readline : method { $_[0]->{"xz"}->getline; }
return $_[0]->{"xz"}->getline();
}
# Output data to the I/O stream # Output data to the I/O stream
sub write : method { sub write : method {
@ -2639,7 +2633,7 @@ sub close : method {
# Create empty compressed content # Create empty compressed content
print STDERR " Applying empty compressed content ... " if $VERBOSE > 2; print STDERR " Applying empty compressed content ... " if $VERBOSE > 2;
$_ = IO::Compress::Xz->new($FH, Append => 0) $_ = IO::Compress::Xz->new($FH, Extreme => 1)
or die "$THIS_FILE: $file: $IO::Compress::Xz::XzError"; or die "$THIS_FILE: $file: $IO::Compress::Xz::XzError";
$_->close or die "$THIS_FILE: $file: $IO::Compress::Xz::XzError"; $_->close or die "$THIS_FILE: $file: $IO::Compress::Xz::XzError";
undef $_; undef $_;
@ -2743,7 +2737,7 @@ sub open_write : method {
($self->{"file"}, $self->{"FH"}) = ($file, $FH); ($self->{"file"}, $self->{"FH"}) = ($file, $FH);
$EXEC = where_is "xz" if !defined $EXEC; $EXEC = where_is "xz" if !defined $EXEC;
@_ = ($EXEC, "-9f"); @_ = ($EXEC, "-c9f");
@_ = map "\"$_\"", @_ if $^O eq "MSWin32"; @_ = map "\"$_\"", @_ if $^O eq "MSWin32";
$CMD = join " ", @_; $CMD = join " ", @_;
print STDERR " Starting $CMD to file ... " if $VERBOSE > 2; print STDERR " Starting $CMD to file ... " if $VERBOSE > 2;
@ -2814,7 +2808,7 @@ sub open_append : method {
open STDIN, "<&", $STDIN or die "$THIS_FILE: STDIN: $!"; open STDIN, "<&", $STDIN or die "$THIS_FILE: STDIN: $!";
print STDERR "done\n" if $VERBOSE > 2; print STDERR "done\n" if $VERBOSE > 2;
@_ = ($EXEC, "-9f"); @_ = ($EXEC, "-c9f");
@_ = map "\"$_\"", @_ if $^O eq "MSWin32"; @_ = map "\"$_\"", @_ if $^O eq "MSWin32";
$CMD = join " ", @_; $CMD = join " ", @_;
print STDERR " Starting $CMD to file ... " if $VERBOSE > 2; print STDERR " Starting $CMD to file ... " if $VERBOSE > 2;
@ -2842,7 +2836,7 @@ sub open_append : method {
# A whole new file # A whole new file
} else { } else {
@_ = ($EXEC, "-9f"); @_ = ($EXEC, "-c9f");
@_ = map "\"$_\"", @_ if $^O eq "MSWin32"; @_ = map "\"$_\"", @_ if $^O eq "MSWin32";
$CMD = join " ", @_; $CMD = join " ", @_;
print STDERR " Starting $CMD to file ... " if $VERBOSE > 2; print STDERR " Starting $CMD to file ... " if $VERBOSE > 2;
@ -2902,7 +2896,7 @@ sub close : method {
# Create empty compressed content # Create empty compressed content
print STDERR " Applying empty compressed content ... " if $VERBOSE > 2; print STDERR " Applying empty compressed content ... " if $VERBOSE > 2;
$EXEC = where_is "xz" if !defined $EXEC; $EXEC = where_is "xz" if !defined $EXEC;
@_ = ($EXEC, "-9f"); @_ = ($EXEC, "-c9f");
@_ = map "\"$_\"", @_ if $^O eq "MSWin32"; @_ = map "\"$_\"", @_ if $^O eq "MSWin32";
$CMD = join " ", @_; $CMD = join " ", @_;
# Redirect STDOUT to $FH # Redirect STDOUT to $FH

View File

@ -241,7 +241,7 @@ sub read_file($) {
} else { } else {
my ($PH, $CMD); my ($PH, $CMD);
$CMD = where_is "gzip"; $CMD = where_is "gzip";
$CMD = "\"$CMD\" -cd \"$file\""; $CMD = "\"$CMD\" -cdf \"$file\"";
open $PH, "$CMD |" or die this_file . ": $CMD: $!"; open $PH, "$CMD |" or die this_file . ": $CMD: $!";
$content = join "", <$PH>; $content = join "", <$PH>;
close $PH or die this_file . ": $CMD: $!"; close $PH or die this_file . ": $CMD: $!";
@ -264,7 +264,7 @@ sub read_file($) {
} else { } else {
my ($PH, $CMD); my ($PH, $CMD);
$CMD = where_is "bzip2"; $CMD = where_is "bzip2";
$CMD = "bzip2 -cd \"$file\""; $CMD = "\"$CMD\" -cdf \"$file\"";
open $PH, "$CMD |" or die this_file . ": $CMD: $!"; open $PH, "$CMD |" or die this_file . ": $CMD: $!";
$content = join "", <$PH>; $content = join "", <$PH>;
close $PH or die this_file . ": $CMD: $!"; close $PH or die this_file . ": $CMD: $!";
@ -287,7 +287,7 @@ sub read_file($) {
} else { } else {
my ($PH, $CMD); my ($PH, $CMD);
$CMD = where_is "xz"; $CMD = where_is "xz";
$CMD = "xz -cd \"$file\""; $CMD = "\"$CMD\" -cdf \"$file\"";
open $PH, "$CMD |" or die this_file . ": $CMD: $!"; open $PH, "$CMD |" or die this_file . ": $CMD: $!";
$content = join "", <$PH>; $content = join "", <$PH>;
close $PH or die this_file . ": $CMD: $!"; close $PH or die this_file . ": $CMD: $!";
@ -333,7 +333,7 @@ sub write_file($$) {
# IO::Compress::Gzip # IO::Compress::Gzip
if (eval { require IO::Compress::Gzip; 1; }) { if (eval { require IO::Compress::Gzip; 1; }) {
my $gz; my $gz;
$gz = IO::Compress::Gzip->new($file) $gz = IO::Compress::Gzip->new($file, -Level => 9)
or die this_file . ": $file: $IO::Compress::Gzip::GzipError"; or die this_file . ": $file: $IO::Compress::Gzip::GzipError";
($gz->write($content) == length $content) ($gz->write($content) == length $content)
or die this_file . ": $file: $IO::Compress::Gzip::GzipError"; or die this_file . ": $file: $IO::Compress::Gzip::GzipError";
@ -356,7 +356,7 @@ sub write_file($$) {
# IO::Compress::Bzip2 # IO::Compress::Bzip2
if (eval { require IO::Compress::Bzip2; 1; }) { if (eval { require IO::Compress::Bzip2; 1; }) {
my $bz; my $bz;
$bz = IO::Compress::Bzip2->new($file) $bz = IO::Compress::Bzip2->new($file, BlockSize100K => 9)
or die this_file . ": $file: $IO::Compress::Bzip2::Bzip2Error"; or die this_file . ": $file: $IO::Compress::Bzip2::Bzip2Error";
($bz->write($content) == length $content) ($bz->write($content) == length $content)
or die this_file . ": $file: $IO::Compress::Bzip2::Bzip2Error"; or die this_file . ": $file: $IO::Compress::Bzip2::Bzip2Error";
@ -367,7 +367,7 @@ sub write_file($$) {
} else { } else {
my ($PH, $CMD); my ($PH, $CMD);
$CMD = where_is "bzip2"; $CMD = where_is "bzip2";
$CMD = "\"$CMD\" -9f > \"$file\""; $CMD = "\"$CMD\" -c9f > \"$file\"";
open $PH, "| $CMD" or die this_file . ": $CMD: $!"; open $PH, "| $CMD" or die this_file . ": $CMD: $!";
print $PH $content or die this_file . ": $CMD: $!"; print $PH $content or die this_file . ": $CMD: $!";
close $PH or die this_file . ": $CMD: $!"; close $PH or die this_file . ": $CMD: $!";
@ -379,7 +379,7 @@ sub write_file($$) {
# IO::Compress::Xz # IO::Compress::Xz
if (eval { require IO::Compress::Xz; 1; }) { if (eval { require IO::Compress::Xz; 1; }) {
my $xz; my $xz;
$xz = IO::Compress::Xz->new($file) $xz = IO::Compress::Xz->new($file, Extreme => 1)
or die this_file . ": $file: $IO::Compress::Xz::XzError"; or die this_file . ": $file: $IO::Compress::Xz::XzError";
($xz->write($content) == length $content) ($xz->write($content) == length $content)
or die this_file . ": $file: $IO::Compress::Xz::XzError"; or die this_file . ": $file: $IO::Compress::Xz::XzError";
@ -390,7 +390,7 @@ sub write_file($$) {
} else { } else {
my ($PH, $CMD); my ($PH, $CMD);
$CMD = where_is "xz"; $CMD = where_is "xz";
$CMD = "\"$CMD\" -9f > \"$file\""; $CMD = "\"$CMD\" -c9f > \"$file\"";
open $PH, "| $CMD" or die this_file . ": $CMD: $!"; open $PH, "| $CMD" or die this_file . ": $CMD: $!";
print $PH $content or die this_file . ": $CMD: $!"; print $PH $content or die this_file . ": $CMD: $!";
close $PH or die this_file . ": $CMD: $!"; close $PH or die this_file . ": $CMD: $!";