aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <peroyvind@mandriva.org>2009-07-25 20:50:54 +0000
committerPer Øyvind Karlsen <peroyvind@mandriva.org>2009-07-25 20:50:54 +0000
commit933fcf9a134f3e2b75ceb3e64109de7266e56279 (patch)
tree712eec5ddfa9eadaf054b57ab08a924a1096c9c1
parentefe14df5eedcd0c1cbab65142c7b982b41e88341 (diff)
downloadperl-URPM-933fcf9a134f3e2b75ceb3e64109de7266e56279.tar
perl-URPM-933fcf9a134f3e2b75ceb3e64109de7266e56279.tar.gz
perl-URPM-933fcf9a134f3e2b75ceb3e64109de7266e56279.tar.bz2
perl-URPM-933fcf9a134f3e2b75ceb3e64109de7266e56279.tar.xz
perl-URPM-933fcf9a134f3e2b75ceb3e64109de7266e56279.zip
add support for specifying custom filter for compression with build_synthesis()
-rw-r--r--URPM/Build.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/URPM/Build.pm b/URPM/Build.pm
index 7f34a1f..18f3faee 100644
--- a/URPM/Build.pm
+++ b/URPM/Build.pm
@@ -414,14 +414,16 @@ sub build_hdlist {
#- end : index of last package (defaults to last index of depslist).
#- idlist : id list of rpm to compute (defaults is start .. end)
#- ratio : compression ratio (default 9).
+#- filter : program to filter through (default is 'gzip -$ratio').
#- returns true on success
sub build_synthesis {
my ($urpm, %options) = @_;
- my ($ratio, @idlist);
+ my ($ratio, $filter, @idlist);
@idlist = $urpm->build_listid($options{start}, $options{end}, $options{idlist});
$ratio = $options{ratio} || 9;
+ $filter = $options{filter} ? $options{filter} : "gzip -$ratio";
$options{synthesis} || defined $options{fd} or die "invalid parameters given";
#- first pass: traverse provides to find files provided.
@@ -435,7 +437,7 @@ sub build_synthesis {
#- second pass: write each info including files provided.
- $options{synthesis} and open my $fh, "| " . ($ENV{LD_LOADER} || '') . " gzip -$ratio >'$options{synthesis}'";
+ $options{synthesis} and open my $fh, "| " . ($ENV{LD_LOADER} || '') . " $filter >'$options{synthesis}'";
foreach (@idlist) {
my $pkg = $urpm->{depslist}[$_];
my %files;