aboutsummaryrefslogtreecommitdiffstats
path: root/emi
diff options
context:
space:
mode:
authorOlivier Blin <dev@blino.org>2015-11-08 23:32:24 +0100
committerOlivier Blin <dev@blino.org>2015-11-17 00:13:55 +0100
commit2323659122010211d80ef71c0906d90fc1439b55 (patch)
tree241948c76207bb8cfef5deaa2d1236b4fd361459 /emi
parent2da58954b3cb4dbd6e24d8ce029175613f532a90 (diff)
downloadiurt-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-xemi21
1 files changed, 13 insertions, 8 deletions
diff --git a/emi b/emi
index e79b3d3..d26e758 100755
--- a/emi
+++ b/emi
@@ -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;
+ }
+ }
}
}