diff options
-rwxr-xr-x | emi | 32 |
1 files changed, 16 insertions, 16 deletions
@@ -50,7 +50,7 @@ my %config_usage = ( desc => 'mail address of the bot administrator', default => 'warly@mandriva.com' }, - arch => { + 'arch' => { desc => "List of arch", default => [ 'i586', 'x86_64', 'ppc' , 'sparc', 'sparc64' ] }, @@ -101,7 +101,7 @@ if (-f $configfile) { $config = do $configfile or die "FATAL $program_name: syntax error in $configfile"; } else { - $config = {} + $config = {}; } config_usage(\%config_usage, $config) if $run{config_usage}; @@ -116,7 +116,7 @@ my $pidfile = check_pid(\%run); #my $cache = init_cache(\%run, $config, { arch => {} }); my $cache = { arch => {} }; -my ($fulldate, $daydate) = get_date(); +my ($_fulldate, $daydate) = get_date(); $run{daydate} = $daydate; my $todo = "$config->{queue}/todo/"; @@ -132,7 +132,7 @@ my %excluded; # sub done_func { - my ($todo, $f, $m, $s, $r) = @_; + my ($_todo, $f, $m, $s, $r) = @_; if ($r =~ /(\d{14}\.\w+\.\w+\.\d+)_(.*\.([^.]+)\.rpm)$/) { my ($prefix, $rpm, $arch) = ($1, $2, $3); @@ -141,7 +141,7 @@ sub done_func { $pkg_tree{$prefix}{arch}{$arch} = 1; $pkg_tree{$prefix}{target} = $f; $pkg_tree{$prefix}{section} = "$m/$s"; - push @{$pkg_tree{$prefix}{srpms}}, $rpm if ($arch eq 'src'); + push @{$pkg_tree{$prefix}{srpms}}, $rpm if $arch eq 'src'; push @{$pkg_tree{$prefix}{rpms}} , $rpm; } elsif ($r =~ /(\d{14}\.\w+\.\w+\.\d+)_(.*)\.done$/) { my ($prefix, $arch) = ($1, $2); @@ -156,17 +156,17 @@ sub done_func { } sub todo_func { - my ($todo, $f, $m, $s, $r) = @_; + my ($_todo, $_f, $_m, $_s, $r) = @_; if ($r =~ /(\d{14}\.\w+\.\w+\.\d+)_(.*\.([^.]+)\.rpm)$/) { - my ($prefix, $rpm, $arch) = ($1, $2, $3); + my ($prefix, $rpm, $_arch) = ($1, $2, $3); plog('DEBUG', "found todo rpm $rpm ($prefix)"); push @{$pkg_tree{$prefix}{todo}}, $rpm; } } -check_upload_tree(\%run, $done, \&done_func, ); -check_upload_tree(\%run, $todo, \&todo_func, ); +check_upload_tree(\%run, $done, \&done_func,); +check_upload_tree(\%run, $todo, \&todo_func,); # Once the tree is checked, ulri can be launched again unlink $pidfile; @@ -182,13 +182,13 @@ foreach my $prefix (keys %pkg_tree) { my $section = $pkg_tree{$prefix}{section}; my %missing; - plog('MSG', "processing $prefix"); + plog('NOTIFY', "processing $prefix"); plog('DEBUG', "... in $path"); my $ok = 1; foreach my $m (@{$config->{mandatory_arch}}, 'src') { $excluded{$prefix}{$m} and next; my $x = "yes"; - if (!$pkg_tree{$prefix}{arch}{$m} && !$pkg_tree{$prefix}{arch}{noarch}){ + if (!$pkg_tree{$prefix}{arch}{$m} && !$pkg_tree{$prefix}{arch}{noarch}) { if (!$cache->{arch}{$prefix}{$m}) { $missing{$m} = 1; $x = "no"; @@ -246,24 +246,24 @@ foreach my $prefix (keys %pkg_tree) { # should send a mail or something plog('ERR', "upload failed ($!), rejecting files in $reject/$path/"); foreach my $rpm (@{$pkg_tree{$prefix}{rpms}}) { - my $err = link "$done/$path/${prefix}_$rpm", "$reject/$path/${prefix}_$rpm"; + link "$done/$path/${prefix}_$rpm", "$reject/$path/${prefix}_$rpm"; plog('ERR', "ERROR: link of $rpm failed ($!)"); } link "$done/$path/$prefix.youri", "$reject/$path/$prefix.youri"; my ($user) = $prefix =~ /\d{14}\.(\w+)\.\w+\.\d+/; if ($user) { - my $text = qq{The upload of the following packages failed:\n}; + my $text = qq(The upload of the following packages failed:\n); my $rpms; foreach my $rpm (@{$pkg_tree{$prefix}{rpms}}) { $rpm =~ /src\.rpm$/ or next; $rpms .= "$rpm "; - $text .= "- $rpm\n" + $text .= "- $rpm\n"; } my $to = $mail->{$user} || "$user\@mandriva.com, $user\@mandriva.org"; $text .= "\nUpload log available in $config->{http_queue}/rejected/$path/$prefix.youri\n"; - sendmail($to, $config->{admin} , "Upload failed for $rpms", $text, "Emi the upload bot <$config->{admin}>", 0) + sendmail($to, $config->{admin} , "Upload failed for $rpms", $text, "Emi the upload bot <$config->{admin}>", 0); } # should delete the files @@ -284,5 +284,5 @@ foreach my $prefix (keys %pkg_tree) { } #dump_cache(\%run); -exit; +exit(); |