aboutsummaryrefslogtreecommitdiffstats
path: root/emi
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mageia.org>2012-03-08 15:56:00 +0000
committerPascal Terjan <pterjan@mageia.org>2012-03-08 15:56:00 +0000
commite90b0acc99db5067807cfbd9c6c2e973f979c118 (patch)
treeee2c1acf90c8a04bb2ba7a5b699cbe3d9490691d /emi
parent30164b74ed5c71477f4d87c0d5d173a2c2f97f0b (diff)
downloadiurt-e90b0acc99db5067807cfbd9c6c2e973f979c118.tar
iurt-e90b0acc99db5067807cfbd9c6c2e973f979c118.tar.gz
iurt-e90b0acc99db5067807cfbd9c6c2e973f979c118.tar.bz2
iurt-e90b0acc99db5067807cfbd9c6c2e973f979c118.tar.xz
iurt-e90b0acc99db5067807cfbd9c6c2e973f979c118.zip
Really fix the race, collect .done before .rpm, as some may arrive between the two traversals
Diffstat (limited to 'emi')
-rwxr-xr-xemi30
1 files changed, 15 insertions, 15 deletions
diff --git a/emi b/emi
index 90a327b..0270b0e 100755
--- a/emi
+++ b/emi
@@ -117,6 +117,7 @@ my $reject = "$config->{queue}/rejected";
my %pkg_tree;
my %excluded;
+my %archdone;
#
@@ -128,17 +129,9 @@ sub done_func {
my $section = "$m/$s";
- if ($r =~ /(\d{14}\.\w+\.\w+\.\d+)_(.*\.([^.]+)\.rpm)$/) {
- my ($prefix, $rpm, $arch) = ($1, $2, $3);
- $arch = $config->{arch_translation}{$arch} if $config->{arch_translation}{$arch};
- plog('DEBUG', "found rpm $rpm ($prefix) for section $section");
- $pkg_tree{$prefix}{target} = $f;
- $pkg_tree{$prefix}{section}{$section}{path} = "/$f/$m/$s";
- if ($arch eq 'src') {
- push @{$pkg_tree{$prefix}{section}{$section}{srpms}}, $rpm;
- $pkg_tree{$prefix}{section}{$section}{arch}{src} = 1;
- }
- push @{$pkg_tree{$prefix}{section}{$section}{rpms}} , $rpm;
+ 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};
@@ -150,12 +143,19 @@ sub done_func {
sub done_post {
my ($_todo, $f, $m, $s, $r) = @_;
my $section = "$m/$s";
- if ($r =~ /(\d{14}\.\w+\.\w+\.\d+)_(.*)\.done$/) {
- my ($prefix, $arch) = ($1, $2);
- if (defined($pkg_tree{$prefix})) {
- plog('DEBUG', "found .done ($prefix, $arch)");
+ if ($r =~ /(\d{14}\.\w+\.\w+\.\d+)_(.*\.([^.]+)\.rpm)$/) {
+ my ($prefix, $rpm, $arch) = ($1, $2, $3);
+ $arch = $config->{arch_translation}{$arch} if $config->{arch_translation}{$arch};
+ plog('DEBUG', "found rpm $rpm ($prefix) for section $section");
+ $pkg_tree{$prefix}{target} = $f;
+ $pkg_tree{$prefix}{section}{$section}{path} = "/$f/$m/$s";
+ if ($arch eq 'src') {
+ push @{$pkg_tree{$prefix}{section}{$section}{srpms}}, $rpm;
+ $pkg_tree{$prefix}{section}{$section}{arch}{src} = 1;
+ } elsif ($archdone{$prefix}{$section}{$arch}) {
$pkg_tree{$prefix}{section}{$section}{arch}{$arch} = 1;
}
+ push @{$pkg_tree{$prefix}{section}{$section}{rpms}} , $rpm;
}
}