filter args in version_file

This commit is contained in:
Doug MacEachern 2009-07-18 15:51:34 -07:00
parent 78150c0d9b
commit 3e7254f3f7
1 changed files with 17 additions and 2 deletions

View File

@ -244,13 +244,28 @@ sub version_properties {
} }
sub version_file { 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) { unless ($source) {
$dest = 'sigar_version.c'; $dest = 'sigar_version.c';
$source = find_file("src/$dest.in"); $source = find_file("src/$dest.in");
} }
my $props = version_properties(); my $props = version_properties();
my(%filters);
while (my($key,$val) = each %$props) { while (my($key,$val) = each %$props) {
$key = uc $key; $key = uc $key;
$key =~ s/\./_/; $key =~ s/\./_/;