From: Chip Black Date: Mon, 21 Apr 2008 05:53:02 +0000 (-0500) Subject: Periods (.) in extension patterns are now allowed (for things like .tar.gz) X-Git-Tag: v0.2~2 X-Git-Url: http://git.bytex64.net//?a=commitdiff_plain;h=5d7a3245aa4b35438ddbee6308b87b01550ccd29;p=conv.git Periods (.) in extension patterns are now allowed (for things like .tar.gz) --- diff --git a/conv.pl b/conv.pl index 2f5a609..218dae1 100755 --- a/conv.pl +++ b/conv.pl @@ -55,7 +55,7 @@ while () { s/\s+$//; next if /^$/; - if (/^(\w+)\s*=>\s*(\w+)\s*:\s*(.*)$/) { + if (/^([\w.]+)\s*=>\s*([\w.]+)\s*:\s*(.*)$/) { $rules{$2}{$1} = $3; } elsif (/^($var_re)\s*=\s*(.*)$/) { $vars{$1} = expand($2); @@ -116,7 +116,9 @@ else { for my $ofile (@ARGV) { my $ofound = 0; for my $oext (keys %rules) { - if ($ofile =~ /^(.*)\.$oext$/) { + my $oext_re = $oext; + $oext_re =~ s/\./\\./g; + if ($ofile =~ /^(.*)\.$oext_re$/) { my $base = $1; my $ifound = 0; for my $iext (keys %{$rules{$oext}}) {