From 933fcf9a134f3e2b75ceb3e64109de7266e56279 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20=C3=98yvind=20Karlsen?= Date: Sat, 25 Jul 2009 20:50:54 +0000 Subject: add support for specifying custom filter for compression with build_synthesis() --- URPM/Build.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'URPM') 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; -- cgit v1.2.1