diff options
author | Olivier Blin <dev@blino.org> | 2015-11-08 23:32:24 +0100 |
---|---|---|
committer | Olivier Blin <dev@blino.org> | 2015-11-17 00:13:55 +0100 |
commit | 2323659122010211d80ef71c0906d90fc1439b55 (patch) | |
tree | 241948c76207bb8cfef5deaa2d1236b4fd361459 /emi | |
parent | 2da58954b3cb4dbd6e24d8ce029175613f532a90 (diff) | |
download | iurt-2323659122010211d80ef71c0906d90fc1439b55.tar iurt-2323659122010211d80ef71c0906d90fc1439b55.tar.gz iurt-2323659122010211d80ef71c0906d90fc1439b55.tar.bz2 iurt-2323659122010211d80ef71c0906d90fc1439b55.tar.xz iurt-2323659122010211d80ef71c0906d90fc1439b55.zip |
emi: Factorize filenames parsing, to make easy to support more file suffixes
Diffstat (limited to 'emi')
-rwxr-xr-x | emi | 21 |
1 files changed, 13 insertions, 8 deletions
@@ -132,14 +132,19 @@ sub done_func { my $section = "$m/$s"; - if ($r =~ /(\d{14}\.\w+\.\w+\.\d+)_(.*)\.done$/) { - my ($prefix, $arch) = ($1, $2); - $archdone{$prefix}{$section}{$arch} = 1; - } elsif ($r =~ /(\d{14}\.\w+\.\w+\.\d+)_(.*)\.excluded$/) { - my ($prefix, $arch) = ($1, $2); - $arch = $config->{arch_translation}{$arch} if $config->{arch_translation}{$arch}; - plog('DEBUG', "found .excluded ($prefix)"); - $excluded{$prefix}{$section}{$arch} = 1; + if ($r =~ /^(\d{14}\.\w+\.\w+\.\d+)([_.].+)$/) { + my ($prefix, $suffix) = ($1, $2); + if ($suffix =~ /^_(\w+)\.(\w+)$/) { + my ($arch, $result) = ($1, $2); + if ($result eq 'done') { + plog('DEBUG', "found .done ($prefix) for $arch"); + $archdone{$prefix}{$section}{$arch} = 1; + } elsif ($result eq 'excluded') { + $arch = $config->{arch_translation}{$arch} if $config->{arch_translation}{$arch}; + plog('DEBUG', "found .excluded ($prefix) for $arch"); + $excluded{$prefix}{$section}{$arch} = 1; + } + } } } |