diff options
Diffstat (limited to 'iurt2')
-rwxr-xr-x | iurt2 | 37 |
1 files changed, 21 insertions, 16 deletions
@@ -55,6 +55,10 @@ $config->{upload} ||= "$HOME/uploads/"; $config->{local_home} ||= "$HOME"; $config->{base_dir} ||= "$HOME/uploads/"; $config->{repository} ||= "/mnt/BIG/dis/"; +$config->{packager} ||= "Iurt"; +$config->{install_chroot_binary} ||= 'install-chroot-tar.sh'; +$config->{distribution} ||= 'Mandriva Linux'; +$config->{vendor} ||= 'Mandriva'; $config->{base_dir} .= $distro_version; $config->{base_dir} =~ s/community//g; @@ -193,7 +197,7 @@ print "iurt: checking basesystem tar\n"; my $chroot = "$config->{local_home}/chroot"; my $chroot_tar = "$chroot-$distro_tag.$my_arch.tar.gz"; -perform_command("sudo ~warly/files/cvs//mdk/soft/rpm-rebuilder/install-chroot-tar.sh cooker $config->{repository}/$distro_version/$my_arch/media/main/ $chroot_tar $chroot 501 basesystem rpm-build", +perform_command("sudo $config->{install_chroot_binary} cooker $config->{repository}/$distro_version/$my_arch/media/main/ $chroot_tar $chroot 501 basesystem rpm-build", mail => 'maintainers@mandriva.com', error => "[REBUILD] Creating the inital chroot for $distro_tag on $my_arch failed", hash => 'chroot_inititialization', @@ -216,13 +220,13 @@ foreach my $t (@todo) { check_version($srpm) or next; print "iurt: installing a new chroot for $srpm in $chroot\n"; -d $chroot and perform_command("sudo rm -rf $chroot", - mail => 'warly@mandriva.com', + mail => $config->{admin}, error => "[REBUILD] Deleting of old chroot $chroot failed", hash => 'chroot_deletion', die => 1); mkdir $chroot; perform_command("pushd $chroot && sudo tar xvf $chroot_tar", - mail => 'warly@mandriva.com', + mail => $config->{admin}, error => "[REBUILD] creating the initial chroot $chroot failed", hash => 'chroot_init', die => 1); @@ -237,7 +241,7 @@ foreach my $t (@todo) { $maintainer = $cc; $cc = 'maintainers@mandriva.com' } - #($maintainer, $cc) = ('warly@mandriva.com',''); + #($maintainer, $cc) = ($config->{admin},''); print "Installing build dependencies of $srpm...\n"; # FIXME unfortunately urpmi stalls quite often system(qq{sudo pkill -9 -u root -f "urpmi --root $chroot"}); @@ -247,7 +251,7 @@ foreach my $t (@todo) { hash => "install_deps_$srpm", timeout => 600, cc => $cc, - error_regexp => 'cannot be installed', + error_regexp => 'cannot be installed|database locked', log => "$local_spool/log/") or next; perform_command("sudo chroot $chroot rpm -qa", hash => "rpm_qa_$srpm", @@ -255,7 +259,7 @@ foreach my $t (@todo) { log => "$local_spool/log/") or next; print "Copying $srpm to $chroot\n"; perform_command("sudo cp $dir/$srpm $chroot/home/builder/rpm/SRPMS/", - mail => 'warly@mandriva.com', + mail => $config->{admin}, error => "[REBUILD] cannot copy $srpm to $chroot", hash => "copy_$srpm") or next; print "Compiling $srpm\n"; @@ -299,7 +303,9 @@ if (open my $file, ">$local_spool/log/wrong_srpm_names.log") { } } -system("rsync -alHPe 'ssh -c arcfour' $local_spool/log/ mandrake\@qa:/var/www/html/build/iurt/$distro_tag/$my_arch/log/"); +if ($config->{rsync_to}) { + system("rsync -alHPe 'ssh -c arcfour' $local_spool/log/ $config->{rsync_to}/$distro_tag/$my_arch/log/"); +} unlink $pidfile; @@ -313,7 +319,7 @@ sub usage { usage: - iurt [options] <distro version> <arch> <media> + iurt <distro version> <arch> <media> e.g. iurt community/2006.0 x86_64 main "; @@ -368,7 +374,7 @@ sub dump_cache { sub sendmail { my ($to, $cc, $subject, $text, $from, $debug) = @_; do { print "Cannot find sender-email-address [$to]\n"; return } unless defined($to); - $from ||= "Iurt the rebuild bot <warly\@mandriva.com>"; + $from ||= $config->{packager}; my $MAIL; if (!$debug) { open $MAIL, "| /usr/sbin/sendmail -t" or return } else { open $MAIL, ">&STDOUT" or return } my $sender = encode_mimewords($to); @@ -433,13 +439,12 @@ sub perform_command { die unless $@ eq "alarm\n"; # propagate unexpected errors return 0 } else { - # didn't if ($? || $opt{error_regexp} && $output =~ /$opt{error_regexp}/) { - if ($opt{mail}) { + if ($opt{mail} && $config->{sendmail}) { if ($cache->{warning}{$opt{hash}}{$my_arch}{$opt{mail}} % $opt{freq}) { sendmail($opt{mail}, $opt{cc} , $opt{error} , $output, 0, 0); - } else { - sendmail('warly@mandriva.com', '' , $opt{error}, $output, 0, 0); + } elsif ($config->{admin}) { + sendmail($config->{admin}, '' , $opt{error}, $output, 0, 0); } } $cache->{warning}{$opt{hash}}{$my_arch}{$opt{mail}}++; @@ -469,7 +474,7 @@ sub dump_rpmmacros { open my $f, qq{| sudo sh -c "cat > $file"} or return 0; print $f qq{\%_topdir \%(echo \$HOME)/rpm \%_tmppath \%(echo \$HOME)/rpm/tmp/ -\%distribution Mandriva Linux -\%vendor Mandriva -\%packager Iurt <warly\@mandriva.com>} +\%distribution $config->{distribution} +\%vendor $config->{vendor} +\%packager $config->{packager}} } |