aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorent Villard <warly@mandriva.com>2006-05-29 16:10:04 +0000
committerFlorent Villard <warly@mandriva.com>2006-05-29 16:10:04 +0000
commitbb242a126c171417d2e96842e33529ddf3e52fcd (patch)
tree2677ed5fce0cfacdf65e23a51ce379f4722bb066
parentb4f3eac78c3c19ad2f635c02c01fe730a13f367b (diff)
downloadiurt-bb242a126c171417d2e96842e33529ddf3e52fcd.tar
iurt-bb242a126c171417d2e96842e33529ddf3e52fcd.tar.gz
iurt-bb242a126c171417d2e96842e33529ddf3e52fcd.tar.bz2
iurt-bb242a126c171417d2e96842e33529ddf3e52fcd.tar.xz
iurt-bb242a126c171417d2e96842e33529ddf3e52fcd.zip
do not send a mail when retrying to build the package without unionfs
-rwxr-xr-xiurt231
1 files changed, 18 insertions, 13 deletions
diff --git a/iurt2 b/iurt2
index 96c77e0..5a4917b 100755
--- a/iurt2
+++ b/iurt2
@@ -513,6 +513,13 @@ retry:
hash => "create_$srpm") or next;
print {$run{LOG}} "iurt: installing build dependencies of $srpm...\n" if $run{verbose};
+ my $wait_urpmi = sub {
+ print {$run{LOG}} "WARNING iurt: urpmi database locked, waiting...\n" if $run{debug};
+ sleep 30;
+ $wait_limit++;
+ if ($wait_limit > 8) {
+ $wait_limit = 0; system(qq{sudo pkill -9 urpmi &>/dev/null})
+ } };
if (!perform_command("sudo urpmi $urpmi_options --root $chroot_tmp $chroot_tmp/home/$luser/rpm/SRPMS/$srpm",
\%run, $config,
mail => $config->{admin},
@@ -526,13 +533,7 @@ retry:
debug_mail => $run{debug},
error_regexp => 'cannot be installed',
wait_regexp => 'database locked',
- wait_callback => sub {
- print {$run{LOG}} "WARNING iurt: urpmi database locked, waiting...\n" if $run{debug};
- sleep 30;
- $wait_limit++;
- if ($wait_limit > 8) {
- $wait_limit = 0; system(qq{sudo pkill -9 urpmi &>/dev/null})
- } },
+ wait_callback => $wait_urpmi,
log => "$local_spool/log/$srpm/",
callback => sub {
my ($opt, $output) = @_;
@@ -641,10 +642,12 @@ retry:
error => "[REBUILD] binaries packages generated from $srpm do not install correctly",
hash => "binary_test_$srpm",
srpm => $srpm,
- timeout => 300,
+ timeout => 600,
debug_mail => $run{debug},
freq => 1,
- error_regexp => 'unable to access',
+ wait_regexp => 'database locked',
+ wait_callback => $wait_urpmi,
+error_regexp => 'unable to access',
log => "$local_spool/log/$srpm/")) {
$cache->{failure}{$srpm} = 1;
$run{status}{$srpm} = 'binary_test_failure';
@@ -1088,7 +1091,8 @@ sub perform_command {
}
if (ref $opt{callback}) {
$call_ret = $opt{callback}(\%opt, $output);
- $call_ret == -1 and return 1
+ $call_ret == -1 and return 1;
+ $call_ret == -2 and return 0
}
if ($kill) {
$comment = "Command has been killed after $opt{timeout} seconds: $command\n";
@@ -1119,12 +1123,13 @@ sub perform_command {
if ($opt{log} && $config->{log_url}) {
$comment = qq|See $config->{log_url}/$run{distro_tag}/$run{my_arch}/log/$opt{srpm}/\n\n$comment|
}
+ my $out = $output if length $output < 10000;
if ($opt{mail} && $config->{sendmail} && !$config->{no_mail}{$opt{mail}}) {
if (! ($cache->{warning}{$opt{hash}}{$opt{mail}} % $opt{freq})) {
my $cc = join ',', grep { !$config->{no_mail}{$_} } split ',', $opt{cc};
- sendmail($opt{mail}, $cc, $opt{error} , "$comment\n$output", 0, 0, $opt{debug_mail});
+ sendmail($opt{mail}, $cc, $opt{error} , "$comment\n$out", 0, 0, $opt{debug_mail});
} elsif ($config->{admin}) {
- sendmail($config->{admin}, '' , $opt{error}, "$comment\n$output", 0, 0, $opt{debug_mail});
+ sendmail($config->{admin}, '' , $opt{error}, "$comment\n$out", 0, 0, $opt{debug_mail});
}
}
$cache->{warning}{$opt{hash}}{$opt{mail}}++;
@@ -1466,7 +1471,7 @@ sub add_sudo {
print {$run->{LOG}} "ERROR iurt: could not open $file ($!)\n";
return 0
}
- print $f qq{Cmnd_Alias RPM=/bin/rpm,/usr/sbin/urpmi,/usr/sbin/urpme,/usr/sbin/urpmi.addmedia
+ print $f qq{Cmnd_Alias RPM=/bin/rpm,/usr/sbin/urpmi,/usr/sbin/urpme,/usr/sbin/urpmi.addmedia,/usr/sbin/urpmi.update,/usr/sbin/urpmi.removemedia
root ALL=(ALL) ALL
$user ALL=(ALL) NOPASSWD:RPM
};