From 3e7254f3f7ce2c41adc881aeec672e2032e526da Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sat, 18 Jul 2009 15:51:34 -0700 Subject: [PATCH] filter args in version_file --- bindings/SigarBuild.pm | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/bindings/SigarBuild.pm b/bindings/SigarBuild.pm index 3e97983c..346ea4ea 100644 --- a/bindings/SigarBuild.pm +++ b/bindings/SigarBuild.pm @@ -244,13 +244,28 @@ sub version_properties { } sub version_file { - my($source, $dest) = @_; + local $_; + my($source, $dest, %filters); + my(@args) = @_ ? @_ : @ARGV; + for (@args) { + if (/=/) { + my($key,$val) = split '=', $_, 2; + $filters{$key} = $val; + } + else { + if ($source) { + $dest = $_; + } + else { + $source = $_; + } + } + } unless ($source) { $dest = 'sigar_version.c'; $source = find_file("src/$dest.in"); } my $props = version_properties(); - my(%filters); while (my($key,$val) = each %$props) { $key = uc $key; $key =~ s/\./_/;