compressed_filename => $self->get_filename(),
compression => $self->{"compression"},
);
+ if ($self->{"compression_level"}) {
+ $self->{"compressor"}->set_compression_level(
+ $self->{"compression_level"});
+ }
$self->{"compressor"}->compress(from_pipe => \$fork_opts{"to_handle"});
} else {
$fork_opts{"to_file"} = $self->get_filename();
syserr(_g("Unable to rename %s to %s"),
"$tmp/$entries[0]", $dest);
} else {
- rename($tmp, $dest) || syserr(_g("Unable to rename %s to %s"),
- "$tmp/$_", "$dest/$_");
+ rename($tmp, $dest) ||
+ syserr(_g("Unable to rename %s to %s"), $tmp, $dest);
}
rmtree($tmp);
}
my ($ntfh, $newtar) = tempfile("$tarname.new.XXXXXX",
DIR => getcwd(), UNLINK => 0);
my $tar = Dpkg::Source::Archiver->new(filename => $newtar,
- compression => get_compression_from_filename($tarname));
+ compression => get_compression_from_filename($tarname),
+ compression_level => $comp_level);
$tar->create(options => \@tar_ignore);
$tar->add_directory($tardirname);
$tar->close();